@@ -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+
206207def _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 "
0 commit comments