mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-05-14 04:33:52 +03:00
minor code cleanup
This commit is contained in:
parent
5aaf7f1aa6
commit
8b510c55fb
|
@ -509,17 +509,22 @@ class Metasploit:
|
||||||
|
|
||||||
if not initialized:
|
if not initialized:
|
||||||
match = re.search("session ([\d]+) opened", out)
|
match = re.search("session ([\d]+) opened", out)
|
||||||
|
|
||||||
if match:
|
if match:
|
||||||
initialized = True
|
|
||||||
self._loadMetExtensions(proc, match.group(1))
|
self._loadMetExtensions(proc, match.group(1))
|
||||||
|
|
||||||
if "shell" in self.payloadStr:
|
if "shell" in self.payloadStr:
|
||||||
send_all(proc, "whoami\n" if Backend.isOs(OS.WINDOWS) else "uname -a ; id\n")
|
send_all(proc, "whoami\n" if Backend.isOs(OS.WINDOWS) else "uname -a ; id\n")
|
||||||
if conf.liveTest:
|
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
||||||
|
if conf.liveTest:
|
||||||
send_all(proc, "exit\n")
|
send_all(proc, "exit\n")
|
||||||
|
|
||||||
|
initialized = True
|
||||||
|
|
||||||
elif time.time() - start_time > METASPLOIT_SESSION_TIMEOUT:
|
elif time.time() - start_time > METASPLOIT_SESSION_TIMEOUT:
|
||||||
proc.kill()
|
proc.kill()
|
||||||
errMsg = "Timeout occurred while attempting "
|
errMsg = "timeout occurred while attempting "
|
||||||
errMsg += "to open a remote session"
|
errMsg += "to open a remote session"
|
||||||
raise SqlmapGenericException(errMsg)
|
raise SqlmapGenericException(errMsg)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user