mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-03-23 19:34:13 +03:00
update for a previous update (putting conf.dataEncoding in getUnicode wherever we know that data won't be 'touched' or 'used' in anyway related to the current web page - if not sure, just leave it as it is)
This commit is contained in:
parent
08ccbf2c1e
commit
0eabca9fd4
|
@ -89,7 +89,7 @@ class UnicodeRawConfigParser(RawConfigParser):
|
||||||
fp.write("[%s]\n" % DEFAULTSECT)
|
fp.write("[%s]\n" % DEFAULTSECT)
|
||||||
|
|
||||||
for (key, value) in self._defaults.items():
|
for (key, value) in self._defaults.items():
|
||||||
fp.write("%s = %s\n" % (key, getUnicode(value).replace('\n', '\n\t')))
|
fp.write("%s = %s\n" % (key, getUnicode(value, conf.dataEncoding).replace('\n', '\n\t')))
|
||||||
|
|
||||||
fp.write("\n")
|
fp.write("\n")
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ class UnicodeRawConfigParser(RawConfigParser):
|
||||||
if value is None:
|
if value is None:
|
||||||
fp.write("%s\n" % (key))
|
fp.write("%s\n" % (key))
|
||||||
else:
|
else:
|
||||||
fp.write("%s = %s\n" % (key, getUnicode(value).replace('\n', '\n\t')))
|
fp.write("%s = %s\n" % (key, getUnicode(value, conf.dataEncoding).replace('\n', '\n\t')))
|
||||||
|
|
||||||
fp.write("\n")
|
fp.write("\n")
|
||||||
|
|
||||||
|
@ -498,7 +498,7 @@ def readInput(message, default=None):
|
||||||
message += " "
|
message += " "
|
||||||
|
|
||||||
if conf.batch and default:
|
if conf.batch and default:
|
||||||
infoMsg = "%s%s" % (message, getUnicode(default))
|
infoMsg = "%s%s" % (message, getUnicode(default, conf.dataEncoding))
|
||||||
logger.info(infoMsg)
|
logger.info(infoMsg)
|
||||||
|
|
||||||
debugMsg = "used the default behaviour, running in batch mode"
|
debugMsg = "used the default behaviour, running in batch mode"
|
||||||
|
@ -1511,7 +1511,7 @@ def getUnicode(value, encoding=None):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if isinstance(value, basestring):
|
if isinstance(value, basestring):
|
||||||
return value if isinstance(value, unicode) else unicode(value, encoding or kb.pageEncoding or "utf-8", errors='replace')
|
return value if isinstance(value, unicode) else unicode(value, encoding or kb.pageEncoding or conf.dataEncoding, errors='replace')
|
||||||
else:
|
else:
|
||||||
return unicode(value) # encoding ignored for non-basestring instances
|
return unicode(value) # encoding ignored for non-basestring instances
|
||||||
|
|
||||||
|
|
|
@ -1183,7 +1183,7 @@ def __setKnowledgeBaseAttributes(flushAll=True):
|
||||||
kb.osVersion = None
|
kb.osVersion = None
|
||||||
kb.osSP = None
|
kb.osSP = None
|
||||||
|
|
||||||
kb.pageEncoding = "utf-8"
|
kb.pageEncoding = None
|
||||||
kb.pageStable = None
|
kb.pageStable = None
|
||||||
kb.partRun = None
|
kb.partRun = None
|
||||||
kb.proxyAuthHeader = None
|
kb.proxyAuthHeader = None
|
||||||
|
|
|
@ -27,7 +27,7 @@ def profile(profileOutputFile=None, dotOutputFile=None, imageOutputFile=None):
|
||||||
import gtk
|
import gtk
|
||||||
import pydot
|
import pydot
|
||||||
except ImportError, e:
|
except ImportError, e:
|
||||||
errMsg = "profiling requires third-party libraries (%s)" % getUnicode(e)
|
errMsg = "profiling requires third-party libraries (%s)" % getUnicode(e, conf.dataEncoding)
|
||||||
logger.error(errMsg)
|
logger.error(errMsg)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -201,7 +201,7 @@ def __updateSqlmap():
|
||||||
logger.debug(debugMsg)
|
logger.debug(debugMsg)
|
||||||
|
|
||||||
def notify(event_dict):
|
def notify(event_dict):
|
||||||
action = getUnicode(event_dict['action'])
|
action = getUnicode(event_dict['action'], conf.dataEncoding)
|
||||||
index = action.find('_')
|
index = action.find('_')
|
||||||
prefix = action[index + 1].upper() if index != -1 else action.capitalize()
|
prefix = action[index + 1].upper() if index != -1 else action.capitalize()
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ def __updateSqlmap():
|
||||||
if action.find('_completed') == -1:
|
if action.find('_completed') == -1:
|
||||||
dataToStdout("%s\t%s\n" % (prefix, event_dict['path']))
|
dataToStdout("%s\t%s\n" % (prefix, event_dict['path']))
|
||||||
else:
|
else:
|
||||||
revision = getUnicode(event_dict['revision'])
|
revision = getUnicode(event_dict['revision'], conf.dataEncoding)
|
||||||
index = revision.find('number ')
|
index = revision.find('number ')
|
||||||
|
|
||||||
if index != -1:
|
if index != -1:
|
||||||
|
|
|
@ -45,7 +45,7 @@ def direct(query, content=True):
|
||||||
output = timeout(func=conf.dbmsConnector.select, args=(query,), duration=conf.timeout, default=None)
|
output = timeout(func=conf.dbmsConnector.select, args=(query,), duration=conf.timeout, default=None)
|
||||||
|
|
||||||
infoMsg = "resumed from file '%s': " % conf.sessionFile
|
infoMsg = "resumed from file '%s': " % conf.sessionFile
|
||||||
infoMsg += "%s..." % getUnicode(output)[:20]
|
infoMsg += "%s..." % getUnicode(output, conf.dataEncoding)[:20]
|
||||||
logger.info(infoMsg)
|
logger.info(infoMsg)
|
||||||
else:
|
else:
|
||||||
output = timeout(func=conf.dbmsConnector.select, args=(query,), duration=conf.timeout, default=None)
|
output = timeout(func=conf.dbmsConnector.select, args=(query,), duration=conf.timeout, default=None)
|
||||||
|
@ -61,7 +61,7 @@ def direct(query, content=True):
|
||||||
out = list(output)[0][0]
|
out = list(output)[0][0]
|
||||||
if isinstance(out, str):
|
if isinstance(out, str):
|
||||||
out = utf8decode(out)
|
out = utf8decode(out)
|
||||||
return getUnicode(out)
|
return getUnicode(out, conf.dataEncoding)
|
||||||
else:
|
else:
|
||||||
return list(output)
|
return list(output)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -141,7 +141,7 @@ class Metasploit:
|
||||||
|
|
||||||
if not choice:
|
if not choice:
|
||||||
if lst:
|
if lst:
|
||||||
choice = getUnicode(default)
|
choice = getUnicode(default, conf.dataEncoding)
|
||||||
else:
|
else:
|
||||||
return default
|
return default
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,6 @@ import time
|
||||||
from lib.core.agent import agent
|
from lib.core.agent import agent
|
||||||
from lib.core.common import dataToStdout
|
from lib.core.common import dataToStdout
|
||||||
from lib.core.common import extractRegexResult
|
from lib.core.common import extractRegexResult
|
||||||
from lib.core.common import getUnicode
|
|
||||||
from lib.core.common import initTechnique
|
from lib.core.common import initTechnique
|
||||||
from lib.core.common import randomInt
|
from lib.core.common import randomInt
|
||||||
from lib.core.common import replaceNewlineTabs
|
from lib.core.common import replaceNewlineTabs
|
||||||
|
|
|
@ -111,7 +111,7 @@ class Google:
|
||||||
responseMsg = "HTTP response (%s - %d):\n" % (status, code)
|
responseMsg = "HTTP response (%s - %d):\n" % (status, code)
|
||||||
|
|
||||||
if conf.verbose <= 4:
|
if conf.verbose <= 4:
|
||||||
responseMsg += getUnicode(responseHeaders)
|
responseMsg += getUnicode(responseHeaders, conf.dataEncoding)
|
||||||
elif conf.verbose > 4:
|
elif conf.verbose > 4:
|
||||||
responseMsg += "%s\n%s\n" % (responseHeaders, page)
|
responseMsg += "%s\n%s\n" % (responseHeaders, page)
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,6 @@ from lib.core.agent import agent
|
||||||
from lib.core.common import formatDBMSfp
|
from lib.core.common import formatDBMSfp
|
||||||
from lib.core.common import formatFingerprint
|
from lib.core.common import formatFingerprint
|
||||||
from lib.core.common import getErrorParsedDBMSesFormatted
|
from lib.core.common import getErrorParsedDBMSesFormatted
|
||||||
from lib.core.common import getUnicode
|
|
||||||
from lib.core.common import randomInt
|
from lib.core.common import randomInt
|
||||||
from lib.core.common import randomRange
|
from lib.core.common import randomRange
|
||||||
from lib.core.data import conf
|
from lib.core.data import conf
|
||||||
|
|
Loading…
Reference in New Issue
Block a user