added new option --flush-session

This commit is contained in:
Miroslav Stampar 2010-03-04 13:01:18 +00:00
parent a839566bb2
commit 58d54b6515
5 changed files with 52 additions and 37 deletions

View File

@ -139,6 +139,7 @@ optDict = {
"Miscellaneous": {
"sessionFile": "string",
"flushSession": "boolean",
"eta": "boolean",
"googlePage": "integer",
"updateAll": "boolean",

View File

@ -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")

View File

@ -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")

View File

@ -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())

View File

@ -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