Merge remote-tracking branch 'wvu-r7/fix-msfpayload-1944' into csharp_payload
commit
2f91a541fb
|
@ -30,7 +30,7 @@ $args = Rex::Parser::Arguments.new(
|
|||
#
|
||||
def usage
|
||||
$stderr.puts("\n" +
|
||||
" Usage: #{$0} [<options>] <payload> [var=val] <[S]ummary|C|[P]erl|Rub[y]|[R]aw|[J]s|e[X]e|[D]ll|[V]BA|[W]ar|Pytho[N]>\n" +
|
||||
" Usage: #{$0} [<options>] <payload> [var=val] <[S]ummary|C|Cs[H]arp|[P]erl|Rub[Y]|[R]aw|[J]s|e[X]e|[D]ll|[V]BA|[W]ar|Pytho[N]>\n" +
|
||||
$args.usage)
|
||||
exit
|
||||
end
|
||||
|
@ -119,13 +119,13 @@ end
|
|||
|
||||
payload.datastore.merge! options
|
||||
|
||||
if (cmd =~ /^(p|y|r|d|c|j|x|b|v|w|n)/)
|
||||
if (cmd =~ /^(p|y|r|d|c|h|j|x|b|v|w|n)/)
|
||||
fmt = 'perl' if (cmd =~ /^p/)
|
||||
fmt = 'ruby' if (cmd =~ /^y/)
|
||||
fmt = 'raw' if (cmd =~ /^(r|x|d)/)
|
||||
fmt = 'raw' if (cmd =~ /^v/)
|
||||
fmt = 'c' if (cmd == 'c')
|
||||
fmt = 'csharp' if (cmd == 'csharp')
|
||||
fmt = 'csharp' if (cmd == 'h')
|
||||
fmt = 'js_be' if (cmd =~ /^j/ and Rex::Arch.endian(payload.arch) == ENDIAN_BIG)
|
||||
fmt = 'js_le' if (cmd =~ /^j/ and ! fmt)
|
||||
fmt = 'java' if (cmd =~ /^b/)
|
||||
|
|
4
msfvenom
4
msfvenom
|
@ -422,12 +422,12 @@ end
|
|||
|
||||
$stdout.binmode
|
||||
|
||||
if opts[:format] !~/ruby|rb|perl|pl|bash|sh|c|js|dll|elf/i
|
||||
if opts[:format] !~/ruby|rb|perl|pl|bash|sh|c|csharp|js|dll|elf/i
|
||||
exe = Msf::Util::EXE.to_executable_fmt($framework, opts[:arch], opts[:platform], payload_raw, opts[:format], exeopts)
|
||||
end
|
||||
|
||||
case opts[:format]
|
||||
when /ruby|rb|perl|pl|bash|^sh$|^c$|js_le|raw|^py/i
|
||||
when /ruby|rb|perl|pl|bash|^sh$|^c$|^csharp$|js_le|raw|^py/i
|
||||
$stdout.write Msf::Simple::Buffer.transform(payload_raw, opts[:format])
|
||||
when /asp$/
|
||||
asp = Msf::Util::EXE.to_win32pe_asp($framework, payload_raw, exeopts)
|
||||
|
|
Loading…
Reference in New Issue