From cb15fcc8afaf6e5fbc74d4e185db6951f6fe01ac Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 2 Jan 2013 22:17:06 +0100 Subject: [PATCH] Fix for an Issue #329 --- lib/takeover/metasploit.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/takeover/metasploit.py b/lib/takeover/metasploit.py index 8bf89f854..5adc87585 100644 --- a/lib/takeover/metasploit.py +++ b/lib/takeover/metasploit.py @@ -513,13 +513,10 @@ class Metasploit: pollProcess(process) payloadStderr = process.communicate()[1] - if Backend.isOs(OS.WINDOWS) or extra == "BufferRegister=EAX": - payloadSize = re.search("size ([\d]+)", payloadStderr, re.I) - else: - payloadSize = re.search("Length\:\s([\d]+)", payloadStderr, re.I) + match = re.search("(Total size:|Length:|succeeded with size) ([\d]+)", payloadStderr) - if payloadSize: - payloadSize = int(payloadSize.group(1)) + if match: + payloadSize = int(match.group(2)) if extra == "BufferRegister=EAX": payloadSize = payloadSize / 2