Skip to content

Commit 355c311

Browse files
dmaloney-r7dmaloney-r7
authored andcommitted
Merge pull request rapid7#2277 from Meatballs1/service_exes
Looks good. Surprised we didn't have this before. I also agree with the sentiment about refactor. I think we should get all these changes in and deconflicted, then we can look towards cleanup/refactor. or we'll end up down a rabbit-hole.
2 parents 7b5e98d + 9786f84 commit 355c311

File tree

2 files changed

+11
-1
lines changed
  • lib/msf/util
  • spec/support/shared/contexts/msf/util

2 files changed

+11
-1
lines changed

lib/msf/util/exe.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2011,6 +2011,13 @@ def self.to_executable_fmt(framework, arch, plat, code, fmt, exeopts)
20112011
when ARCH_X64 then to_win64pe(framework, code, exeopts)
20122012
end
20132013

2014+
when 'exe-service'
2015+
output = case arch
2016+
when ARCH_X86,nil then to_win32pe_service(framework, code, exeopts)
2017+
when ARCH_X86_64 then to_win64pe_service(framework, code, exeopts)
2018+
when ARCH_X64 then to_win64pe_service(framework, code, exeopts)
2019+
end
2020+
20142021
when 'exe-small'
20152022
output = case arch
20162023
when ARCH_X86,nil then to_win32pe_old(framework, code, exeopts)
@@ -2085,7 +2092,7 @@ def self.to_executable_fmt(framework, arch, plat, code, fmt, exeopts)
20852092

20862093
def self.to_executable_fmt_formats
20872094
[
2088-
'dll','exe','exe-small','exe-only','elf','macho','vba','vba-exe',
2095+
'dll','exe','exe-service','exe-small','exe-only','elf','macho','vba','vba-exe',
20892096
'vbs','loop-vbs','asp','aspx','war','psh','psh-net'
20902097
]
20912098
end

spec/support/shared/contexts/msf/util/exe.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
{ :format => "exe-only", :arch => "x86", :file_fp => /PE32 / },
1616
{ :format => "exe-only", :arch => "x64", :file_fp => /PE32\+ / },
1717
{ :format => "exe-only", :arch => "x86_64", :file_fp => /PE32\+ / },
18+
{ :format => "exe-service", :arch => "x86", :file_fp => /PE32 / },
19+
{ :format => "exe-service", :arch => "x64", :file_fp => /PE32\+ / },
20+
{ :format => "exe-service", :arch => "x86_64", :file_fp => /PE32\+ / },
1821
],
1922
"linux" => [
2023
{ :format => "elf", :arch => "x86", :file_fp => /ELF 32.*SYSV/ },

0 commit comments

Comments
 (0)