Added --results-file to control results ouput file

Added the ability to explicitly set the results file output name
to ease integration with some external tooling.
This commit is contained in:
ctshanghai 2015-08-03 21:55:07 +08:00
parent 62e02cb730
commit c924582df3
2 changed files with 6 additions and 1 deletions

View File

@ -508,7 +508,9 @@ def _setResultsFile():
return
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:
conf.resultsFP = openFile(conf.resultsFilename, "w+", UNICODE_ENCODING, buffering=0)
except (OSError, IOError), ex:

View File

@ -613,6 +613,9 @@ def cmdLineParser():
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",
action="store_true",
help="Never ask for user input, use the default behaviour")