Skip to content

Commit a327321

Browse files
committed
Re-do 'exe-small' for scripting payloads.
Fall back to default x64 exe for ARCH_X86_64
1 parent 13ad48f commit a327321

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
@@ -1604,14 +1604,14 @@ def self.to_executable_fmt(framework, arch, plat, code, fmt, exeopts)
16041604

16051605
case fmt
16061606
when 'asp'
1607-
exe = to_executable_fmt(framework, arch, plat, code, 'exe', exeopts)
1607+
exe = to_executable_fmt(framework, arch, plat, code, 'exe-small', exeopts)
16081608
output = Msf::Util::EXE.to_exe_asp(exe, exeopts)
16091609

16101610
when 'aspx'
16111611
output = Msf::Util::EXE.to_mem_aspx(framework, code, exeopts)
16121612

16131613
when 'aspx-exe'
1614-
exe = to_executable_fmt(framework, arch, plat, code, 'exe', exeopts)
1614+
exe = to_executable_fmt(framework, arch, plat, code, 'exe-small', exeopts)
16151615
output = Msf::Util::EXE.to_exe_aspx(exe, exeopts)
16161616

16171617
when 'dll'
@@ -1620,6 +1620,7 @@ def self.to_executable_fmt(framework, arch, plat, code, fmt, exeopts)
16201620
when ARCH_X86_64 then to_win64pe_dll(framework, code, exeopts)
16211621
when ARCH_X64 then to_win64pe_dll(framework, code, exeopts)
16221622
end
1623+
16231624
when 'exe'
16241625
output = case arch
16251626
when ARCH_X86,nil then to_win32pe(framework, code, exeopts)
@@ -1637,6 +1638,7 @@ def self.to_executable_fmt(framework, arch, plat, code, fmt, exeopts)
16371638
when 'exe-small'
16381639
output = case arch
16391640
when ARCH_X86,nil then to_win32pe_old(framework, code, exeopts)
1641+
when ARCH_X86_64,ARCH_X64 then to_win64pe(framework, code, exeopts)
16401642
end
16411643

16421644
when 'exe-only'
@@ -1698,15 +1700,15 @@ def self.to_executable_fmt(framework, arch, plat, code, fmt, exeopts)
16981700
output = Msf::Util::EXE.to_vba(framework, code, exeopts)
16991701

17001702
when 'vba-exe'
1701-
exe = to_executable_fmt(framework, arch, plat, code, 'exe', exeopts)
1703+
exe = to_executable_fmt(framework, arch, plat, code, 'exe-small', exeopts)
17021704
output = Msf::Util::EXE.to_exe_vba(exe)
17031705

17041706
when 'vbs'
1705-
exe = to_executable_fmt(framework, arch, plat, code, 'exe', exeopts)
1707+
exe = to_executable_fmt(framework, arch, plat, code, 'exe-small', exeopts)
17061708
output = Msf::Util::EXE.to_exe_vbs(exe, exeopts.merge({ :persist => false }))
17071709

17081710
when 'loop-vbs'
1709-
exe = exe = to_executable_fmt(framework, arch, plat, code, 'exe', exeopts)
1711+
exe = exe = to_executable_fmt(framework, arch, plat, code, 'exe-small', exeopts)
17101712
output = Msf::Util::EXE.to_exe_vbs(exe, exeopts.merge({ :persist => true }))
17111713

17121714
when 'war'

0 commit comments

Comments
 (0)