mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-09 22:21:30 +00:00
getting rid of obsolete getCompiledRegex (in newer versions of Python regexes are already cached)
This commit is contained in:
@@ -9,7 +9,6 @@ See the file 'doc/COPYING' for copying permission
|
||||
|
||||
import re
|
||||
|
||||
from lib.core.common import getCompiledRegex
|
||||
from lib.core.common import readXmlFile
|
||||
from lib.core.convert import urldecode
|
||||
from lib.core.data import paths
|
||||
@@ -51,9 +50,7 @@ def checkPayload(payload):
|
||||
|
||||
if payload:
|
||||
for rule, desc in rules:
|
||||
regObj = getCompiledRegex(rule)
|
||||
|
||||
if regObj.search(payload):
|
||||
if re.search(rule, payload):
|
||||
detected = True
|
||||
logger.warn("highly probable IDS/IPS detection: '%s: %s'" % (desc, payload))
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ except (ImportError, OSError):
|
||||
else:
|
||||
_multiprocessing = multiprocessing
|
||||
|
||||
import re
|
||||
import time
|
||||
|
||||
from hashlib import md5
|
||||
@@ -35,7 +36,6 @@ from lib.core.common import Backend
|
||||
from lib.core.common import checkFile
|
||||
from lib.core.common import clearConsoleLine
|
||||
from lib.core.common import dataToStdout
|
||||
from lib.core.common import getCompiledRegex
|
||||
from lib.core.common import getFileItems
|
||||
from lib.core.common import getPublicTypeMembers
|
||||
from lib.core.common import hashDBRetrieve
|
||||
@@ -404,7 +404,7 @@ def hashRecognition(value):
|
||||
elif regex == HASH.CRYPT_GENERIC:
|
||||
if any((value.lower() == value, value.upper() == value)):
|
||||
continue
|
||||
elif getCompiledRegex(regex).match(value):
|
||||
elif re.match(regex, value):
|
||||
retVal = regex
|
||||
break
|
||||
|
||||
@@ -574,7 +574,7 @@ def dictionaryAttack(attack_dict):
|
||||
|
||||
hash_ = hash_.split()[0]
|
||||
|
||||
if getCompiledRegex(hash_regex).match(hash_):
|
||||
if re.match(hash_regex, hash_):
|
||||
item = None
|
||||
|
||||
if hash_regex not in (HASH.CRYPT_GENERIC, HASH.WORDPRESS):
|
||||
|
||||
@@ -14,7 +14,6 @@ from lib.core.common import calculateDeltaSeconds
|
||||
from lib.core.common import dataToSessionFile
|
||||
from lib.core.common import dataToStdout
|
||||
from lib.core.common import Backend
|
||||
from lib.core.common import getCompiledRegex
|
||||
from lib.core.common import safeStringFormat
|
||||
from lib.core.common import randomStr
|
||||
from lib.core.common import replaceNewlineTabs
|
||||
@@ -133,7 +132,7 @@ def resume(expression, payload):
|
||||
return None
|
||||
|
||||
substringQuery = queries[Backend.getIdentifiedDbms()].substring.query
|
||||
select = getCompiledRegex("\ASELECT ", re.I).search(expression)
|
||||
select = re.search("\ASELECT ", expression, re.I)
|
||||
|
||||
_, length, regExpr = queryOutputLength(expression, payload)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user