mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-01-25 00:34:28 +03:00
Trivial speedup
This commit is contained in:
parent
eeacab0f19
commit
0df2592622
|
@ -1997,6 +1997,7 @@ def _setKnowledgeBaseAttributes(flushAll=True):
|
||||||
kb.cache = AttribDict()
|
kb.cache = AttribDict()
|
||||||
kb.cache.addrinfo = {}
|
kb.cache.addrinfo = {}
|
||||||
kb.cache.content = {}
|
kb.cache.content = {}
|
||||||
|
kb.cache.comparison = {}
|
||||||
kb.cache.encoding = {}
|
kb.cache.encoding = {}
|
||||||
kb.cache.alphaBoundaries = None
|
kb.cache.alphaBoundaries = None
|
||||||
kb.cache.hashRegex = None
|
kb.cache.hashRegex = None
|
||||||
|
|
|
@ -18,7 +18,7 @@ from lib.core.enums import OS
|
||||||
from thirdparty.six import unichr as _unichr
|
from thirdparty.six import unichr as _unichr
|
||||||
|
|
||||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||||
VERSION = "1.5.3.0"
|
VERSION = "1.5.3.1"
|
||||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
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)
|
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||||
|
@ -505,6 +505,9 @@ REFLECTED_MAX_REGEX_PARTS = 10
|
||||||
# Chars which can be used as a failsafe values in case of too long URL encoding value
|
# Chars which can be used as a failsafe values in case of too long URL encoding value
|
||||||
URLENCODE_FAILSAFE_CHARS = "()|,"
|
URLENCODE_FAILSAFE_CHARS = "()|,"
|
||||||
|
|
||||||
|
# Factor used for yuge page multiplication
|
||||||
|
YUGE_FACTOR = 1000
|
||||||
|
|
||||||
# Maximum length of URL encoded value after which failsafe procedure takes away
|
# Maximum length of URL encoded value after which failsafe procedure takes away
|
||||||
URLENCODE_CHAR_LIMIT = 2000
|
URLENCODE_CHAR_LIMIT = 2000
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,14 @@ def _comparison(page, headers, code, getRatioValue, pageLength):
|
||||||
seqMatcher.set_seq1(seq1)
|
seqMatcher.set_seq1(seq1)
|
||||||
seqMatcher.set_seq2(seq2)
|
seqMatcher.set_seq2(seq2)
|
||||||
|
|
||||||
ratio = round(seqMatcher.quick_ratio() if not kb.heavilyDynamic else seqMatcher.ratio(), 3)
|
key = (hash(seq1), hash(seq2))
|
||||||
|
|
||||||
|
if key in kb.cache.comparison:
|
||||||
|
ratio = kb.cache.comparison[key]
|
||||||
|
else:
|
||||||
|
ratio = round(seqMatcher.quick_ratio() if not kb.heavilyDynamic else seqMatcher.ratio(), 3)
|
||||||
|
|
||||||
|
kb.cache.comparison[key] = ratio
|
||||||
|
|
||||||
# If the url is stable and we did not set yet the match ratio and the
|
# If the url is stable and we did not set yet the match ratio and the
|
||||||
# current injected value changes the url page content
|
# current injected value changes the url page content
|
||||||
|
|
|
@ -126,6 +126,7 @@ from lib.core.settings import UNICODE_ENCODING
|
||||||
from lib.core.settings import URI_HTTP_HEADER
|
from lib.core.settings import URI_HTTP_HEADER
|
||||||
from lib.core.settings import WARN_TIME_STDEV
|
from lib.core.settings import WARN_TIME_STDEV
|
||||||
from lib.core.settings import WEBSOCKET_INITIAL_TIMEOUT
|
from lib.core.settings import WEBSOCKET_INITIAL_TIMEOUT
|
||||||
|
from lib.core.settings import YUGE_FACTOR
|
||||||
from lib.request.basic import decodePage
|
from lib.request.basic import decodePage
|
||||||
from lib.request.basic import forgeHeaders
|
from lib.request.basic import forgeHeaders
|
||||||
from lib.request.basic import processResponse
|
from lib.request.basic import processResponse
|
||||||
|
@ -253,7 +254,7 @@ class Connect(object):
|
||||||
break
|
break
|
||||||
|
|
||||||
if conf.yuge:
|
if conf.yuge:
|
||||||
retVal = 100 * retVal
|
retVal = YUGE_FACTOR * retVal
|
||||||
|
|
||||||
return retVal
|
return retVal
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user