|
8 | 8 | import binascii |
9 | 9 | import codecs |
10 | 10 | import contextlib |
11 | | -import cookielib |
12 | 11 | import copy |
13 | 12 | import distutils |
14 | 13 | import getpass |
15 | 14 | import hashlib |
16 | | -import httplib |
17 | 15 | import inspect |
18 | 16 | import io |
19 | 17 | import json |
|
52 | 50 | from extra.cloak.cloak import decloak |
53 | 51 | from extra.safe2bin.safe2bin import safecharencode |
54 | 52 | from lib.core.bigarray import BigArray |
55 | | -from lib.core.data import conf |
56 | | -from lib.core.data import kb |
57 | | -from lib.core.data import logger |
58 | | -from lib.core.data import paths |
59 | 53 | from lib.core.convert import base64pickle |
60 | 54 | from lib.core.convert import base64unpickle |
61 | 55 | from lib.core.convert import hexdecode |
62 | 56 | from lib.core.convert import htmlunescape |
63 | 57 | from lib.core.convert import stdoutencode |
64 | 58 | from lib.core.convert import unicodeencode |
65 | 59 | from lib.core.convert import utf8encode |
| 60 | +from lib.core.data import conf |
| 61 | +from lib.core.data import kb |
| 62 | +from lib.core.data import logger |
| 63 | +from lib.core.data import paths |
66 | 64 | from lib.core.decorators import cachedmethod |
67 | 65 | from lib.core.defaults import defaults |
68 | 66 | from lib.core.dicts import DBMS_DICT |
69 | 67 | from lib.core.dicts import DEFAULT_DOC_ROOTS |
70 | 68 | from lib.core.dicts import DEPRECATED_OPTIONS |
| 69 | +from lib.core.dicts import HTTP_RESPONSES |
71 | 70 | from lib.core.dicts import SQL_STATEMENTS |
72 | 71 | from lib.core.enums import ADJUST_TIME_DELAY |
73 | 72 | from lib.core.enums import CONTENT_STATUS |
@@ -3305,9 +3304,9 @@ def showHttpErrorCodes(): |
3305 | 3304 |
|
3306 | 3305 | if kb.httpErrorCodes: |
3307 | 3306 | warnMsg = "HTTP error codes detected during run:\n" |
3308 | | - warnMsg += ", ".join("%d (%s) - %d times" % (code, httplib.responses[code] if code in httplib.responses else '?', count) for code, count in kb.httpErrorCodes.items()) |
| 3307 | + warnMsg += ", ".join("%d (%s) - %d times" % (code, HTTP_RESPONSES[code] if code in HTTP_RESPONSES else '?', count) for code, count in kb.httpErrorCodes.items()) |
3309 | 3308 | logger.warn(warnMsg) |
3310 | | - if any((str(_).startswith('4') or str(_).startswith('5')) and _ != httplib.INTERNAL_SERVER_ERROR and _ != kb.originalCode for _ in kb.httpErrorCodes.keys()): |
| 3309 | + if any((str(_).startswith('4') or str(_).startswith('5')) and _ != 500 and _ != kb.originalCode for _ in kb.httpErrorCodes.keys()): |
3311 | 3310 | msg = "too many 4xx and/or 5xx HTTP error codes " |
3312 | 3311 | msg += "could mean that some kind of protection is involved (e.g. WAF)" |
3313 | 3312 | logger.debug(msg) |
@@ -4512,7 +4511,7 @@ def resetCookieJar(cookieJar): |
4512 | 4511 | errMsg = "no valid cookies found" |
4513 | 4512 | raise SqlmapGenericException(errMsg) |
4514 | 4513 |
|
4515 | | - except cookielib.LoadError as ex: |
| 4514 | + except Exception as ex: |
4516 | 4515 | errMsg = "there was a problem loading " |
4517 | 4516 | errMsg += "cookies file ('%s')" % re.sub(r"(cookies) file '[^']+'", r"\g<1>", getSafeExString(ex)) |
4518 | 4517 | raise SqlmapGenericException(errMsg) |
|
0 commit comments