From f970b4f24071f48aa5c4d3ef54a8f8597ece59bb Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Sat, 9 Feb 2013 12:19:21 +0000 Subject: [PATCH] minor adjustment fixing the regression test stall --- lib/takeover/metasploit.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/takeover/metasploit.py b/lib/takeover/metasploit.py index 20b54919f..10bef42ab 100644 --- a/lib/takeover/metasploit.py +++ b/lib/takeover/metasploit.py @@ -525,8 +525,12 @@ class Metasploit: errMsg += "to open a remote session" raise SqlmapGenericException(errMsg) - elif conf.liveTest and time.time() - start_time > METASPLOIT_SESSION_TIMEOUT: - proc.kill() + if conf.liveTest and time.time() - start_time > METASPLOIT_SESSION_TIMEOUT: + if initialized: + send_all(proc, "exit\n") + time.sleep(2) + else: + proc.kill() except (EOFError, IOError): return proc.returncode