refactoring

This commit is contained in:
Miroslav Stampar
2011-01-30 11:36:03 +00:00
parent 3060c369a5
commit ddf23ba7cc
17 changed files with 87 additions and 42 deletions

View File

@@ -21,6 +21,7 @@ from lib.core.data import kb
from lib.core.data import logger
from lib.core.exception import sqlmapConnectionException
from lib.core.exception import sqlmapGenericException
from lib.core.settings import UNICODE_ENCODING
from lib.request.basic import decodePage
class Google:
@@ -111,7 +112,7 @@ class Google:
responseMsg = "HTTP response (%s - %d):\n" % (status, code)
if conf.verbose <= 4:
responseMsg += getUnicode(responseHeaders, conf.dataEncoding)
responseMsg += getUnicode(responseHeaders, UNICODE_ENCODING)
elif conf.verbose > 4:
responseMsg += "%s\n%s\n" % (responseHeaders, page)

View File

@@ -17,7 +17,6 @@ from zipfile import ZipFile
from extra.pydes.pyDes import des
from extra.pydes.pyDes import CBC
from lib.core.common import checkFile
from lib.core.common import conf
from lib.core.common import clearConsoleLine
from lib.core.common import dataToStdout
from lib.core.common import getCompiledRegex
@@ -36,6 +35,7 @@ from lib.core.enums import HASH
from lib.core.exception import sqlmapUserQuitException
from lib.core.settings import COMMON_PASSWORD_SUFFIXES
from lib.core.settings import DUMMY_USER_PREFIX
from lib.core.settings import UNICODE_ENCODING
def mysql_passwd(password, uppercase=True):
"""
@@ -151,7 +151,7 @@ def oracle_old_passwd(password, username, uppercase=True): # prior to version '1
IV, pad = "\0"*8, "\0"
if isinstance(username, unicode):
username = unicode.encode(username, conf.dataEncoding) #pyDes has issues with unicode strings
username = unicode.encode(username, UNICODE_ENCODING) #pyDes has issues with unicode strings
unistr = "".join("\0%s" % c for c in (username + password).upper())