Skip to content

Commit 9c86cc4

Browse files
Always save injections
1 parent f040e16 commit 9c86cc4

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

Diff for: lib/controller/controller.py

+11-9
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,6 @@ def _showInjections():
177177
else:
178178
header = "sqlmap resumed the following injection point(s) from stored session"
179179

180-
if conf.jsonFile:
181-
data = {
182-
"url": conf.url,
183-
"query": conf.parameters.get(PLACE.GET),
184-
"data": conf.parameters.get(PLACE.POST),
185-
"injections": kb.injections,
186-
}
187-
conf.dumper.json(conf.jsonFile, data)
188-
189180
if conf.api:
190181
conf.dumper.string("", {"url": conf.url, "query": conf.parameters.get(PLACE.GET), "data": conf.parameters.get(PLACE.POST)}, content_type=CONTENT_TYPE.TARGET)
191182
conf.dumper.string("", kb.injections, content_type=CONTENT_TYPE.TECHNIQUES)
@@ -203,6 +194,16 @@ def _showInjections():
203194
warnMsg += "included in shown payload content(s)"
204195
logger.warning(warnMsg)
205196

197+
def _saveInjections():
198+
if conf.jsonFile:
199+
data = {
200+
"url": conf.url,
201+
"query": conf.parameters.get(PLACE.GET),
202+
"data": conf.parameters.get(PLACE.POST),
203+
"injections": kb.injections,
204+
}
205+
conf.dumper.json(conf.jsonFile, data)
206+
206207
def _randomFillBlankFields(value):
207208
retVal = value
208209

@@ -658,6 +659,7 @@ def start():
658659
if place == PLACE.COOKIE:
659660
kb.mergeCookies = popValue()
660661

662+
_saveInjections()
661663
if len(kb.injections) == 0 or (len(kb.injections) == 1 and kb.injections[0].place is None):
662664
if kb.vainRun and not conf.multipleTargets:
663665
errMsg = "no parameter(s) found for testing in the provided data "

Diff for: lib/core/common.py

-3
Original file line numberDiff line numberDiff line change
@@ -1072,9 +1072,6 @@ def dataToDumpFile(dumpFile, data):
10721072
logger.error(errMsg)
10731073

10741074
def dataToJsonFile(jsonFile, data):
1075-
print("***************")
1076-
print(jsonFile, data)
1077-
print("***************")
10781075
with open(jsonFile, 'w') as f:
10791076
f.write(json.dumps(data))
10801077

0 commit comments

Comments
 (0)