From 2ef2bcbf33e6cbe63e7ff546da8421daecff7804 Mon Sep 17 00:00:00 2001 From: 13ph03nix <17541483+13ph03nix@users.noreply.github.com> Date: Mon, 20 Mar 2023 22:45:06 -0700 Subject: [PATCH] feat: support disable protocol correction and honeypot checks --- manpages/pocsuite.1 | 3 +++ pocsuite.ini | 2 ++ pocsuite3/lib/core/option.py | 1 + pocsuite3/lib/core/optiondict.py | 3 ++- pocsuite3/lib/core/poc.py | 3 +++ pocsuite3/lib/core/settings.py | 1 + pocsuite3/lib/parse/cmd.py | 2 ++ tests/test_configfile.py | 2 ++ 8 files changed, 16 insertions(+), 1 deletion(-) diff --git a/manpages/pocsuite.1 b/manpages/pocsuite.1 index 44d0eacd..6cb5456a 100644 --- a/manpages/pocsuite.1 +++ b/manpages/pocsuite.1 @@ -239,6 +239,9 @@ only export request rule .TP \fB\-\-rule\-filename\fR RULE_FILENAME Specify the name of the export rule file +.TP +\fB\-\-no\-check\fR +Disable URL protocol correction and honeypot check .SS "Poc options:" .IP definition options for PoC diff --git a/pocsuite.ini b/pocsuite.ini index 983339a7..32ad87c3 100644 --- a/pocsuite.ini +++ b/pocsuite.ini @@ -125,6 +125,8 @@ rule = False rule_req = False ; specify the name of the export rule file rule_filename = +; Disable URL protocol correction and honeypot check +no_check = [Poc options] ; show all definition options diff --git a/pocsuite3/lib/core/option.py b/pocsuite3/lib/core/option.py index 3be818c9..9364e4fd 100644 --- a/pocsuite3/lib/core/option.py +++ b/pocsuite3/lib/core/option.py @@ -585,6 +585,7 @@ def _set_conf_attributes(): conf.rule = False conf.rule_req = False conf.rule_filename = None + conf.no_check = False conf.show_options = False conf.enable_tls_listener = False diff --git a/pocsuite3/lib/core/optiondict.py b/pocsuite3/lib/core/optiondict.py index c0bea120..53c0ee3b 100644 --- a/pocsuite3/lib/core/optiondict.py +++ b/pocsuite3/lib/core/optiondict.py @@ -71,7 +71,8 @@ 'pcap': 'boolean', 'rule': 'boolean', 'rule_req': 'boolean', - 'rule_filename': 'string' + 'rule_filename': 'string', + 'no_check': 'boolean' }, 'Poc options': { 'show_options': 'boolean' diff --git a/pocsuite3/lib/core/poc.py b/pocsuite3/lib/core/poc.py index 3ca53b50..f1af9ca3 100644 --- a/pocsuite3/lib/core/poc.py +++ b/pocsuite3/lib/core/poc.py @@ -304,6 +304,9 @@ def execute(self, target, headers=None, params=None, mode='verify', verbose=True return output def _check(self, dork='', allow_redirects=False, return_obj=False, is_http=True, honeypot_check=True): + if conf.get('no_check', False): + return True + u = urlparse(self.url) # the port closed if u.port and not check_port(u.hostname, u.port): diff --git a/pocsuite3/lib/core/settings.py b/pocsuite3/lib/core/settings.py index 71c33090..b695ee6e 100644 --- a/pocsuite3/lib/core/settings.py +++ b/pocsuite3/lib/core/settings.py @@ -171,6 +171,7 @@ "rule", "rule-req", "rule-filename", + "no-check", "options", # other diff --git a/pocsuite3/lib/parse/cmd.py b/pocsuite3/lib/parse/cmd.py index 52fbd0a3..fc65c621 100644 --- a/pocsuite3/lib/parse/cmd.py +++ b/pocsuite3/lib/parse/cmd.py @@ -150,6 +150,8 @@ def cmd_line_parser(argv=None): help="only export request rule") optimization.add_argument("--rule-filename", dest="rule_filename", action="store", default=False, help="Specify the name of the export rule file") + optimization.add_argument("--no-check", dest="no_check", action="store_true", default=False, + help="Disable URL protocol correction and honeypot check") # Diy options diy = parser.add_argument_group("Poc options", "definition options for PoC") diy.add_argument("--options", dest="show_options", action="store_true", default=False, diff --git a/tests/test_configfile.py b/tests/test_configfile.py index f55a80c7..22535030 100644 --- a/tests/test_configfile.py +++ b/tests/test_configfile.py @@ -153,6 +153,8 @@ def test_build_ini(self): help="only export request rule") optimization.add_option("--rule-filename", dest="rule_filename", action="store", default=False, help="Specify the name of the export rule file") + optimization.add_option("--no-check", dest="no_check", action="store_true", default=False, + help="Disable URL protocol correction and honeypot check") # Diy options diy_options = OptionGroup(parser, "Poc options", "definition options for PoC")