|
23 | 23 | from lib.core.common import Format |
24 | 24 | from lib.core.common import getComparePageRatio |
25 | 25 | from lib.core.common import getCompiledRegex |
| 26 | +from lib.core.common import getLastRequestHTTPError |
26 | 27 | from lib.core.common import getSortedInjectionTests |
27 | 28 | from lib.core.common import getUnicode |
28 | 29 | from lib.core.common import intersect |
@@ -658,25 +659,30 @@ def checkDynParam(place, parameter, value): |
658 | 659 | """ |
659 | 660 |
|
660 | 661 | kb.matchRatio = None |
| 662 | + dynResult = None |
| 663 | + randInt = randomInt() |
661 | 664 |
|
662 | 665 | infoMsg = "testing if %s parameter '%s' is dynamic" % (place, parameter) |
663 | 666 | logger.info(infoMsg) |
664 | 667 |
|
665 | | - randInt = randomInt() |
666 | | - payload = agent.payload(place, parameter, value, getUnicode(randInt)) |
667 | | - dynResult = Request.queryPage(payload, place, raise404=False) |
668 | | - |
669 | | - if True == dynResult: |
670 | | - return False |
| 668 | + try: |
| 669 | + payload = agent.payload(place, parameter, value, getUnicode(randInt)) |
| 670 | + dynResult = Request.queryPage(payload, place, raise404=False) |
671 | 671 |
|
672 | | - infoMsg = "confirming that %s parameter '%s' is dynamic" % (place, parameter) |
673 | | - logger.info(infoMsg) |
| 672 | + if not dynResult: |
| 673 | + infoMsg = "confirming that %s parameter '%s' is dynamic" % (place, parameter) |
| 674 | + logger.info(infoMsg) |
674 | 675 |
|
675 | | - randInt = randomInt() |
676 | | - payload = agent.payload(place, parameter, value, getUnicode(randInt)) |
677 | | - dynResult = Request.queryPage(payload, place, raise404=False) |
| 676 | + randInt = randomInt() |
| 677 | + payload = agent.payload(place, parameter, value, getUnicode(randInt)) |
| 678 | + dynResult = Request.queryPage(payload, place, raise404=False) |
| 679 | + except sqlmapConnectionException: |
| 680 | + pass |
678 | 681 |
|
679 | | - return not dynResult |
| 682 | + if dynResult is None: |
| 683 | + return None |
| 684 | + else: |
| 685 | + return not dynResult |
680 | 686 |
|
681 | 687 | def checkDynamicContent(firstPage, secondPage): |
682 | 688 | """ |
@@ -965,7 +971,7 @@ def checkConnection(suppressOutput=False): |
965 | 971 | warnMsg += "which could interfere with the results of the tests" |
966 | 972 | logger.warn(warnMsg) |
967 | 973 | elif wasLastRequestHTTPError(): |
968 | | - warnMsg = "the web server responded with an HTTP error code " |
| 974 | + warnMsg = "the web server responded with an HTTP error code (%d) " % getLastRequestHTTPError() |
969 | 975 | warnMsg += "which could interfere with the results of the tests" |
970 | 976 | logger.warn(warnMsg) |
971 | 977 | else: |
|
0 commit comments