Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8b510c5

Browse files
committed
minor code cleanup
1 parent 5aaf7f1 commit 8b510c5

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

lib/takeover/metasploit.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -509,17 +509,22 @@ def _controlMsfCmd(self, proc, func):
509509

510510
if not initialized:
511511
match = re.search("session ([\d]+) opened", out)
512+
512513
if match:
513-
initialized = True
514514
self._loadMetExtensions(proc, match.group(1))
515+
515516
if "shell" in self.payloadStr:
516517
send_all(proc, "whoami\n" if Backend.isOs(OS.WINDOWS) else "uname -a ; id\n")
517-
if conf.liveTest:
518518
time.sleep(2)
519+
520+
if conf.liveTest:
519521
send_all(proc, "exit\n")
522+
523+
initialized = True
524+
520525
elif time.time() - start_time > METASPLOIT_SESSION_TIMEOUT:
521526
proc.kill()
522-
errMsg = "Timeout occurred while attempting "
527+
errMsg = "timeout occurred while attempting "
523528
errMsg += "to open a remote session"
524529
raise SqlmapGenericException(errMsg)
525530

0 commit comments

Comments
 (0)