mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-18 12:30:36 +03:00
Always save injections
This commit is contained in:
parent
6152c08cc9
commit
1da1e604bd
|
@ -177,15 +177,6 @@ def _showInjections():
|
||||||
else:
|
else:
|
||||||
header = "sqlmap resumed the following injection point(s) from stored session"
|
header = "sqlmap resumed the following injection point(s) from stored session"
|
||||||
|
|
||||||
if conf.jsonFile:
|
|
||||||
data = {
|
|
||||||
"url": conf.url,
|
|
||||||
"query": conf.parameters.get(PLACE.GET),
|
|
||||||
"data": conf.parameters.get(PLACE.POST),
|
|
||||||
"injections": kb.injections,
|
|
||||||
}
|
|
||||||
conf.dumper.json(conf.jsonFile, data)
|
|
||||||
|
|
||||||
if conf.api:
|
if conf.api:
|
||||||
conf.dumper.string("", {"url": conf.url, "query": conf.parameters.get(PLACE.GET), "data": conf.parameters.get(PLACE.POST)}, content_type=CONTENT_TYPE.TARGET)
|
conf.dumper.string("", {"url": conf.url, "query": conf.parameters.get(PLACE.GET), "data": conf.parameters.get(PLACE.POST)}, content_type=CONTENT_TYPE.TARGET)
|
||||||
conf.dumper.string("", kb.injections, content_type=CONTENT_TYPE.TECHNIQUES)
|
conf.dumper.string("", kb.injections, content_type=CONTENT_TYPE.TECHNIQUES)
|
||||||
|
@ -203,6 +194,16 @@ def _showInjections():
|
||||||
warnMsg += "included in shown payload content(s)"
|
warnMsg += "included in shown payload content(s)"
|
||||||
logger.warning(warnMsg)
|
logger.warning(warnMsg)
|
||||||
|
|
||||||
|
def _saveInjections():
|
||||||
|
if conf.jsonFile:
|
||||||
|
data = {
|
||||||
|
"url": conf.url,
|
||||||
|
"query": conf.parameters.get(PLACE.GET),
|
||||||
|
"data": conf.parameters.get(PLACE.POST),
|
||||||
|
"injections": kb.injections,
|
||||||
|
}
|
||||||
|
conf.dumper.json(conf.jsonFile, data)
|
||||||
|
|
||||||
def _randomFillBlankFields(value):
|
def _randomFillBlankFields(value):
|
||||||
retVal = value
|
retVal = value
|
||||||
|
|
||||||
|
@ -658,6 +659,7 @@ def start():
|
||||||
if place == PLACE.COOKIE:
|
if place == PLACE.COOKIE:
|
||||||
kb.mergeCookies = popValue()
|
kb.mergeCookies = popValue()
|
||||||
|
|
||||||
|
_saveInjections()
|
||||||
if len(kb.injections) == 0 or (len(kb.injections) == 1 and kb.injections[0].place is None):
|
if len(kb.injections) == 0 or (len(kb.injections) == 1 and kb.injections[0].place is None):
|
||||||
if kb.vainRun and not conf.multipleTargets:
|
if kb.vainRun and not conf.multipleTargets:
|
||||||
errMsg = "no parameter(s) found for testing in the provided data "
|
errMsg = "no parameter(s) found for testing in the provided data "
|
||||||
|
|
|
@ -1072,9 +1072,6 @@ def dataToDumpFile(dumpFile, data):
|
||||||
logger.error(errMsg)
|
logger.error(errMsg)
|
||||||
|
|
||||||
def dataToJsonFile(jsonFile, data):
|
def dataToJsonFile(jsonFile, data):
|
||||||
print("***************")
|
|
||||||
print(jsonFile, data)
|
|
||||||
print("***************")
|
|
||||||
with open(jsonFile, 'w') as f:
|
with open(jsonFile, 'w') as f:
|
||||||
f.write(json.dumps(data))
|
f.write(json.dumps(data))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user