Skip to content

Commit

Permalink
Added warning message when parameter-value setting in profile contain…
Browse files Browse the repository at this point in the history
…s unexpected characters.
  • Loading branch information
mgeeky committed Oct 7, 2022
1 parent 37b2a3a commit 3013ef1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions plugins/malleable_redirector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand Down Expand Up @@ -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')

Expand Down

0 comments on commit 3013ef1

Please sign in to comment.