Skip to content

Commit 84ca830

Browse files
committed
Extract stager/adapter information
1 parent b135b81 commit 84ca830

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

.github/workflows/module-info.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
fail-fast: true
3232
matrix:
3333
ruby:
34-
- 2.7
34+
- 3.2
3535
info_cmd:
3636
- >-
3737
set -euxo pipefail;
@@ -56,7 +56,6 @@ jobs:
5656
with:
5757
path: metasploit-info
5858

59-
6059
- name: ${{ matrix.test_cmd }}
6160
run: |
6261
echo "${CMD}"
@@ -70,9 +69,11 @@ jobs:
7069
repository: rapid7/metasploit-framework
7170
path: metasploit-framework
7271

73-
- uses: actions/setup-ruby@v1
72+
- name: Setup Ruby
73+
uses: ruby/setup-ruby@v1
7474
with:
7575
ruby-version: ${{ matrix.ruby }}
76+
bundler-cache: true
7677

7778
- name: Setup bundler
7879
run: |
@@ -111,7 +112,7 @@ jobs:
111112
CMD: ${{ matrix.info_cmd }}
112113

113114
- name: Commit
114-
uses: EndBug/add-and-commit@v6
115+
uses: EndBug/add-and-commit@v9
115116
with:
116117
add: './info'
117118
author_name: Metasploit Github Actions

resources/extract_module_info.rc

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ end
7878

7979
# Mixins that can be filtered as they're not interesting
8080
common_mixins = (
81-
Msf::Exploit.ancestors +
82-
Msf::Auxiliary.ancestors +
81+
Msf::Exploit.ancestors &
82+
Msf::Auxiliary.ancestors &
8383
Msf::Post.ancestors
84-
).map(&:to_s).uniq
84+
).map(&:to_s)
8585

8686
_, total_time = record_time do
8787
STDERR.puts 'Extracting module paths'
@@ -154,7 +154,20 @@ _, total_time = record_time do
154154
}
155155

156156
if module_set_name == 'exploit'
157-
data[:compatible_payloads] = mod.compatible_payloads.map { |payload_name, payload_class| payload_name }
157+
data[:compatible_payloads] = mod.compatible_payloads.map { |payload_name, payload_class| payload_name }
158+
end
159+
160+
if module_set_name == 'payload'
161+
payload_data = {
162+
payload_type: mod.payload_type,
163+
adapter_refname: mod.adapter_refname,
164+
adapted_refname: mod.adapted_refname,
165+
# adapted: mod.adapted?,
166+
staged: mod.staged?,
167+
stage_refname: mod.stage_refname,
168+
stager_refname: mod.stager_refname,
169+
}.compact
170+
data.merge!(payload_data)
158171
end
159172

160173
data

0 commit comments

Comments
 (0)