metasploit-runner 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/MetasploitPenTestScript/version.rb +1 -1
- data/lib/metasploit/constants.rb +2 -2
- data/lib/metasploit/exploit.rb +4 -0
- data/spec/exploit_spec.rb +12 -12
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c1f3e540898c891a4d9473fde87b342eb1b31c1
|
4
|
+
data.tar.gz: 3c540a76097bab3eeea6a50a6ad05831df2f9035
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f8c38817ad0c37fb49f29359b667bb14a73cd51d4c5117ce5ac4a9c093f0b7b755d3345a4563ec9b895433d63b5e9ea7c2a58f66e00315976add00fc2965041
|
7
|
+
data.tar.gz: a1fec8df21779de8811c181cf4b78d8e78e1b3cffec5687f46cf24722bfadce85621d4f518981dec1f58ce4fc8965cbbbb449085f2277edd0d1d4b0aad6bb28f
|
data/lib/metasploit/constants.rb
CHANGED
@@ -11,8 +11,8 @@ module CONSTANTS
|
|
11
11
|
USING_DEFAULT_URI_MESSAGE = '[*] No URI specified in call, using /api/1.0 as default'
|
12
12
|
SUCCESSFUL_CONNECTION_MESSAGE = '[*] Sucessfully authenticated to the Metasploit server'
|
13
13
|
USING_DEFAULT_SSL_MESSAGE = '[*] Using SSL=TRUE'
|
14
|
-
IMPORTING_DATA_MESSAGE = '[*] Importing...'
|
15
|
-
SCANNING_MESSAGE = '[*] Scanning all your things...'
|
14
|
+
IMPORTING_DATA_MESSAGE = '[*] Importing scan data from Nexpose...'
|
15
|
+
SCANNING_MESSAGE = '[*] Scanning all your things with WebScan...'
|
16
16
|
EXPLOIT_MESSAGE = '[*] Exploiting all your things...'
|
17
17
|
REQUIRED_WORKSPACE_MESSAGE = 'PWNED! Workspace Name is required'
|
18
18
|
SKIPPING_IMPORT_MESSAGE = '[*] Nexpose Console option was not passed, skipping Nexpose Import'
|
data/lib/metasploit/exploit.rb
CHANGED
@@ -56,6 +56,10 @@ module Metasploit
|
|
56
56
|
sleep(3)
|
57
57
|
status = rpc_client.call('pro.task_status', task_id)
|
58
58
|
puts status_message
|
59
|
+
progress = status.fetch(task_id, {}).fetch('progress', {})
|
60
|
+
puts "This task is #{progress} % complete"
|
61
|
+
info = status.fetch(task_id, {}).fetch('info', {})
|
62
|
+
puts "I am currently executing: #{info}"
|
59
63
|
status = status.fetch(task_id, {}).fetch('status', {})
|
60
64
|
|
61
65
|
wait_for_task_to_stop_running(rpc_client, status_message, task_id) if status == CONSTANTS::RUNNING_IMPORT_STATUS
|
data/spec/exploit_spec.rb
CHANGED
@@ -111,13 +111,13 @@ describe 'exploit' do
|
|
111
111
|
it 'should call to check the status until it is not running' do
|
112
112
|
expect(@mock_rpc_client).to receive(:call)
|
113
113
|
.with('pro.task_status', @expected_import_task_id)
|
114
|
-
.and_return({'1'=>{'status' => 'running'}})
|
114
|
+
.and_return({'1'=>{'status' => 'running', 'progress' => 25, 'info' => 'Generating the export data file'}})
|
115
115
|
.exactly(3).times
|
116
116
|
.ordered
|
117
117
|
|
118
118
|
expect(@mock_rpc_client).to receive(:call)
|
119
119
|
.with('pro.task_status', @expected_import_task_id)
|
120
|
-
.and_return({'1'=>{'status' => 'not running'}})
|
120
|
+
.and_return({'1'=>{'status' => 'not running', 'progress' => 100, 'info' => 'Complete'}})
|
121
121
|
.once
|
122
122
|
.ordered
|
123
123
|
|
@@ -127,13 +127,13 @@ describe 'exploit' do
|
|
127
127
|
it 'should sleep for 3 seconds if the status is still running' do
|
128
128
|
expect(@mock_rpc_client).to receive(:call)
|
129
129
|
.with('pro.task_status', @expected_import_task_id)
|
130
|
-
.and_return({'1'=>{'status' => 'running'}})
|
130
|
+
.and_return({'1'=>{'status' => 'running', 'progress' => 25, 'info' => 'Generating the export data file'}})
|
131
131
|
.exactly(3).times
|
132
132
|
.ordered
|
133
133
|
|
134
134
|
expect(@mock_rpc_client).to receive(:call)
|
135
135
|
.with('pro.task_status', @expected_import_task_id)
|
136
|
-
.and_return({'1'=>{'status' => 'not running'}})
|
136
|
+
.and_return({'1'=>{'status' => 'not running', 'progress' => 100, 'info' => 'Complete'}})
|
137
137
|
.once
|
138
138
|
.ordered
|
139
139
|
|
@@ -171,13 +171,13 @@ describe 'exploit' do
|
|
171
171
|
it 'should call to check the status until it is not running' do
|
172
172
|
expect(@mock_rpc_client).to receive(:call)
|
173
173
|
.with('pro.task_status', @expected_webscan_task_id)
|
174
|
-
.and_return({'12'=>{'status' => 'running'}})
|
174
|
+
.and_return({'12'=>{'status' => 'running', 'progress' => 50, 'info' => 'Validating Target URLs'}})
|
175
175
|
.exactly(3).times
|
176
176
|
.ordered
|
177
177
|
|
178
178
|
expect(@mock_rpc_client).to receive(:call)
|
179
179
|
.with('pro.task_status', @expected_webscan_task_id)
|
180
|
-
.and_return({'12'=>{'status' => 'not running'}})
|
180
|
+
.and_return({'12'=>{'status' => 'not running', 'progress' => 100, 'info' => 'Complete'}})
|
181
181
|
.once
|
182
182
|
.ordered
|
183
183
|
|
@@ -187,13 +187,13 @@ describe 'exploit' do
|
|
187
187
|
it 'should sleep for 3 seconds if the status is still running' do
|
188
188
|
expect(@mock_rpc_client).to receive(:call)
|
189
189
|
.with('pro.task_status', @expected_webscan_task_id)
|
190
|
-
.and_return({'12'=>{'status' => 'running'}})
|
190
|
+
.and_return({'12'=>{'status' => 'running', 'progress' => 50, 'info' => 'Validating Target URLs'}})
|
191
191
|
.exactly(3).times
|
192
192
|
.ordered
|
193
193
|
|
194
194
|
expect(@mock_rpc_client).to receive(:call)
|
195
195
|
.with('pro.task_status', @expected_webscan_task_id)
|
196
|
-
.and_return({'12'=>{'status' => 'not running'}})
|
196
|
+
.and_return({'12'=>{'status' => 'not running', 'progress' => 100, 'info' => 'Complete'}})
|
197
197
|
.once
|
198
198
|
.ordered
|
199
199
|
|
@@ -231,13 +231,13 @@ describe 'exploit' do
|
|
231
231
|
it 'should call to check the status until it is not running' do
|
232
232
|
expect(@mock_rpc_client).to receive(:call)
|
233
233
|
.with('pro.task_status', @expected_exploit_task_id)
|
234
|
-
.and_return({'13'=>{'status' => 'running'}})
|
234
|
+
.and_return({'13'=>{'status' => 'running', 'progress' => 3, 'info' => 'WordPress Asset-Manager PHP File Upload Vulnerability'}})
|
235
235
|
.exactly(3).times
|
236
236
|
.ordered
|
237
237
|
|
238
238
|
expect(@mock_rpc_client).to receive(:call)
|
239
239
|
.with('pro.task_status', @expected_exploit_task_id)
|
240
|
-
.and_return({'13'=>{'status' => 'not running'}})
|
240
|
+
.and_return({'13'=>{'status' => 'not running', 'progress' => 100, 'info' => 'Complete'}})
|
241
241
|
.once
|
242
242
|
.ordered
|
243
243
|
|
@@ -247,13 +247,13 @@ describe 'exploit' do
|
|
247
247
|
it 'should sleep for 3 seconds if the status is still running' do
|
248
248
|
expect(@mock_rpc_client).to receive(:call)
|
249
249
|
.with('pro.task_status', @expected_exploit_task_id)
|
250
|
-
.and_return({'13'=>{'status' => 'running'}})
|
250
|
+
.and_return({'13'=>{'status' => 'running', 'progress' => 3, 'info' => 'WordPress Asset-Manager PHP File Upload Vulnerability'}})
|
251
251
|
.exactly(3).times
|
252
252
|
.ordered
|
253
253
|
|
254
254
|
expect(@mock_rpc_client).to receive(:call)
|
255
255
|
.with('pro.task_status', @expected_exploit_task_id)
|
256
|
-
.and_return({'13'=>{'status' => 'not running'}})
|
256
|
+
.and_return({'13'=>{'status' => 'not running', 'progress' => 100, 'info' => 'Complete'}})
|
257
257
|
.once
|
258
258
|
.ordered
|
259
259
|
|