diff --git a/msfpayload b/msfpayload index 06d31f6237..3dad757b33 100755 --- a/msfpayload +++ b/msfpayload @@ -30,7 +30,7 @@ $args = Rex::Parser::Arguments.new( # def usage $stderr.puts("\n" + - " Usage: #{$0} [] [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} [] [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/) diff --git a/msfvenom b/msfvenom index 10c396f82c..75815741cf 100755 --- a/msfvenom +++ b/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)