mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-06-13 09:33:16 +03:00
another fix for Bug #148
This commit is contained in:
parent
39652bfbf4
commit
98205cc488
|
@ -32,6 +32,7 @@ import time
|
||||||
import urlparse
|
import urlparse
|
||||||
import ntpath
|
import ntpath
|
||||||
import posixpath
|
import posixpath
|
||||||
|
|
||||||
from lib.contrib import magic
|
from lib.contrib import magic
|
||||||
from lib.core.data import conf
|
from lib.core.data import conf
|
||||||
from lib.core.data import kb
|
from lib.core.data import kb
|
||||||
|
@ -869,3 +870,7 @@ def safeStringFormat(formatStr, params):
|
||||||
count += 1
|
count += 1
|
||||||
|
|
||||||
return retVal
|
return retVal
|
||||||
|
|
||||||
|
def sanitizeAsciiString(string):
|
||||||
|
return "".join(char if ord(char) <= 128 else '?' for char in string)
|
||||||
|
|
|
@ -29,13 +29,13 @@ import time
|
||||||
import urllib2
|
import urllib2
|
||||||
import urlparse
|
import urlparse
|
||||||
import traceback
|
import traceback
|
||||||
import unicodedata
|
|
||||||
|
|
||||||
from lib.contrib import multipartpost
|
from lib.contrib import multipartpost
|
||||||
from lib.core.convert import urlencode
|
from lib.core.convert import urlencode
|
||||||
from lib.core.data import conf
|
from lib.core.data import conf
|
||||||
from lib.core.data import kb
|
from lib.core.data import kb
|
||||||
from lib.core.data import logger
|
from lib.core.data import logger
|
||||||
|
from lib.core.common import sanitizeAsciiString
|
||||||
from lib.core.exception import sqlmapConnectionException
|
from lib.core.exception import sqlmapConnectionException
|
||||||
from lib.request.basic import decodePage
|
from lib.request.basic import decodePage
|
||||||
from lib.request.basic import forgeHeaders
|
from lib.request.basic import forgeHeaders
|
||||||
|
@ -75,7 +75,7 @@ class Connect:
|
||||||
cookieStr = ""
|
cookieStr = ""
|
||||||
requestMsg = "HTTP request:\n%s " % conf.method
|
requestMsg = "HTTP request:\n%s " % conf.method
|
||||||
requestMsg += "%s" % urlparse.urlsplit(url)[2] or "/"
|
requestMsg += "%s" % urlparse.urlsplit(url)[2] or "/"
|
||||||
responseMsg = u"HTTP response "
|
responseMsg = "HTTP response "
|
||||||
requestHeaders = ""
|
requestHeaders = ""
|
||||||
responseHeaders = ""
|
responseHeaders = ""
|
||||||
|
|
||||||
|
@ -221,6 +221,8 @@ class Connect:
|
||||||
|
|
||||||
socket.setdefaulttimeout(conf.timeout)
|
socket.setdefaulttimeout(conf.timeout)
|
||||||
|
|
||||||
|
page = sanitizeAsciiString(page)
|
||||||
|
|
||||||
parseResponse(page, responseHeaders)
|
parseResponse(page, responseHeaders)
|
||||||
responseMsg += "(%s - %d):\n" % (status, code)
|
responseMsg += "(%s - %d):\n" % (status, code)
|
||||||
|
|
||||||
|
@ -229,7 +231,6 @@ class Connect:
|
||||||
elif conf.verbose > 4:
|
elif conf.verbose > 4:
|
||||||
responseMsg += "%s\n%s\n" % (responseHeaders, page)
|
responseMsg += "%s\n%s\n" % (responseHeaders, page)
|
||||||
|
|
||||||
responseMsg = unicodedata.normalize('NFKD', responseMsg).encode('ascii','ignore')
|
|
||||||
logger.log(8, responseMsg)
|
logger.log(8, responseMsg)
|
||||||
|
|
||||||
return page, responseHeaders
|
return page, responseHeaders
|
||||||
|
|
Loading…
Reference in New Issue
Block a user