@@ -1340,44 +1340,6 @@ def checkStability():
13401340
13411341 return kb .pageStable
13421342
1343- def checkString ():
1344- if not conf .string :
1345- return True
1346-
1347- infoMsg = "testing if the provided string is within the "
1348- infoMsg += "target URL page content"
1349- logger .info (infoMsg )
1350-
1351- page , headers , _ = Request .queryPage (content = True )
1352- rawResponse = "%s%s" % (listToStrValue (headers .headers if headers else "" ), page )
1353-
1354- if conf .string not in rawResponse :
1355- warnMsg = "you provided '%s' as the string to " % conf .string
1356- warnMsg += "match, but such a string is not within the target "
1357- warnMsg += "URL raw response, sqlmap will carry on anyway"
1358- logger .warn (warnMsg )
1359-
1360- return True
1361-
1362- def checkRegexp ():
1363- if not conf .regexp :
1364- return True
1365-
1366- infoMsg = "testing if the provided regular expression matches within "
1367- infoMsg += "the target URL page content"
1368- logger .info (infoMsg )
1369-
1370- page , headers , _ = Request .queryPage (content = True )
1371- rawResponse = "%s%s" % (listToStrValue (headers .headers if headers else "" ), page )
1372-
1373- if not re .search (conf .regexp , rawResponse , re .I | re .M ):
1374- warnMsg = "you provided '%s' as the regular expression " % conf .regexp
1375- warnMsg += "which does not have any match within the target URL raw response. sqlmap "
1376- warnMsg += "will carry on anyway"
1377- logger .warn (warnMsg )
1378-
1379- return True
1380-
13811343@stackedmethod
13821344def checkWaf ():
13831345 """
@@ -1542,7 +1504,31 @@ def checkConnection(suppressOutput=False):
15421504
15431505 try :
15441506 kb .originalPageTime = time .time ()
1545- Request .queryPage (content = True , noteResponseTime = False )
1507+ page , headers , _ = Request .queryPage (content = True , noteResponseTime = False )
1508+
1509+ rawResponse = "%s%s" % (listToStrValue (headers .headers if headers else "" ), page )
1510+
1511+ if conf .string :
1512+ infoMsg = "testing if the provided string is within the "
1513+ infoMsg += "target URL page content"
1514+ logger .info (infoMsg )
1515+
1516+ if conf .string not in rawResponse :
1517+ warnMsg = "you provided '%s' as the string to " % conf .string
1518+ warnMsg += "match, but such a string is not within the target "
1519+ warnMsg += "URL raw response, sqlmap will carry on anyway"
1520+ logger .warn (warnMsg )
1521+
1522+ if conf .regexp :
1523+ infoMsg = "testing if the provided regular expression matches within "
1524+ infoMsg += "the target URL page content"
1525+ logger .info (infoMsg )
1526+
1527+ if not re .search (conf .regexp , rawResponse , re .I | re .M ):
1528+ warnMsg = "you provided '%s' as the regular expression " % conf .regexp
1529+ warnMsg += "which does not have any match within the target URL raw response. sqlmap "
1530+ warnMsg += "will carry on anyway"
1531+ logger .warn (warnMsg )
15461532
15471533 kb .errorIsNone = False
15481534
0 commit comments