mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-01-24 08:14:24 +03:00
minor patch
This commit is contained in:
parent
39b406c5c1
commit
5f7dbec41f
|
@ -621,7 +621,7 @@ mariano <marianoso@gmail.com>
|
||||||
for reporting a bug
|
for reporting a bug
|
||||||
|
|
||||||
mitchell <mitchell@tufala.net>
|
mitchell <mitchell@tufala.net>
|
||||||
for reporting a bug
|
for reporting a few bugs
|
||||||
|
|
||||||
Nadzree <nadzree@bake180.com>
|
Nadzree <nadzree@bake180.com>
|
||||||
for reporting a minor bug
|
for reporting a minor bug
|
||||||
|
|
|
@ -212,48 +212,52 @@ def __setOutputResume():
|
||||||
|
|
||||||
if os.path.exists(conf.sessionFile):
|
if os.path.exists(conf.sessionFile):
|
||||||
if not conf.flushSession:
|
if not conf.flushSession:
|
||||||
readSessionFP = codecs.open(conf.sessionFile, "r", UNICODE_ENCODING, 'replace')
|
try:
|
||||||
__url_cache = set()
|
readSessionFP = codecs.open(conf.sessionFile, "r", UNICODE_ENCODING, 'replace')
|
||||||
__expression_cache = {}
|
__url_cache = set()
|
||||||
|
__expression_cache = {}
|
||||||
|
|
||||||
for line in readSessionFP.readlines(): # xreadlines doesn't return unicode strings when codec.open() is used
|
for line in readSessionFP.readlines(): # xreadlines doesn't return unicode strings when codec.open() is used
|
||||||
if line.count("][") == 4:
|
if line.count("][") == 4:
|
||||||
line = line.split("][")
|
line = line.split("][")
|
||||||
|
|
||||||
if len(line) != 5:
|
if len(line) != 5:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
url, _, _, expression, value = line
|
url, _, _, expression, value = line
|
||||||
|
|
||||||
if not value:
|
if not value:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if url[0] == "[":
|
if url[0] == "[":
|
||||||
url = url[1:]
|
url = url[1:]
|
||||||
|
|
||||||
value = value.rstrip('\r\n') # Strips both chars independently
|
value = value.rstrip('\r\n') # Strips both chars independently
|
||||||
|
|
||||||
if url not in ( conf.url, conf.hostname ):
|
if url not in ( conf.url, conf.hostname ):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if url not in __url_cache:
|
if url not in __url_cache:
|
||||||
kb.resumedQueries[url] = {}
|
kb.resumedQueries[url] = {}
|
||||||
kb.resumedQueries[url][expression] = value
|
kb.resumedQueries[url][expression] = value
|
||||||
__url_cache.add(url)
|
__url_cache.add(url)
|
||||||
__expression_cache[url] = set(expression)
|
__expression_cache[url] = set(expression)
|
||||||
|
|
||||||
resumeConfKb(expression, url, value)
|
resumeConfKb(expression, url, value)
|
||||||
|
|
||||||
if expression not in __expression_cache[url]:
|
if expression not in __expression_cache[url]:
|
||||||
kb.resumedQueries[url][expression] = value
|
kb.resumedQueries[url][expression] = value
|
||||||
__expression_cache[url].add(value)
|
__expression_cache[url].add(value)
|
||||||
elif len(value) >= len(kb.resumedQueries[url][expression]):
|
elif len(value) >= len(kb.resumedQueries[url][expression]):
|
||||||
kb.resumedQueries[url][expression] = value
|
kb.resumedQueries[url][expression] = value
|
||||||
|
|
||||||
if kb.injection.place is not None and kb.injection.parameter is not None:
|
if kb.injection.place is not None and kb.injection.parameter is not None:
|
||||||
kb.injections.append(kb.injection)
|
kb.injections.append(kb.injection)
|
||||||
|
except IOError, msg:
|
||||||
readSessionFP.close()
|
errMsg = "unable to properly open the session file (%s)" % msg
|
||||||
|
raise sqlmapFilePathException, errMsg
|
||||||
|
else:
|
||||||
|
readSessionFP.close()
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
os.remove(conf.sessionFile)
|
os.remove(conf.sessionFile)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user