mirror of
https://github.com/rapid7/metasploit-framework
synced 2024-10-29 18:07:27 +01:00
msfcli - fixed impcomplete argument parsing
This commit is contained in:
parent
fca732d893
commit
6f7152a3da
15
msfcli
15
msfcli
@ -141,8 +141,12 @@ exploit.init_ui(
|
||||
mode = ARGV.pop || 'h'
|
||||
|
||||
# Import options
|
||||
exploit.datastore.import_options_from_s(ARGV.join('_|_'), '_|_')
|
||||
|
||||
begin
|
||||
exploit.datastore.import_options_from_s(ARGV.join('_|_'), '_|_')
|
||||
rescue => e
|
||||
print "[!] Error: #{e}\n\n"
|
||||
exit
|
||||
end
|
||||
|
||||
# Initialize associated modules
|
||||
payload = nil
|
||||
@ -152,21 +156,21 @@ nop = nil
|
||||
if (exploit.datastore['PAYLOAD'])
|
||||
payload = $framework.payloads.create(exploit.datastore['PAYLOAD'])
|
||||
if (payload != nil)
|
||||
payload.datastore.import_options_from_s(ARGV.join('_|_'), '_|_')
|
||||
payload.datastore.import_options_from_s(ARGV.join('_|_'), '_|_')
|
||||
end
|
||||
end
|
||||
|
||||
if (exploit.datastore['ENCODER'])
|
||||
encoder = $framework.encoders.create(exploit.datastore['ENCODER'])
|
||||
if (encoder != nil)
|
||||
encoder.datastore.import_options_from_s(ARGV.join('_|_'), '_|_')
|
||||
encoder.datastore.import_options_from_s(ARGV.join('_|_'), '_|_')
|
||||
end
|
||||
end
|
||||
|
||||
if (exploit.datastore['NOP'])
|
||||
nop = $framework.nops.create(exploit.datastore['NOP'])
|
||||
if (nop != nil)
|
||||
nop.datastore.import_options_from_s(ARGV.join('_|_'), '_|_')
|
||||
nop.datastore.import_options_from_s(ARGV.join('_|_'), '_|_')
|
||||
end
|
||||
end
|
||||
|
||||
@ -178,7 +182,6 @@ case mode.downcase
|
||||
$stdout.puts("\n" + Msf::Serializer::ReadableText.dump_module(payload, Indent)) if payload
|
||||
$stdout.puts("\n" + Msf::Serializer::ReadableText.dump_module(encoder, Indent)) if encoder
|
||||
$stdout.puts("\n" + Msf::Serializer::ReadableText.dump_module(nop, Indent)) if nop
|
||||
|
||||
when "o"
|
||||
$stdout.puts("\n" + Msf::Serializer::ReadableText.dump_options(exploit, Indent))
|
||||
$stdout.puts("\n" + Msf::Serializer::ReadableText.dump_options(payload, Indent)) if payload
|
||||
|
Loading…
Reference in New Issue
Block a user