Land #2785, @todb-r7's support for post modules on msfcli
This commit is contained in:
commit
2cc4fa35cf
2
msfcli
2
msfcli
|
@ -312,6 +312,8 @@ class Msfcli
|
||||||
modules[:module] = @framework.exploits.create($1)
|
modules[:module] = @framework.exploits.create($1)
|
||||||
elsif module_name =~ /auxiliary\/(.*)/
|
elsif module_name =~ /auxiliary\/(.*)/
|
||||||
modules[:module] = @framework.auxiliary.create($1)
|
modules[:module] = @framework.auxiliary.create($1)
|
||||||
|
elsif module_name =~ /post\/(.*)/
|
||||||
|
modules[:module] = @framework.post.create($1)
|
||||||
else
|
else
|
||||||
modules[:module] = @framework.exploits.create(module_name)
|
modules[:module] = @framework.exploits.create(module_name)
|
||||||
if modules[:module].nil?
|
if modules[:module].nil?
|
||||||
|
|
|
@ -222,6 +222,37 @@ describe Msfcli do
|
||||||
end
|
end
|
||||||
|
|
||||||
context ".init_modules" do
|
context ".init_modules" do
|
||||||
|
|
||||||
|
it "should inititalize an exploit module" do
|
||||||
|
args = 'exploit/windows/smb/psexec S'
|
||||||
|
m = ''
|
||||||
|
stdout = get_stdout {
|
||||||
|
cli = Msfcli.new(args.split(' '))
|
||||||
|
m = cli.init_modules
|
||||||
|
}
|
||||||
|
m[:module].class.to_s.should start_with("Msf::Modules::Mod")
|
||||||
|
end
|
||||||
|
|
||||||
|
it "should inititalize an auxiliary module" do
|
||||||
|
args = 'auxiliary/server/browser_autopwn S'
|
||||||
|
m = ''
|
||||||
|
stdout = get_stdout {
|
||||||
|
cli = Msfcli.new(args.split(' '))
|
||||||
|
m = cli.init_modules
|
||||||
|
}
|
||||||
|
m[:module].class.to_s.should start_with("Msf::Modules::Mod")
|
||||||
|
end
|
||||||
|
|
||||||
|
it "should inititalize a post module" do
|
||||||
|
args = 'post/windows/gather/credentials/gpp S'
|
||||||
|
m = ''
|
||||||
|
stdout = get_stdout {
|
||||||
|
cli = Msfcli.new(args.split(' '))
|
||||||
|
m = cli.init_modules
|
||||||
|
}
|
||||||
|
m[:module].class.to_s.should start_with("Msf::Modules::Mod")
|
||||||
|
end
|
||||||
|
|
||||||
it "should have multi/handler module initialized" do
|
it "should have multi/handler module initialized" do
|
||||||
args = "multi/handler payload=windows/meterpreter/reverse_tcp lhost=127.0.0.1 E"
|
args = "multi/handler payload=windows/meterpreter/reverse_tcp lhost=127.0.0.1 E"
|
||||||
m = ''
|
m = ''
|
||||||
|
@ -384,4 +415,4 @@ describe Msfcli do
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue