Skip to content

Commit 4cd329a

Browse files
committed
Spawn the payload as a seperate process
Running the payload using system() in a thread was causing some weird interactions with ctrl-c. Fix those issues by using Process.spawn and Process.detach. I suspect this was the original cause of rapid7#3631, java meterpreter sessions dying unaccountably. See rapid7#3631
1 parent dd0b07b commit 4cd329a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/modules/exploits/test/java_tester.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def exploit
5050
fd.write(@jar_data)
5151
end
5252

53-
framework.threads.spawn("Module(#{self.refname})-JavaLauncher", false) { system("java -jar payload.jar") }
53+
pid = Process.spawn("java -jar payload.jar &")
54+
Process.detach pid
5455
end
5556

5657
end

0 commit comments

Comments
 (0)