minor code cleanup

This commit is contained in:
Bernardo Damele 2013-02-08 16:29:16 +00:00
parent 5aaf7f1aa6
commit 8b510c55fb

View File

@ -509,17 +509,22 @@ class Metasploit:
if not initialized:
match = re.search("session ([\d]+) opened", out)
if match:
initialized = True
self._loadMetExtensions(proc, match.group(1))
if "shell" in self.payloadStr:
send_all(proc, "whoami\n" if Backend.isOs(OS.WINDOWS) else "uname -a ; id\n")
if conf.liveTest:
time.sleep(2)
if conf.liveTest:
send_all(proc, "exit\n")
initialized = True
elif time.time() - start_time > METASPLOIT_SESSION_TIMEOUT:
proc.kill()
errMsg = "Timeout occurred while attempting "
errMsg = "timeout occurred while attempting "
errMsg += "to open a remote session"
raise SqlmapGenericException(errMsg)