Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 11c7cc5

Browse files
committed
minor temporary fix
1 parent 98a3e43 commit 11c7cc5

1 file changed

Lines changed: 26 additions & 19 deletions

File tree

lib/core/target.py

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
See the file 'doc/COPYING' for copying permission
88
"""
99

10+
import binascii
1011
import codecs
1112
import os
1213
import re
@@ -210,25 +211,31 @@ def __resumeHashDBValues():
210211
Resume stored data values from HashDB
211212
"""
212213

213-
kb.absFilePaths = hashDBRetrieve(HASHDB_KEYS.KB_ABS_FILE_PATHS, True) or kb.absFilePaths
214-
kb.chars = hashDBRetrieve(HASHDB_KEYS.KB_CHARS, True) or kb.chars
215-
kb.dynamicMarkings = hashDBRetrieve(HASHDB_KEYS.KB_DYNAMIC_MARKINGS, True) or kb.dynamicMarkings
216-
kb.brute.tables = hashDBRetrieve(HASHDB_KEYS.KB_BRUTE_TABLES, True) or kb.brute.tables
217-
kb.brute.columns = hashDBRetrieve(HASHDB_KEYS.KB_BRUTE_COLUMNS, True) or kb.brute.columns
218-
kb.xpCmdshellAvailable = hashDBRetrieve(HASHDB_KEYS.KB_XP_CMDSHELL_AVAILABLE) or kb.xpCmdshellAvailable
219-
220-
conf.tmpPath = conf.tmpPath or hashDBRetrieve(HASHDB_KEYS.CONF_TMP_PATH)
221-
222-
for injection in hashDBRetrieve(HASHDB_KEYS.KB_INJECTIONS, True) or []:
223-
if injection.place in conf.paramDict and \
224-
injection.parameter in conf.paramDict[injection.place]:
225-
226-
if not conf.tech or intersect(conf.tech, injection.data.keys()):
227-
if intersect(conf.tech, injection.data.keys()):
228-
injection.data = dict(filter(lambda (key, item): key in conf.tech, injection.data.items()))
229-
230-
if injection not in kb.injections:
231-
kb.injections.append(injection)
214+
try:
215+
kb.absFilePaths = hashDBRetrieve(HASHDB_KEYS.KB_ABS_FILE_PATHS, True) or kb.absFilePaths
216+
kb.chars = hashDBRetrieve(HASHDB_KEYS.KB_CHARS, True) or kb.chars
217+
kb.dynamicMarkings = hashDBRetrieve(HASHDB_KEYS.KB_DYNAMIC_MARKINGS, True) or kb.dynamicMarkings
218+
kb.brute.tables = hashDBRetrieve(HASHDB_KEYS.KB_BRUTE_TABLES, True) or kb.brute.tables
219+
kb.brute.columns = hashDBRetrieve(HASHDB_KEYS.KB_BRUTE_COLUMNS, True) or kb.brute.columns
220+
kb.xpCmdshellAvailable = hashDBRetrieve(HASHDB_KEYS.KB_XP_CMDSHELL_AVAILABLE) or kb.xpCmdshellAvailable
221+
222+
conf.tmpPath = conf.tmpPath or hashDBRetrieve(HASHDB_KEYS.CONF_TMP_PATH)
223+
224+
for injection in hashDBRetrieve(HASHDB_KEYS.KB_INJECTIONS, True) or []:
225+
if injection.place in conf.paramDict and \
226+
injection.parameter in conf.paramDict[injection.place]:
227+
228+
if not conf.tech or intersect(conf.tech, injection.data.keys()):
229+
if intersect(conf.tech, injection.data.keys()):
230+
injection.data = dict(filter(lambda (key, item): key in conf.tech, injection.data.items()))
231+
232+
if injection not in kb.injections:
233+
kb.injections.append(injection)
234+
except binascii.Error:
235+
errMsg = "revision r4833 invalidated all previous session data. "
236+
errMsg += "You are advised either to temporary revert to the previous "
237+
errMsg += "revision or (recommended) run with the switch '--flush-session'"
238+
raise sqlmapGenericException, errMsg
232239

233240
def __setOutputResume():
234241
"""

0 commit comments

Comments
 (0)