File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -312,6 +312,8 @@ class Msfcli
312
312
modules [ :module ] = @framework . exploits . create ( $1)
313
313
elsif module_name =~ /auxiliary\/ (.*)/
314
314
modules [ :module ] = @framework . auxiliary . create ( $1)
315
+ elsif module_name =~ /post\/ (.*)/
316
+ modules [ :module ] = @framework . post . create ( $1)
315
317
else
316
318
modules [ :module ] = @framework . exploits . create ( module_name )
317
319
if modules [ :module ] . nil?
Original file line number Diff line number Diff line change @@ -222,6 +222,37 @@ def get_stdout(&block)
222
222
end
223
223
224
224
context ".init_modules" do
225
+
226
+ it "should inititalize an exploit module" do
227
+ args = 'exploit/windows/smb/psexec S'
228
+ m = ''
229
+ stdout = get_stdout {
230
+ cli = Msfcli . new ( args . split ( ' ' ) )
231
+ m = cli . init_modules
232
+ }
233
+ m [ :module ] . class . to_s . should start_with ( "Msf::Modules::Mod" )
234
+ end
235
+
236
+ it "should inititalize an auxiliary module" do
237
+ args = 'auxiliary/server/browser_autopwn S'
238
+ m = ''
239
+ stdout = get_stdout {
240
+ cli = Msfcli . new ( args . split ( ' ' ) )
241
+ m = cli . init_modules
242
+ }
243
+ m [ :module ] . class . to_s . should start_with ( "Msf::Modules::Mod" )
244
+ end
245
+
246
+ it "should inititalize a post module" do
247
+ args = 'post/windows/gather/credentials/gpp S'
248
+ m = ''
249
+ stdout = get_stdout {
250
+ cli = Msfcli . new ( args . split ( ' ' ) )
251
+ m = cli . init_modules
252
+ }
253
+ m [ :module ] . class . to_s . should start_with ( "Msf::Modules::Mod" )
254
+ end
255
+
225
256
it "should have multi/handler module initialized" do
226
257
args = "multi/handler payload=windows/meterpreter/reverse_tcp lhost=127.0.0.1 E"
227
258
m = ''
@@ -384,4 +415,4 @@ def get_stdout(&block)
384
415
end
385
416
386
417
end
387
- end
418
+ end
You can’t perform that action at this time.
0 commit comments