@@ -177,15 +177,6 @@ def _showInjections():
177
177
else :
178
178
header = "sqlmap resumed the following injection point(s) from stored session"
179
179
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
-
189
180
if conf .api :
190
181
conf .dumper .string ("" , {"url" : conf .url , "query" : conf .parameters .get (PLACE .GET ), "data" : conf .parameters .get (PLACE .POST )}, content_type = CONTENT_TYPE .TARGET )
191
182
conf .dumper .string ("" , kb .injections , content_type = CONTENT_TYPE .TECHNIQUES )
@@ -203,6 +194,16 @@ def _showInjections():
203
194
warnMsg += "included in shown payload content(s)"
204
195
logger .warning (warnMsg )
205
196
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
+
206
207
def _randomFillBlankFields (value ):
207
208
retVal = value
208
209
@@ -658,6 +659,7 @@ def start():
658
659
if place == PLACE .COOKIE :
659
660
kb .mergeCookies = popValue ()
660
661
662
+ _saveInjections ()
661
663
if len (kb .injections ) == 0 or (len (kb .injections ) == 1 and kb .injections [0 ].place is None ):
662
664
if kb .vainRun and not conf .multipleTargets :
663
665
errMsg = "no parameter(s) found for testing in the provided data "
0 commit comments