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