|
48 | 48 | from lib.core.session import setString |
49 | 49 | from lib.core.session import setRegexp |
50 | 50 | from lib.core.settings import DYNAMICITY_MARK_LENGTH |
| 51 | +from lib.core.settings import UPPER_RATIO_BOUND |
51 | 52 | from lib.core.unescaper import unescaper |
52 | 53 | from lib.request.connect import Connect as Request |
53 | 54 | from lib.request.templates import getPageTemplate |
@@ -636,24 +637,29 @@ def checkStability(): |
636 | 637 | errMsg = "Empty value supplied" |
637 | 638 | raise sqlmapNoneDataException, errMsg |
638 | 639 | else: |
639 | | - checkDynamicContent(firstPage, secondPage) |
| 640 | + conf.seqMatcher.set_seq1(firstPage) |
| 641 | + conf.seqMatcher.set_seq2(secondPage) |
640 | 642 |
|
641 | | - count = 0 |
642 | | - while not Request.queryPage(): |
643 | | - count += 1 |
| 643 | + # In case of an intolerable difference turn on dynamicity removal engine |
| 644 | + if conf.seqMatcher.quick_ratio() <= UPPER_RATIO_BOUND: |
| 645 | + checkDynamicContent(firstPage, secondPage) |
644 | 646 |
|
645 | | - if count > conf.retries: |
646 | | - errMsg = "target url is too dynamic. unable to continue. " |
647 | | - errMsg += "consider using other switches (e.g. " |
648 | | - errMsg += "--longest-common, --string, --text-only, etc.)" |
649 | | - raise sqlmapSiteTooDynamic, errMsg |
| 647 | + count = 0 |
| 648 | + while not Request.queryPage(): |
| 649 | + count += 1 |
650 | 650 |
|
651 | | - warnMsg = "target url is heavily dynamic" |
652 | | - warnMsg += ", sqlmap is going to retry the request" |
653 | | - logger.critical(warnMsg) |
| 651 | + if count > conf.retries: |
| 652 | + errMsg = "target url is too dynamic. unable to continue. " |
| 653 | + errMsg += "consider using other switches (e.g. " |
| 654 | + errMsg += "--longest-common, --string, --text-only, etc.)" |
| 655 | + raise sqlmapSiteTooDynamic, errMsg |
654 | 656 |
|
655 | | - secondPage, _ = Request.queryPage(content=True) |
656 | | - checkDynamicContent(firstPage, secondPage) |
| 657 | + warnMsg = "target url is heavily dynamic" |
| 658 | + warnMsg += ", sqlmap is going to retry the request" |
| 659 | + logger.critical(warnMsg) |
| 660 | + |
| 661 | + secondPage, _ = Request.queryPage(content=True) |
| 662 | + checkDynamicContent(firstPage, secondPage) |
657 | 663 |
|
658 | 664 | return kb.pageStable |
659 | 665 |
|
|
0 commit comments