Skip to content

Commit 9041730

Browse files
authored
Merge branch 'master' into add-opnsense-login-scanner
2 parents daddc6e + 4303da1 commit 9041730

File tree

977 files changed

+37120
-23700
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

977 files changed

+37120
-23700
lines changed

.github/workflows/ldap_acceptance.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ on:
3333
- 'metsploit-framework.gemspec'
3434
- 'Gemfile.lock'
3535
- '**/**ldap**'
36+
- 'lib/metasploit/framework/tcp/**'
37+
- 'lib/metasploit/framework/login_scanner/**'
3638
- 'spec/acceptance/**'
3739
- 'spec/support/acceptance/**'
3840
- 'spec/acceptance_spec_helper.rb'

.github/workflows/postgres_acceptance.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ on:
3333
- 'metsploit-framework.gemspec'
3434
- 'Gemfile.lock'
3535
- '**/**postgres**'
36+
- 'lib/metasploit/framework/tcp/**'
37+
- 'lib/metasploit/framework/login_scanner/**'
3638
- 'spec/acceptance/**'
3739
- 'spec/support/acceptance/**'
3840
- 'spec/acceptance_spec_helper.rb'
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Shared Gem Verify
2+
on:
3+
workflow_call:
4+
inputs:
5+
test_commands:
6+
description: 'Test commands'
7+
required: false
8+
default: "bundle exec rspec"
9+
type: string
10+
dependencies:
11+
description: 'Array of system dependencies to install'
12+
required: false
13+
default: "[]"
14+
type: string
15+
16+
jobs:
17+
test:
18+
runs-on: ${{ matrix.os }}
19+
timeout-minutes: 40
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
ruby:
25+
- '3.2'
26+
- '3.3'
27+
- '3.4'
28+
os:
29+
- ubuntu-20.04
30+
- ubuntu-22.04
31+
- ubuntu-24.04
32+
- ubuntu-latest
33+
- windows-2019
34+
- macos-13
35+
36+
env:
37+
RAILS_ENV: test
38+
39+
name: ${{ matrix.os }} - Ruby ${{ matrix.ruby }}
40+
steps:
41+
- name: Install system dependencies
42+
if: ${{ inputs.dependencies != '[]' && !contains(matrix.os, 'macos') && !contains(matrix.os, 'windows') }}
43+
run: |
44+
dependencies=$(echo '${{ inputs.dependencies }}' | jq -r '.[]')
45+
for dep in $dependencies; do
46+
sudo apt-get -y --no-install-recommends install "$dep"
47+
done
48+
shell: bash
49+
50+
- name: Install system dependencies (Windows)
51+
if: ${{ contains(matrix.os, 'windows') && inputs.dependencies != '[]' }}
52+
run: |
53+
$dependencies = (echo '${{ inputs.dependencies }}' | jq -r '.[]')
54+
foreach ($dep in $dependencies) {
55+
choco install $dep -y
56+
}
57+
shell: pwsh
58+
59+
- name: Checkout code
60+
uses: actions/checkout@v4
61+
62+
- name: Setup Ruby
63+
uses: ruby/setup-ruby@v1
64+
with:
65+
ruby-version: ${{ matrix.ruby }}
66+
bundler-cache: true
67+
68+
- name: Test
69+
run: ${{ inputs.test_commands }}
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Shared Gem Verify Rails/PostgreSQL
2+
on:
3+
workflow_call:
4+
inputs:
5+
test_commands:
6+
description: 'Test commands'
7+
required: false
8+
default: "bundle exec rspec"
9+
type: string
10+
dependencies:
11+
description: 'Array of system dependencies to install'
12+
required: false
13+
default: "[]"
14+
type: string
15+
16+
jobs:
17+
test:
18+
runs-on: ${{ matrix.os }}
19+
timeout-minutes: 40
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
ruby:
25+
- '3.2'
26+
- '3.3'
27+
- '3.4'
28+
rails:
29+
- '~> 7.0.0'
30+
- '~> 7.1.0'
31+
- '~> 7.2.0'
32+
postgres:
33+
- '9.6'
34+
- '16.8'
35+
os:
36+
- ubuntu-latest
37+
38+
env:
39+
RAILS_ENV: test
40+
41+
name: ${{ matrix.os }} - Ruby ${{ matrix.ruby }} - Rails ${{ matrix.rails }} - PostgreSQL ${{ matrix.postgres }}
42+
steps:
43+
- name: Install system dependencies
44+
run: |
45+
dependencies=$(echo '${{ inputs.dependencies }}' | jq -r '.[]')
46+
for dep in $dependencies; do
47+
sudo apt-get -y --no-install-recommends install "$dep"
48+
done
49+
shell: bash
50+
51+
- name: Set up PostgreSQL service
52+
run: |
53+
docker run --name postgres -d -p 5432:5432 \
54+
-e POSTGRES_USER=postgres \
55+
-e POSTGRES_PASSWORD=postgres \
56+
--health-cmd="pg_isready" \
57+
--health-interval="10s" \
58+
--health-timeout="5s" \
59+
--health-retries=5 \
60+
postgres:${{ matrix.postgres }}
61+
62+
- name: Wait for PostgreSQL to be healthy
63+
run: |
64+
docker exec postgres sh -c 'until pg_isready -U postgres; do echo waiting for postgres; sleep 2; done; echo postgres is ready'
65+
66+
- name: Checkout code
67+
uses: actions/checkout@v4
68+
69+
- name: Setup Ruby
70+
uses: ruby/setup-ruby@v1
71+
with:
72+
ruby-version: ${{ matrix.ruby }}
73+
bundler-cache: true
74+
75+
- name: Update Rails version
76+
run: |
77+
# Add the gem explicitly if it doesn't exist
78+
if ! grep -q "gem ['\"]rails['\"]" Gemfile; then
79+
echo 'gem "rails"' >> Gemfile
80+
fi
81+
82+
# Ensure the gem is on the latest version
83+
ruby -pi -e "gsub(/gem ['\"]rails['\"](, *['\"].*['\"])?/, \"gem 'rails', '${{ matrix.rails }}'\")" Gemfile
84+
bundle update
85+
bundle install
86+
bundle show rails
87+
shell: bash
88+
89+
- name: Test
90+
run: ${{ inputs.test_commands }}

CONTRIBUTING.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Once you have finished your new module and tested it locally to ensure it's work
2222
Finally, follow our short list of do's and don'ts below to make sure your valuable contributions actually make it into Metasploit's master branch! We try to consider all our pull requests fairly and in detail, but if you do not follow these rules, your contribution
2323
will be closed. We need to ensure the code we're adding to master is written to a high standard.
2424

25+
## Expedited Module Creation Process
26+
We strive to respect the community that has given us so much, so in the odd situation where we get multiple submissions for the same vulnerability, generally we will work with the first person who assigns themselves to the issue or the first person that submits a good-faith PR. A good-faith PR might not even work, but it will show that the author is working their way toward a solution. Despite this general rule, there are rare circumstances where we may ask a contributor to step aside or allow a committer to take the lead on the creation of a new module if a complete and working module with documents has not already been submitted. This kind of expedited module creation process comes up infrequently, and usually it involves high-profile or high priority modules that we have marked internally as time-critical: think KEV list, active exploitation campaigns, CISA announcements, etc. In those cases, we may ask a contributor that is assigned to the issue or who has submitted an incomplete module to allow a committer to take over an issue or a module PR in the interest of getting a module out quickly. If a contributor has submitted an incomplete module, they will remain as a co-author of the module and we may build directly onto the PR they submitted, leaving the original commits in the tree. We sincerely hope that the original author will remain involved in this expedited module creation process. We would appreciate testing, critiquing, and any assistance that can be offered. If the module is complete but requires minor changes, we may ask the contributor to allow us to take over testing/verification and make these minor changes without asking so we can land the module as quickly as possible. In these cases of minor code changes, the authorship of the module will remain unchanged. We hope everyone involved in this expedited module creation process continues to feel valued and appreciated.
2527

2628
### Code Contribution Do's & Don'ts:
2729

@@ -40,13 +42,18 @@ Keeping the following in mind gives your contribution the best chance of landing
4042
* **Do** target your pull request to the **master branch**.
4143
* **Do** specify a descriptive title to make searching for your pull request easier.
4244
* **Do** include [console output], especially for effects that can be witnessed in the `msfconsole`.
43-
* **Do** list [verification steps] so your code is testable.
45+
* **Do** test your code.
46+
* **Do** list [verification steps] so committers can test your code.
4447
* **Do** [reference associated issues] in your pull request description.
4548
* **Don't** leave your pull request description blank.
49+
* **Don't** include sensitive information in your PR (including externally-routable IP addresses in documentation).
50+
* **Don't** PR untested/unvalidated code you copy/pasted from the internet.
51+
* **Don't** PR untested/unvalidated code you copy/pasted from AI or LLM.
4652
* **Don't** abandon your pull request. Being responsive helps us land your code faster.
4753
* **Don't** post questions in older closed PRs.
4854

4955
#### <u>New Modules</u>
56+
* **Do** check the issue tracker to see if there is a `suggestion-module` issue for the module you want to write, and assign yourself to it if there is.
5057
* **Do** license your code as BSD 3-clause, BSD 2-clause, or MIT.
5158
* **Do** stick to the [Ruby style guide] and use [Rubocop] to find common style issues.
5259
* **Do** set up `msftidy` to fix any errors or warnings that come up as a [pre-commit hook].

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM ruby:3.2.5-alpine3.20 AS builder
22
LABEL maintainer="Rapid7"
33

4-
ARG BUNDLER_CONFIG_ARGS="set no-cache 'true' set system 'true' set without 'development test coverage'"
4+
ARG BUNDLER_CONFIG_ARGS="set force_ruby_platform 'true' set no-cache 'true' set system 'true' set without 'development test coverage'"
55
ARG BUNDLER_FORCE_CLEAN="true"
66
ENV APP_HOME=/usr/src/metasploit-framework
77
ENV TOOLS_HOME=/usr/src/tools

0 commit comments

Comments
 (0)