This commit is contained in:
CT 2015-08-03 15:21:40 +00:00
commit 37c6f56995
3 changed files with 17 additions and 7 deletions

View File

@ -508,7 +508,9 @@ def _setResultsFile():
return return
if not conf.resultsFP: if not conf.resultsFP:
conf.resultsFilename = os.path.join(paths.SQLMAP_OUTPUT_PATH, time.strftime(RESULTS_FILE_FORMAT).lower()) if not len(conf.resultsFilename):
conf.resultsFilename = os.path.join(paths.SQLMAP_OUTPUT_PATH, time.strftime(RESULTS_FILE_FORMAT).lower())
try: try:
conf.resultsFP = openFile(conf.resultsFilename, "w+", UNICODE_ENCODING, buffering=0) conf.resultsFP = openFile(conf.resultsFilename, "w+", UNICODE_ENCODING, buffering=0)
except (OSError, IOError), ex: except (OSError, IOError), ex:

View File

@ -610,6 +610,12 @@ def cmdLineParser():
help="Log all HTTP traffic into a " help="Log all HTTP traffic into a "
"textual file") "textual file")
general.add_option("--crawl-file", dest="crawlFile", action="store",
help="Destination file for crawled links")
general.add_option("--results-file", dest="resultsFilename", action="store",
help="Destination file for results in multi-target mode")
general.add_option("--batch", dest="batch", general.add_option("--batch", dest="batch",
action="store_true", action="store_true",
help="Never ask for user input, use the default behaviour") help="Never ask for user input, use the default behaviour")

View File

@ -186,12 +186,14 @@ def storeResultsToFile(results):
test = readInput(message, default="N") test = readInput(message, default="N")
kb.storeCrawlingChoice = test[0] in ("y", "Y") kb.storeCrawlingChoice = test[0] in ("y", "Y")
if kb.storeCrawlingChoice: if kb.storeCrawlingChoice or conf.crawlFile:
handle, filename = tempfile.mkstemp(prefix="sqlmapcrawling-", suffix=".csv" if conf.forms else ".txt") if conf.crawlFile:
os.close(handle) filename = conf.crawlFile
else:
infoMsg = "writing crawling results to a temporary file '%s' " % filename handle, filename = tempfile.mkstemp(prefix="sqlmapcrawling-", suffix=".csv" if conf.forms else ".txt")
logger.info(infoMsg) os.close(handle)
infoMsg = "writing crawling results to a temporary file '%s' " % filename
logger.info(infoMsg)
with openFile(filename, "w+b") as f: with openFile(filename, "w+b") as f:
if conf.forms: if conf.forms: