mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-03 13:14:13 +03:00
some optimization
This commit is contained in:
parent
a6310c0b21
commit
b77e2042f2
|
@ -95,13 +95,13 @@ def main():
|
||||||
logger.critical(e)
|
logger.critical(e)
|
||||||
closeDumper(False, e)
|
closeDumper(False, e)
|
||||||
|
|
||||||
except KeyboardInterrupt, _:
|
except KeyboardInterrupt:
|
||||||
print
|
print
|
||||||
errMsg = "user aborted"
|
errMsg = "user aborted"
|
||||||
logger.error(errMsg)
|
logger.error(errMsg)
|
||||||
closeDumper(False, errMsg)
|
closeDumper(False, errMsg)
|
||||||
|
|
||||||
except EOFError, _:
|
except EOFError:
|
||||||
print
|
print
|
||||||
errMsg = "exit"
|
errMsg = "exit"
|
||||||
logger.error(errMsg)
|
logger.error(errMsg)
|
||||||
|
@ -127,7 +127,10 @@ def main():
|
||||||
kb.threadException = True
|
kb.threadException = True
|
||||||
|
|
||||||
if conf.get('hashDB', None):
|
if conf.get('hashDB', None):
|
||||||
conf.hashDB.flush(True)
|
try:
|
||||||
|
conf.hashDB.flush(True)
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
pass
|
||||||
|
|
||||||
# Reference: http://stackoverflow.com/questions/1635080/terminate-a-multi-thread-python-program
|
# Reference: http://stackoverflow.com/questions/1635080/terminate-a-multi-thread-python-program
|
||||||
if hasattr(conf, "threads") and conf.threads > 1:
|
if hasattr(conf, "threads") and conf.threads > 1:
|
||||||
|
|
|
@ -1340,10 +1340,14 @@ def parseUnionPage(output, expression, partial=False, sort=True):
|
||||||
output = re.findall(regExpr, output, re.DOTALL | re.IGNORECASE)
|
output = re.findall(regExpr, output, re.DOTALL | re.IGNORECASE)
|
||||||
|
|
||||||
if sort:
|
if sort:
|
||||||
dict_ = {}
|
_ = []
|
||||||
|
unique = set()
|
||||||
for entry in output:
|
for entry in output:
|
||||||
dict_[entry.lower()] = entry
|
key = entry.lower()
|
||||||
output = dict_.values()
|
if key not in unique:
|
||||||
|
unique.add(key)
|
||||||
|
_.append(entry)
|
||||||
|
output = _
|
||||||
|
|
||||||
for entry in output:
|
for entry in output:
|
||||||
entry = safecharencode(entry) if kb.safeCharEncode else entry
|
entry = safecharencode(entry) if kb.safeCharEncode else entry
|
||||||
|
@ -1356,7 +1360,7 @@ def parseUnionPage(output, expression, partial=False, sort=True):
|
||||||
if len(entry) == 1:
|
if len(entry) == 1:
|
||||||
data.append(entry[0])
|
data.append(entry[0])
|
||||||
else:
|
else:
|
||||||
data.append(list(entry))
|
data.append(entry)
|
||||||
else:
|
else:
|
||||||
data = output
|
data = output
|
||||||
|
|
||||||
|
|
|
@ -72,10 +72,10 @@ def __oneShotUnionUse(expression, unpack=True, limited=False):
|
||||||
|
|
||||||
# Parse the returned page to get the exact union-based
|
# Parse the returned page to get the exact union-based
|
||||||
# sql injection output
|
# sql injection output
|
||||||
retVal = reduce(lambda x, y: x if x is not None else y, [ \
|
retVal = reduce(lambda x, y: x if x is not None else y, ( \
|
||||||
extractRegexResult(check, removeReflectiveValues(page, payload), re.DOTALL | re.IGNORECASE), \
|
extractRegexResult(check, removeReflectiveValues(page, payload), re.DOTALL | re.IGNORECASE), \
|
||||||
extractRegexResult(check, removeReflectiveValues(listToStrValue(headers.headers \
|
extractRegexResult(check, removeReflectiveValues(listToStrValue(headers.headers \
|
||||||
if headers else None), payload, True), re.DOTALL | re.IGNORECASE)], \
|
if headers else None), payload, True), re.DOTALL | re.IGNORECASE)), \
|
||||||
None)
|
None)
|
||||||
|
|
||||||
if retVal is not None:
|
if retVal is not None:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user