Skip to content

Commit 49ed02a

Browse files
author
Brent Cook
committed
fix packet parsing when there is partial data
1 parent 301e38b commit 49ed02a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/rex/post/meterpreter/packet_parser.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ def recv(sock)
6262
# header size doesn't include the xor key, which is always tacked on the front
6363
self.payload_length_left = length_bytes.unpack("N")[0] - (HEADER_SIZE - 4)
6464
end
65-
elsif (self.payload_length_left > 0)
65+
end
66+
if (self.payload_length_left > 0)
6667
buf = sock.read(self.payload_length_left)
6768

6869
if (buf)

0 commit comments

Comments
 (0)