Skip to content

Commit 64fe2dd

Browse files
committed
Land rapid7#4143, @kernelsmith's get_custom_exe fix
* Initializes the exe variable * Fixes rapid7#4131
2 parents 6e51d84 + b199820 commit 64fe2dd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/msf/core/exploit/exe.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,11 @@ def get_eicar_exe
3838
obfus_eicar.join("-").upcase
3939
end
4040

41-
def get_custom_exe(path=nil)
41+
def get_custom_exe(path = nil)
4242
path ||= datastore['EXE::Custom']
4343
print_status("Using custom payload #{path}, RHOST and RPORT settings will be ignored!")
4444
datastore['DisablePayloadHandler'] = true
45+
exe = nil
4546
::File.open(path,'rb') {|f| exe = f.read(f.stat.size)}
4647
exe
4748
end
@@ -160,7 +161,7 @@ def exe_init_options(opts)
160161
end
161162

162163
def exe_post_generation(opts)
163-
if (opts[:fellback])
164+
if opts[:fellback]
164165
print_status("Warning: Falling back to default template: #{opts[:fellback]}")
165166
end
166167
end

0 commit comments

Comments
 (0)