|
7 | 7 | See the file 'doc/COPYING' for copying permission |
8 | 8 | """ |
9 | 9 |
|
| 10 | +import binascii |
10 | 11 | import codecs |
11 | 12 | import os |
12 | 13 | import re |
@@ -210,25 +211,31 @@ def __resumeHashDBValues(): |
210 | 211 | Resume stored data values from HashDB |
211 | 212 | """ |
212 | 213 |
|
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 |
232 | 239 |
|
233 | 240 | def __setOutputResume(): |
234 | 241 | """ |
|
0 commit comments