From 3013ef1c6fe81f5c1b5a42680c5d63e200cb91a0 Mon Sep 17 00:00:00 2001 From: "Mariusz B. / mgeeky" Date: Fri, 7 Oct 2022 02:41:05 +0200 Subject: [PATCH] Added warning message when parameter-value setting in profile contains unexpected characters. --- plugins/malleable_redirector.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/malleable_redirector.py b/plugins/malleable_redirector.py index 867dd8c..0d365dc 100644 --- a/plugins/malleable_redirector.py +++ b/plugins/malleable_redirector.py @@ -262,8 +262,11 @@ def parse(self, path): else: for n in compregexes['parameter-value'].finditer(restofline): - paramval = list(filter(lambda x: x != None, n.groups()[1:]))[0] - values.append(paramval.replace('\\\\', '\\')) + try: + paramval = list(filter(lambda x: x != None, n.groups()[1:]))[0] + values.append(paramval.replace('\\\\', '\\')) + except Exception as e: + self.logger.fatal(f'Could not process line as ([set] parameter ["value", ...] :\n\n\t{line}\n\nMake sure your line doesnt include apostrophes, or other characters breaking compregexes["parameter-value"] regex.') if values == []: values = '' @@ -1891,7 +1894,7 @@ def _client_request_inspect(self, section, variant, req, req_body, malleable_met self.drop_reason(f'[DROP, {ts}, reason:0, {peerIP}] identical request seen before. Possible Replay-Attack attempt.') ret = self.report(True, ts, peerIP, req.uri, userAgentValue, '0') if ret == True: - return (True, '0') + return (True, '0') else: return (False, '0')