mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-01-24 08:14:24 +03:00
added new option --flush-session
This commit is contained in:
parent
a839566bb2
commit
58d54b6515
|
@ -139,6 +139,7 @@ optDict = {
|
|||
|
||||
"Miscellaneous": {
|
||||
"sessionFile": "string",
|
||||
"flushSession": "boolean",
|
||||
"eta": "boolean",
|
||||
"googlePage": "integer",
|
||||
"updateAll": "boolean",
|
||||
|
|
|
@ -117,6 +117,7 @@ def __setOutputResume():
|
|||
logger.info("using '%s' as session file" % conf.sessionFile)
|
||||
|
||||
if os.path.exists(conf.sessionFile):
|
||||
if not conf.flushSession:
|
||||
readSessionFP = open(conf.sessionFile, "r")
|
||||
lines = readSessionFP.readlines()
|
||||
|
||||
|
@ -153,6 +154,13 @@ def __setOutputResume():
|
|||
kb.resumedQueries[url][expression] = value
|
||||
|
||||
readSessionFP.close()
|
||||
else:
|
||||
try:
|
||||
os.remove(conf.sessionFile)
|
||||
logger.info("flushing session file")
|
||||
except OSError, msg:
|
||||
errMsg = "unable to flush the session file (%s)" % msg
|
||||
raise sqlmapFilePathException, errMsg
|
||||
|
||||
try:
|
||||
conf.sessionFP = open(conf.sessionFile, "a")
|
||||
|
|
|
@ -397,6 +397,9 @@ def cmdLineParser():
|
|||
help="Save and resume all data retrieved "
|
||||
"on a session file")
|
||||
|
||||
miscellaneous.add_option("--flush-session", dest="flushSession", action="store_true",
|
||||
help="Flush session file for current target")
|
||||
|
||||
miscellaneous.add_option("--eta", dest="eta", action="store_true",
|
||||
help="Display for each output the "
|
||||
"estimated time of arrival")
|
||||
|
|
|
@ -103,7 +103,6 @@ class Enumeration:
|
|||
|
||||
infoMsg = "fetching banner"
|
||||
logger.info(infoMsg)
|
||||
|
||||
if not kb.data.banner:
|
||||
if conf.unionUse or conf.unionTest:
|
||||
dumper.string("valid union", unionTest())
|
||||
|
|
|
@ -398,6 +398,10 @@ regType =
|
|||
# Save and resume all data retrieved on a session file.
|
||||
sessionFile =
|
||||
|
||||
|
||||
# Flush session file for current target.
|
||||
flushSession = False
|
||||
|
||||
# Retrieve each query output length and calculate the estimated time of
|
||||
# arrival in real time.
|
||||
# Valid: True or False
|
||||
|
|
Loading…
Reference in New Issue
Block a user