From 138a846cf1c33a079075a014b6cb4e6fdb80bbfe Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Sat, 9 Feb 2013 10:50:06 +0000 Subject: [PATCH] possible fix for regression test stall --- lib/takeover/metasploit.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/takeover/metasploit.py b/lib/takeover/metasploit.py index 165914ddd..df6a46be2 100644 --- a/lib/takeover/metasploit.py +++ b/lib/takeover/metasploit.py @@ -517,9 +517,6 @@ class Metasploit: send_all(proc, "whoami\n" if Backend.isOs(OS.WINDOWS) else "uname -a ; id\n") time.sleep(2) - if conf.liveTest: - send_all(proc, "exit\n") - initialized = True elif time.time() - start_time > METASPLOIT_SESSION_TIMEOUT: @@ -528,6 +525,9 @@ class Metasploit: errMsg += "to open a remote session" raise SqlmapGenericException(errMsg) + elif conf.liveTest and time.time() - start_time > METASPLOIT_SESSION_TIMEOUT: + proc.kill() + except EOFError: returncode = proc.wait()