parent
6c6ad28da2
commit
8e2df73f2c
1
msfvenom
1
msfvenom
|
@ -318,6 +318,7 @@ class MsfVenom
|
||||||
# If it's not stdin, we'll already have a PlatformList
|
# If it's not stdin, we'll already have a PlatformList
|
||||||
@opts[:platform] ||= payload.platform
|
@opts[:platform] ||= payload.platform
|
||||||
payload.datastore.merge! @datastore
|
payload.datastore.merge! @datastore
|
||||||
|
|
||||||
if @opts[:list_options]
|
if @opts[:list_options]
|
||||||
print_status("Options for #{payload.fullname}\n\n" +
|
print_status("Options for #{payload.fullname}\n\n" +
|
||||||
::Msf::Serializer::ReadableText.dump_module(payload,' '))
|
::Msf::Serializer::ReadableText.dump_module(payload,' '))
|
||||||
|
|
|
@ -143,6 +143,23 @@ describe MsfVenom do
|
||||||
output.should include("LHOST")
|
output.should include("LHOST")
|
||||||
output.should include("LPORT")
|
output.should include("LPORT")
|
||||||
end
|
end
|
||||||
|
context "and some datastore options" do
|
||||||
|
it "should print options" do
|
||||||
|
venom.parse_args %w! -o -p windows/meterpreter/reverse_tcp LPORT=1234!
|
||||||
|
expect { venom.generate_raw_payload }.to_not raise_error
|
||||||
|
output = stderr.string
|
||||||
|
output.should include("LHOST")
|
||||||
|
output.should match(/LPORT\s+1234/)
|
||||||
|
end
|
||||||
|
|
||||||
|
it "should print options case-insensitively" do
|
||||||
|
venom.parse_args %w! -o -p windows/meterpreter/reverse_tcp lPoRt=1234!
|
||||||
|
expect { venom.generate_raw_payload }.to_not raise_error
|
||||||
|
output = stderr.string
|
||||||
|
output.should include("LHOST")
|
||||||
|
output.should match(/LPORT\s+1234/)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "and an invalid payload" do
|
context "and an invalid payload" do
|
||||||
|
|
Loading…
Reference in New Issue