mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-08-02 03:10:12 +03:00
Added --crawl-file option
Added --crawl-file option to specify the output file for crawler results.
This commit is contained in:
parent
e623ee66ad
commit
dc3df1b832
|
@ -610,6 +610,9 @@ def cmdLineParser():
|
|||
help="Log all HTTP traffic into a "
|
||||
"textual file")
|
||||
|
||||
general.add_option("--crawl-file", dest="batchCrawlFile", action="store",
|
||||
help="Destination file for crawled links")
|
||||
|
||||
general.add_option("--batch", dest="batch",
|
||||
action="store_true",
|
||||
help="Never ask for user input, use the default behaviour")
|
||||
|
|
|
@ -186,12 +186,14 @@ def storeResultsToFile(results):
|
|||
test = readInput(message, default="N")
|
||||
kb.storeCrawlingChoice = test[0] in ("y", "Y")
|
||||
|
||||
if kb.storeCrawlingChoice:
|
||||
handle, filename = tempfile.mkstemp(prefix="sqlmapcrawling-", suffix=".csv" if conf.forms else ".txt")
|
||||
os.close(handle)
|
||||
|
||||
infoMsg = "writing crawling results to a temporary file '%s' " % filename
|
||||
logger.info(infoMsg)
|
||||
if kb.storeCrawlingChoice or conf.batchCrawlFile:
|
||||
if conf.batchCrawlFile:
|
||||
filename = conf.batchCrawlFile
|
||||
else:
|
||||
handle, filename = tempfile.mkstemp(prefix="sqlmapcrawling-", suffix=".csv" if conf.forms else ".txt")
|
||||
os.close(handle)
|
||||
infoMsg = "writing crawling results to a temporary file '%s' " % filename
|
||||
logger.info(infoMsg)
|
||||
|
||||
with openFile(filename, "w+b") as f:
|
||||
if conf.forms:
|
||||
|
|
Loading…
Reference in New Issue
Block a user