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

Skip to content

Commit 6651ba0

Browse files
committed
another fix (OS was set to None at all previous sessions if there was no explicit OS testing done)
1 parent e28b9f2 commit 6651ba0

1 file changed

Lines changed: 17 additions & 16 deletions

File tree

lib/core/session.py

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -361,23 +361,24 @@ def resumeConfKb(expression, url, value):
361361
elif expression == "OS" and url == conf.url:
362362
os = unSafeFormatString(value[:-1])
363363

364-
logMsg = "resuming back-end DBMS operating system '%s' " % os
365-
logMsg += "from session file"
366-
logger.info(logMsg)
367-
368-
if conf.os and conf.os.lower() != os.lower():
369-
message = "you provided '%s' as back-end DBMS operating " % conf.os
370-
message += "system, but from a past scan information on the "
371-
message += "target URL sqlmap assumes the back-end DBMS "
372-
message += "operating system is %s. " % os
373-
message += "Do you really want to force the back-end DBMS "
374-
message += "OS value? [y/N] "
375-
test = readInput(message, default="N")
376-
377-
if not test or test[0] in ("n", "N"):
364+
if os and os != 'None':
365+
logMsg = "resuming back-end DBMS operating system '%s' " % os
366+
logMsg += "from session file"
367+
logger.info(logMsg)
368+
369+
if conf.os and conf.os.lower() != os.lower():
370+
message = "you provided '%s' as back-end DBMS operating " % conf.os
371+
message += "system, but from a past scan information on the "
372+
message += "target URL sqlmap assumes the back-end DBMS "
373+
message += "operating system is %s. " % os
374+
message += "Do you really want to force the back-end DBMS "
375+
message += "OS value? [y/N] "
376+
test = readInput(message, default="N")
377+
378+
if not test or test[0] in ("n", "N"):
379+
conf.os = os
380+
else:
378381
conf.os = os
379-
else:
380-
conf.os = os
381382

382383
elif expression == "TABLE_EXISTS" and url == conf.url:
383384
table = unSafeFormatString(value[:-1])

0 commit comments

Comments
 (0)