mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-01-29 17:49:09 +00:00
Minor optimization of findMultipartPostBoundary
This commit is contained in:
@@ -2923,22 +2923,15 @@ def findMultipartPostBoundary(post):
|
||||
"""
|
||||
|
||||
retVal = None
|
||||
|
||||
done = set()
|
||||
candidates = []
|
||||
counts = {}
|
||||
|
||||
for match in re.finditer(r"(?m)^--(.+?)(--)?$", post or ""):
|
||||
_ = match.group(1).strip().strip('-')
|
||||
boundary = match.group(1).strip().strip('-')
|
||||
counts[boundary] = counts.get(boundary, 0) + 1
|
||||
|
||||
if _ in done:
|
||||
continue
|
||||
else:
|
||||
candidates.append((post.count(_), _))
|
||||
done.add(_)
|
||||
|
||||
if candidates:
|
||||
candidates.sort(key=lambda _: _[0], reverse=True)
|
||||
retVal = candidates[0][1]
|
||||
if counts:
|
||||
sorted_boundaries = sorted(counts.items(), key=lambda x: x[1], reverse=True)
|
||||
retVal = sorted_boundaries[0][0]
|
||||
|
||||
return retVal
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ from lib.core.enums import OS
|
||||
from thirdparty import six
|
||||
|
||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||
VERSION = "1.10.1.65"
|
||||
VERSION = "1.10.1.66"
|
||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
||||
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||
|
||||
Reference in New Issue
Block a user