@@ -53,7 +53,7 @@ def setInjection(inj):
5353 or ( kb .resumedQueries [conf .url ].has_key ("Injection data" )
5454 and intersect (base64unpickle (kb .resumedQueries [conf .url ]["Injection data" ][:- 1 ]).data .keys (),\
5555 inj .data .keys ()) != inj .data .keys ()
56- ) )
56+ ) )
5757
5858 if condition :
5959 dataToSessionFile ("[%s][%s][%s][Injection data][%s]\n " % (conf .url , inj .place , safeFormatString (conf .parameters [inj .place ]), base64pickle (inj )))
@@ -168,18 +168,32 @@ def resumeConfKb(expression, url, value):
168168 if expression == "Injection data" and url == conf .url :
169169 injection = base64unpickle (value [:- 1 ])
170170
171- infoMsg = "resuming injection data from session file"
172- logger .info (infoMsg )
173-
174171 if injection .place in conf .paramDict and \
175172 injection .parameter in conf .paramDict [injection .place ]:
176173
177174 if not conf .tech or intersect (conf .tech , injection .data .keys ()):
175+ # Strip not required techniques (--technique switch)
178176 if intersect (conf .tech , injection .data .keys ()):
179177 injection .data = dict (filter (lambda (key , item ): key in conf .tech , injection .data .items ()))
180178
181- if injection not in kb .injections :
179+ infoMsg = "resuming injection data for technique%s " % ("s" if len (injection .data .keys ()) > 1 else "" )
180+ infoMsg += "%s " % " & " .join ([PAYLOAD .SQLINJECTION [k ] for k in injection .data .keys ()])
181+ infoMsg += "from session file"
182+ logger .info (infoMsg )
183+
184+ if len (kb .injections ) == 0 :
182185 kb .injections .append (injection )
186+ else :
187+ for resumedInj in kb .injections :
188+ for inj , data in injection .data .items ():
189+ if inj not in resumedInj .data :
190+ kb .injections [kb .injections .index (resumedInj )].data [inj ] = data
191+ else :
192+ warnMsg = "not resuming injection data for technique%s " % ("s" if len (injection .data .keys ()) > 1 else "" )
193+ warnMsg += "%s " % " & " .join ([PAYLOAD .SQLINJECTION [k ] for k in injection .data .keys ()])
194+ warnMsg += "from session file because you provided "
195+ warnMsg += "different technique(s) to be tested on this run"
196+ logger .warn (warnMsg )
183197 else :
184198 warnMsg = "there is an injection in %s parameter '%s' " % (injection .place , injection .parameter )
185199 warnMsg += "but you did not provided it this time"
0 commit comments