mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-07-03 19:33:18 +03:00
bug fix for charset used in inference for pages retrieved with --null-connection
This commit is contained in:
parent
a4a0f10950
commit
f6f4b5e9dd
|
@ -62,6 +62,7 @@ from lib.core.exception import sqlmapSyntaxException
|
||||||
from lib.core.exception import sqlmapUnsupportedDBMSException
|
from lib.core.exception import sqlmapUnsupportedDBMSException
|
||||||
from lib.core.exception import sqlmapUserQuitException
|
from lib.core.exception import sqlmapUserQuitException
|
||||||
from lib.core.optiondict import optDict
|
from lib.core.optiondict import optDict
|
||||||
|
from lib.core.settings import DEFAULT_PAGE_ENCODING
|
||||||
from lib.core.settings import IS_WIN
|
from lib.core.settings import IS_WIN
|
||||||
from lib.core.settings import PLATFORM
|
from lib.core.settings import PLATFORM
|
||||||
from lib.core.settings import PYVERSION
|
from lib.core.settings import PYVERSION
|
||||||
|
@ -1142,7 +1143,7 @@ def __setKnowledgeBaseAttributes(flushAll=True):
|
||||||
kb.osVersion = None
|
kb.osVersion = None
|
||||||
kb.osSP = None
|
kb.osSP = None
|
||||||
|
|
||||||
kb.pageEncoding = None
|
kb.pageEncoding = DEFAULT_PAGE_ENCODING
|
||||||
kb.pageStable = None
|
kb.pageStable = None
|
||||||
kb.partRun = None
|
kb.partRun = None
|
||||||
kb.proxyAuthHeader = None
|
kb.proxyAuthHeader = None
|
||||||
|
|
|
@ -122,6 +122,9 @@ def decodePage(page, contentEncoding, contentType):
|
||||||
Decode compressed/charset HTTP response
|
Decode compressed/charset HTTP response
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if not page or (conf.nullConnection and len(page) < 2):
|
||||||
|
return getUnicode(page)
|
||||||
|
|
||||||
if isinstance(contentEncoding, basestring) and contentEncoding.lower() in ('gzip', 'x-gzip', 'deflate'):
|
if isinstance(contentEncoding, basestring) and contentEncoding.lower() in ('gzip', 'x-gzip', 'deflate'):
|
||||||
if contentEncoding == 'deflate':
|
if contentEncoding == 'deflate':
|
||||||
# http://stackoverflow.com/questions/1089662/python-inflate-and-deflate-implementations
|
# http://stackoverflow.com/questions/1089662/python-inflate-and-deflate-implementations
|
||||||
|
|
Loading…
Reference in New Issue
Block a user