diff --git a/msfvenom b/msfvenom index 6d01c0b172..114fcdd2d4 100755 --- a/msfvenom +++ b/msfvenom @@ -318,6 +318,7 @@ class MsfVenom # If it's not stdin, we'll already have a PlatformList @opts[:platform] ||= payload.platform payload.datastore.merge! @datastore + if @opts[:list_options] print_status("Options for #{payload.fullname}\n\n" + ::Msf::Serializer::ReadableText.dump_module(payload,' ')) diff --git a/spec/msfvenom_spec.rb b/spec/msfvenom_spec.rb index 04fa5da9af..d3db1ea226 100644 --- a/spec/msfvenom_spec.rb +++ b/spec/msfvenom_spec.rb @@ -143,6 +143,23 @@ describe MsfVenom do output.should include("LHOST") output.should include("LPORT") 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 context "and an invalid payload" do