mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-07-04 11:53:07 +03:00
minor fix
This commit is contained in:
parent
34738129c9
commit
b3b4459c72
|
@ -167,6 +167,24 @@ def __setRequestParams():
|
||||||
errMsg += "within the GET, POST and Cookie parameters"
|
errMsg += "within the GET, POST and Cookie parameters"
|
||||||
raise sqlmapGenericException, errMsg
|
raise sqlmapGenericException, errMsg
|
||||||
|
|
||||||
|
def __setHashDB():
|
||||||
|
"""
|
||||||
|
Check and set the HashDB SQLite file for query resume functionality.
|
||||||
|
"""
|
||||||
|
if not conf.hashDBFile:
|
||||||
|
conf.hashDBFile = "%s%shashdb" % (conf.outputPath, os.sep)
|
||||||
|
|
||||||
|
if os.path.exists(conf.hashDBFile):
|
||||||
|
if conf.flushSession:
|
||||||
|
try:
|
||||||
|
os.remove(conf.hashDBFile)
|
||||||
|
logger.info("flushing query storage file")
|
||||||
|
except OSError, msg:
|
||||||
|
errMsg = "unable to flush the hashdb file (%s)" % msg
|
||||||
|
raise sqlmapFilePathException, errMsg
|
||||||
|
|
||||||
|
conf.hashDB = HashDB(conf.hashDBFile)
|
||||||
|
|
||||||
def __setOutputResume():
|
def __setOutputResume():
|
||||||
"""
|
"""
|
||||||
Check and set the output text file and the resume functionality.
|
Check and set the output text file and the resume functionality.
|
||||||
|
@ -175,9 +193,6 @@ def __setOutputResume():
|
||||||
if not conf.sessionFile:
|
if not conf.sessionFile:
|
||||||
conf.sessionFile = "%s%ssession" % (conf.outputPath, os.sep)
|
conf.sessionFile = "%s%ssession" % (conf.outputPath, os.sep)
|
||||||
|
|
||||||
if not conf.hashDBFile:
|
|
||||||
conf.hashDBFile = "%s%shashdb" % (conf.outputPath, os.sep)
|
|
||||||
|
|
||||||
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):
|
||||||
|
@ -227,7 +242,6 @@ def __setOutputResume():
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
os.remove(conf.sessionFile)
|
os.remove(conf.sessionFile)
|
||||||
os.remove(conf.hashDBFile)
|
|
||||||
logger.info("flushing session file")
|
logger.info("flushing session file")
|
||||||
except OSError, msg:
|
except OSError, msg:
|
||||||
errMsg = "unable to flush the session file (%s)" % msg
|
errMsg = "unable to flush the session file (%s)" % msg
|
||||||
|
@ -235,7 +249,6 @@ def __setOutputResume():
|
||||||
|
|
||||||
try:
|
try:
|
||||||
conf.sessionFP = codecs.open(conf.sessionFile, "a", UNICODE_ENCODING)
|
conf.sessionFP = codecs.open(conf.sessionFile, "a", UNICODE_ENCODING)
|
||||||
conf.hashDB = HashDB(conf.hashDBFile)
|
|
||||||
dataToSessionFile("\n[%s]\n" % time.strftime("%X %x"))
|
dataToSessionFile("\n[%s]\n" % time.strftime("%X %x"))
|
||||||
except IOError:
|
except IOError:
|
||||||
errMsg = "unable to write on the session file specified"
|
errMsg = "unable to write on the session file specified"
|
||||||
|
@ -363,4 +376,5 @@ def setupTargetEnv():
|
||||||
__createTargetDirs()
|
__createTargetDirs()
|
||||||
__setRequestParams()
|
__setRequestParams()
|
||||||
__setOutputResume()
|
__setOutputResume()
|
||||||
|
__setHashDB()
|
||||||
__setResultsFile()
|
__setResultsFile()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user