Skip to content

Commit 7f9b4a4

Browse files
committed
Land rapid7#2655, Re-do exe-small for scripting payloads.
2 parents 52ac85b + a327321 commit 7f9b4a4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/msf/util/exe.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,14 +1622,14 @@ def self.to_executable_fmt(framework, arch, plat, code, fmt, exeopts)
16221622

16231623
case fmt
16241624
when 'asp'
1625-
exe = to_executable_fmt(framework, arch, plat, code, 'exe', exeopts)
1625+
exe = to_executable_fmt(framework, arch, plat, code, 'exe-small', exeopts)
16261626
output = Msf::Util::EXE.to_exe_asp(exe, exeopts)
16271627

16281628
when 'aspx'
16291629
output = Msf::Util::EXE.to_mem_aspx(framework, code, exeopts)
16301630

16311631
when 'aspx-exe'
1632-
exe = to_executable_fmt(framework, arch, plat, code, 'exe', exeopts)
1632+
exe = to_executable_fmt(framework, arch, plat, code, 'exe-small', exeopts)
16331633
output = Msf::Util::EXE.to_exe_aspx(exe, exeopts)
16341634

16351635
when 'dll'
@@ -1638,6 +1638,7 @@ def self.to_executable_fmt(framework, arch, plat, code, fmt, exeopts)
16381638
when ARCH_X86_64 then to_win64pe_dll(framework, code, exeopts)
16391639
when ARCH_X64 then to_win64pe_dll(framework, code, exeopts)
16401640
end
1641+
16411642
when 'exe'
16421643
output = case arch
16431644
when ARCH_X86,nil then to_win32pe(framework, code, exeopts)
@@ -1655,6 +1656,7 @@ def self.to_executable_fmt(framework, arch, plat, code, fmt, exeopts)
16551656
when 'exe-small'
16561657
output = case arch
16571658
when ARCH_X86,nil then to_win32pe_old(framework, code, exeopts)
1659+
when ARCH_X86_64,ARCH_X64 then to_win64pe(framework, code, exeopts)
16581660
end
16591661

16601662
when 'exe-only'
@@ -1716,15 +1718,15 @@ def self.to_executable_fmt(framework, arch, plat, code, fmt, exeopts)
17161718
output = Msf::Util::EXE.to_vba(framework, code, exeopts)
17171719

17181720
when 'vba-exe'
1719-
exe = to_executable_fmt(framework, arch, plat, code, 'exe', exeopts)
1721+
exe = to_executable_fmt(framework, arch, plat, code, 'exe-small', exeopts)
17201722
output = Msf::Util::EXE.to_exe_vba(exe)
17211723

17221724
when 'vbs'
1723-
exe = to_executable_fmt(framework, arch, plat, code, 'exe', exeopts)
1725+
exe = to_executable_fmt(framework, arch, plat, code, 'exe-small', exeopts)
17241726
output = Msf::Util::EXE.to_exe_vbs(exe, exeopts.merge({ :persist => false }))
17251727

17261728
when 'loop-vbs'
1727-
exe = exe = to_executable_fmt(framework, arch, plat, code, 'exe', exeopts)
1729+
exe = exe = to_executable_fmt(framework, arch, plat, code, 'exe-small', exeopts)
17281730
output = Msf::Util::EXE.to_exe_vbs(exe, exeopts.merge({ :persist => true }))
17291731

17301732
when 'war'

0 commit comments

Comments
 (0)