File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,13 +51,13 @@ def checkPayload(string):
5151 rules = []
5252 for xmlrule in xmlrules .getElementsByTagName ("filter" ):
5353 try :
54- rule = xmlrule .getElementsByTagName ('rule' )[0 ].childNodes [0 ].nodeValue
54+ rule = "(?i)%s" % xmlrule .getElementsByTagName ('rule' )[0 ].childNodes [0 ].nodeValue
5555 desc = __adjustGrammar (xmlrule .getElementsByTagName ('description' )[0 ].childNodes [0 ].nodeValue )
5656 rules .append ((rule , desc ))
5757 except sre_constants .error : #some issues with some regex expressions in Python 2.5
5858 pass
5959
6060 for rule , desc in rules :
6161 regObj = getCompiledRegex (rule )
62- if regObj .search (string , re . IGNORECASE ):
62+ if regObj .search (string ):
6363 logger .warn ("highly probable IDS/IPS detection: '%s'" % desc )
Original file line number Diff line number Diff line change 2424
2525import re
2626
27+ from lib .core .common import getCompiledRegex
2728from lib .core .common import normalizePath
2829from lib .core .common import ntToPosixSlashes
2930from lib .core .common import posixToNtSlashes
@@ -57,7 +58,7 @@ def getRemoteTempPath(self):
5758 else :
5859 conf .tmpPath = "/tmp"
5960
60- if re . search ( " \A[\w]:[\/\\ \\ ]+", conf .tmpPath , re . I ):
61+ if getCompiledRegex ( "(?i) \A[\w]:[\/\\ \\ ]+"). search ( conf .tmpPath ):
6162 kb .os = "Windows"
6263
6364 conf .tmpPath = normalizePath (conf .tmpPath )
You can’t perform that action at this time.
0 commit comments