4848from lib .core .exception import sqlmapNoneDataException
4949from lib .core .exception import sqlmapUserQuitException
5050from lib .core .session import setDynamicMarkings
51- from lib .core .session import setString
52- from lib .core .session import setRegexp
53- from lib .core .session import setTextOnly
5451from lib .core .settings import CONSTANT_RATIO
5552from lib .core .settings import UPPER_RATIO_BOUND
5653from lib .core .unescaper import unescaper
@@ -424,9 +421,14 @@ def checkSqlInjection(place, parameter, value):
424421 injection .data [stype ].where = where
425422 injection .data [stype ].vector = vector
426423 injection .data [stype ].comment = comment
427- injection .data [stype ].matchRatio = kb .matchRatio
428424 injection .data [stype ].templatePayload = templatePayload
429425
426+ injection .data [stype ].conf = advancedDict ()
427+ injection .data [stype ].conf .matchRatio = kb .matchRatio
428+ injection .data [stype ].conf .textOnly = conf .textOnly
429+ injection .data [stype ].conf .string = conf .string
430+ injection .data [stype ].conf .regexp = conf .regexp
431+
430432 if hasattr (test , "details" ):
431433 for detailKey , detailValue in test .details .items ():
432434 if detailKey == "dbms" and injection .dbms is None :
@@ -585,12 +587,6 @@ def checkDynamicContent(firstPage, secondPage):
585587 logger .debug (debugMsg )
586588 return
587589
588- if conf .longestCommon :
589- debugMsg = "dynamic content checking skipped "
590- debugMsg += "because longest common comparison used"
591- logger .debug (debugMsg )
592- return
593-
594590 conf .seqMatcher .set_seq1 (firstPage )
595591 conf .seqMatcher .set_seq2 (secondPage )
596592
@@ -608,7 +604,6 @@ def checkDynamicContent(firstPage, secondPage):
608604 logger .warn (warnMsg )
609605
610606 conf .textOnly = True
611- setTextOnly ()
612607 return
613608
614609 warnMsg = "target url is heavily dynamic"
@@ -677,7 +672,6 @@ def checkStability():
677672
678673 if test :
679674 conf .string = test
680- setString ()
681675
682676 if kb .nullConnection :
683677 debugMsg = "turning off NULL connection "
@@ -695,7 +689,6 @@ def checkStability():
695689
696690 if test :
697691 conf .regex = test
698- setRegexp ()
699692
700693 if kb .nullConnection :
701694 debugMsg = "turning off NULL connection "
@@ -709,7 +702,6 @@ def checkStability():
709702
710703 elif test and test [0 ] in ("t" , "T" ):
711704 conf .textOnly = True
712- setTextOnly ()
713705
714706 if kb .nullConnection :
715707 debugMsg = "turning off NULL connection "
@@ -727,24 +719,13 @@ def checkString():
727719 if not conf .string :
728720 return True
729721
730- condition = (
731- kb .resumedQueries .has_key (conf .url ) and
732- kb .resumedQueries [conf .url ].has_key ("String" ) and
733- kb .resumedQueries [conf .url ]["String" ][:- 1 ] == conf .string
734- )
735-
736- if condition :
737- return True
738-
739722 infoMsg = "testing if the provided string is within the "
740723 infoMsg += "target URL page content"
741724 logger .info (infoMsg )
742725
743726 page , _ = Request .queryPage (content = True )
744727
745- if conf .string in page :
746- setString ()
747- else :
728+ if conf .string not in page :
748729 warnMsg = "you provided '%s' as the string to " % conf .string
749730 warnMsg += "match, but such a string is not within the target "
750731 warnMsg += "URL page content original request, sqlmap will "
@@ -757,24 +738,13 @@ def checkRegexp():
757738 if not conf .regexp :
758739 return True
759740
760- condition = (
761- kb .resumedQueries .has_key (conf .url ) and
762- kb .resumedQueries [conf .url ].has_key ("Regular expression" ) and
763- kb .resumedQueries [conf .url ]["Regular expression" ][:- 1 ] == conf .regexp
764- )
765-
766- if condition :
767- return True
768-
769741 infoMsg = "testing if the provided regular expression matches within "
770742 infoMsg += "the target URL page content"
771743 logger .info (infoMsg )
772744
773745 page , _ = Request .queryPage (content = True )
774746
775- if re .search (conf .regexp , page , re .I | re .M ):
776- setRegexp ()
777- else :
747+ if not re .search (conf .regexp , page , re .I | re .M ):
778748 warnMsg = "you provided '%s' as the regular expression to " % conf .regexp
779749 warnMsg += "match, but such a regular expression does not have any "
780750 warnMsg += "match within the target URL page content, sqlmap "
0 commit comments