Skip to content

Commit 0e772cc

Browse files
committed
Land rapid7#4161, "stop" NilClass fix
2 parents bc55293 + 8f3b1e7 commit 0e772cc

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

lib/rex/exploitation/cmdstager/tftp.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ def initialize(exe)
3131
end
3232

3333
def setup(mod)
34-
tftp = Rex::Proto::TFTP::Server.new
35-
tftp.register_file(Rex::Text.rand_text_alphanumeric(8), exe)
36-
tftp.start
37-
mod.add_socket(tftp) # Hating myself for doing it... but it's just a first demo
34+
self.tftp = Rex::Proto::TFTP::Server.new
35+
self.tftp.register_file(Rex::Text.rand_text_alphanumeric(8), exe)
36+
self.tftp.start
37+
mod.add_socket(self.tftp) # Hating myself for doing it... but it's just a first demo
3838
end
3939

4040
def teardown(mod = nil)
41-
tftp.stop
41+
self.tftp.stop
4242
end
4343

4444
#

modules/exploits/multi/http/struts_code_exec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class Metasploit3 < Msf::Exploit::Remote
1010

1111
include Msf::Exploit::CmdStager
1212
include Msf::Exploit::Remote::HttpClient
13+
include Msf::Exploit::EXE
1314

1415
def initialize(info = {})
1516
super(update_info(info,
@@ -91,7 +92,7 @@ def execute_command(cmd, opts = {})
9192
def windows_stager
9293
print_status("Sending request to #{datastore['RHOST']}:#{datastore['RPORT']}")
9394
execute_cmdstager({ :temp => '.' })
94-
@payload_exe = payload_exe
95+
@payload_exe = generate_payload_exe
9596

9697
print_status("Attempting to execute the payload...")
9798
execute_command(@payload_exe)

0 commit comments

Comments
 (0)