File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -104,18 +104,24 @@ def generate_payload_dll(opts = {})
104
104
return get_eicar_exe if datastore [ 'EXE::EICAR' ]
105
105
106
106
exe_init_options ( opts )
107
-
108
- # NOTE: Only Windows is supported here.
107
+ plat = opts [ :platform ]
109
108
pl = opts [ :code ]
110
109
pl ||= payload . encoded
111
110
112
111
#Ensure opts[:arch] is an array
113
112
opts [ :arch ] = [ opts [ :arch ] ] unless opts [ :arch ] . kind_of? Array
114
113
115
- if opts [ :arch ] and ( opts [ :arch ] . index ( ARCH_X64 ) or opts [ :arch ] . index ( ARCH_X86_64 ) )
116
- dll = Msf ::Util ::EXE . to_win64pe_dll ( framework , pl , opts )
117
- else
118
- dll = Msf ::Util ::EXE . to_win32pe_dll ( framework , pl , opts )
114
+ # NOTE: Only x86_64 linux is supported here.
115
+ if ( plat . index ( Msf ::Module ::Platform ::Linux ) )
116
+ if opts [ :arch ] and ( opts [ :arch ] . index ( ARCH_X64 ) or opts [ :arch ] . index ( ARCH_X86_64 ) )
117
+ dll = Msf ::Util ::EXE . to_linux_x64_elf_dll ( framework , pl , opts )
118
+ end
119
+ elsif ( plat . index ( Msf ::Module ::Platform ::Windows ) )
120
+ if opts [ :arch ] and ( opts [ :arch ] . index ( ARCH_X64 ) or opts [ :arch ] . index ( ARCH_X86_64 ) )
121
+ dll = Msf ::Util ::EXE . to_win64pe_dll ( framework , pl , opts )
122
+ else
123
+ dll = Msf ::Util ::EXE . to_win32pe_dll ( framework , pl , opts )
124
+ end
119
125
end
120
126
121
127
exe_post_generation ( opts )
You can’t perform that action at this time.
0 commit comments