Projects STRLCPY ghauri Commits 7167a854
🤬
  • updated code quality, improved boolean based case when page content and ratio both needs to be checked to be able to guess characters correctly..

  • Loading...
  • r0oth3x49 committed 1 year ago
    7167a854
    1 parent cf1eabae
  • ■ ■ ■ ■ ■
    ghauri/common/config.py
    skipped 104 lines
    105 105   self._bool_ctb = None
    106 106   self._bool_ctt = None
    107 107   self._bool_ctf = None
     108 + self._match_ratio_check = False
    108 109   
    109 110   @property
    110 111   def session_filepath(self):
    skipped 7 lines
  • ■ ■ ■ ■ ■ ■
    ghauri/common/utils.py
    skipped 653 lines
    654 654   )
    655 655   conf._bool_ctt = ctt
    656 656   conf._bool_ctf = ctf
     657 + if case == "Page Content" and conf._match_ratio_check:
     658 + is_vulner = False
     659 + if ratio_true != ratio_false and conf.match_ratio == ratio_true:
     660 + is_vulner = True
     661 + case = "Page Content"
     662 + difference = match_string if match_string else not_match_string
     663 + elif ratio_true != ratio_false and conf.match_ratio == ratio_false:
     664 + is_vulner = True
     665 + case = "Page Content"
     666 + difference = match_string if match_string else not_match_string
     667 + else:
     668 + difference = ""
    657 669   if case == "Page Ratio":
    658 670   w0set = set(get_filtered_page_content(base.text, True, "\n").split("\n"))
    659 671   w1set = set(get_filtered_page_content(attack_true.text, True, "\n").split("\n"))
    skipped 61 lines
    721 733   ):
    722 734   is_vulner = True
    723 735   case = "Match Ratio"
     736 + elif (
     737 + difference
     738 + and conf.match_ratio
     739 + and conf.match_ratio in [ratio_true, ratio_false]
     740 + ):
     741 + if not conf._match_ratio_check:
     742 + is_vulner = True
     743 + case = "Page Ratio, Match Ratio"
     744 + conf._match_ratio_check = True
    724 745   if difference and is_vulner:
    725 746   string = difference
    726 747   not_string = ""
    skipped 1351 lines
Please wait...
Page is in error, reload to recover