Add support for custom executables in EXE mixin instead of generated executables. Fixes #4982.
git-svn-id: file:///home/svn/framework3/trunk@13300 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
parent
d60524a3d4
commit
8079bfa9b2
|
@ -16,6 +16,7 @@ module Exploit::EXE
|
|||
|
||||
register_advanced_options(
|
||||
[
|
||||
OptString.new( 'EXE::Custom', [ false, 'Use custom exe instead of automatically generating a payload exe']),
|
||||
OptString.new( 'EXE::Path', [ false, 'The directory in which to look for the executable template' ]),
|
||||
OptString.new( 'EXE::Template', [ false, 'The executable template file name.' ]),
|
||||
OptBool.new( 'EXE::Inject', [ false, 'Set to preserve the original EXE function' ]),
|
||||
|
@ -24,7 +25,17 @@ module Exploit::EXE
|
|||
], self.class)
|
||||
end
|
||||
|
||||
def get_custom_exe
|
||||
puts 'here'
|
||||
file = ::File.open(datastore['EXE::Custom'],'rb')
|
||||
exe = file.read
|
||||
file.close
|
||||
exe
|
||||
end
|
||||
|
||||
def generate_payload_exe(opts = {})
|
||||
return get_custom_exe if datastore.include? 'EXE::Custom'
|
||||
|
||||
exe_init_options(opts)
|
||||
|
||||
pl = opts[:code]
|
||||
|
@ -50,6 +61,8 @@ module Exploit::EXE
|
|||
end
|
||||
|
||||
def generate_payload_exe_service(opts = {})
|
||||
return get_custom_exe if datastore.include? 'EXE::Custom'
|
||||
|
||||
exe_init_options(opts)
|
||||
|
||||
# NOTE: Only Windows is supported here.
|
||||
|
@ -67,6 +80,8 @@ module Exploit::EXE
|
|||
end
|
||||
|
||||
def generate_payload_dll(opts = {})
|
||||
return get_custom_exe if datastore.include? 'EXE::Custom'
|
||||
|
||||
exe_init_options(opts)
|
||||
|
||||
# NOTE: Only Windows is supported here.
|
||||
|
|
Loading…
Reference in New Issue