Skip to content

Commit 3fae6c5

Browse files
committed
Initial exe-service
1 parent 12871c2 commit 3fae6c5

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

lib/msf/util/exe.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1990,6 +1990,15 @@ def self.to_executable_fmt(framework, arch, plat, code, fmt, exeopts)
19901990
output = Msf::Util::EXE.to_win64pe(framework, code, exeopts)
19911991
end
19921992

1993+
when 'exe-service'
1994+
if (not arch or (arch.index(ARCH_X86)))
1995+
output = Msf::Util::EXE.to_win32pe_service(framework, code, exeopts)
1996+
end
1997+
1998+
if(arch and (arch.index( ARCH_X86_64 ) or arch.index( ARCH_X64 )))
1999+
output = Msf::Util::EXE.to_win64pe_service(framework, code, exeopts)
2000+
end
2001+
19932002
when 'exe-small'
19942003
if(not arch or (arch.index(ARCH_X86)))
19952004
output = Msf::Util::EXE.to_win32pe_old(framework, code, exeopts)
@@ -2068,7 +2077,7 @@ def self.to_executable_fmt(framework, arch, plat, code, fmt, exeopts)
20682077
end
20692078

20702079
def self.to_executable_fmt_formats
2071-
['dll','exe','exe-small','exe-only','elf','macho','vba','vba-exe','vbs','loop-vbs','asp','aspx','war','psh','psh-net']
2080+
['dll','exe','exe-service','exe-small','exe-only','elf','macho','vba','vba-exe','vbs','loop-vbs','asp','aspx','war','psh','psh-net']
20722081
end
20732082

20742083
#

spec/lib/msf/util/exe_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
{ :format => "dll", :arch => "x64", :file_fp => /PE32\+.*DLL/ },
2828
{ :format => "exe", :arch => "x86", :file_fp => /PE32 / },
2929
{ :format => "exe", :arch => "x64", :file_fp => /PE32\+/ },
30+
{ :format => "exe-service", :arch => "x86", :file_fp => /PE32 / },
31+
{ :format => "exe-service", :arch => "x64", :file_fp => /PE32\+/ },
3032
{ :format => "exe-small", :arch => "x86", :file_fp => /PE32 / },
3133
# No template for 64-bit exe-small. That's fine, we probably
3234
# don't need one.

0 commit comments

Comments
 (0)