mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-07 21:21:33 +00:00
Stabilizing DREI
This commit is contained in:
@@ -5,7 +5,7 @@ Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'LICENSE' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.common import getOrds
|
||||
from lib.core.convert import getOrds
|
||||
from plugins.generic.syntax import Syntax as GenericSyntax
|
||||
|
||||
class Syntax(GenericSyntax):
|
||||
|
||||
@@ -5,7 +5,7 @@ Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'LICENSE' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.common import getOrds
|
||||
from lib.core.convert import getOrds
|
||||
from plugins.generic.syntax import Syntax as GenericSyntax
|
||||
|
||||
class Syntax(GenericSyntax):
|
||||
|
||||
@@ -5,8 +5,8 @@ Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'LICENSE' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.common import getOrds
|
||||
from lib.core.common import isDBMSVersionAtLeast
|
||||
from lib.core.convert import getOrds
|
||||
from plugins.generic.syntax import Syntax as GenericSyntax
|
||||
|
||||
class Syntax(GenericSyntax):
|
||||
|
||||
@@ -5,7 +5,7 @@ Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'LICENSE' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.common import getOrds
|
||||
from lib.core.convert import getOrds
|
||||
from plugins.generic.syntax import Syntax as GenericSyntax
|
||||
|
||||
class Syntax(GenericSyntax):
|
||||
|
||||
@@ -5,7 +5,7 @@ Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'LICENSE' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.common import getOrds
|
||||
from lib.core.convert import getOrds
|
||||
from plugins.generic.syntax import Syntax as GenericSyntax
|
||||
|
||||
class Syntax(GenericSyntax):
|
||||
|
||||
@@ -7,9 +7,9 @@ See the file 'LICENSE' for copying permission
|
||||
|
||||
import re
|
||||
|
||||
from lib.core.common import getOrds
|
||||
from lib.core.common import isDBMSVersionAtLeast
|
||||
from lib.core.common import randomStr
|
||||
from lib.core.convert import getOrds
|
||||
from plugins.generic.syntax import Syntax as GenericSyntax
|
||||
|
||||
class Syntax(GenericSyntax):
|
||||
|
||||
@@ -14,7 +14,7 @@ except:
|
||||
import logging
|
||||
|
||||
from lib.core.common import getSafeExString
|
||||
from lib.core.convert import utf8encode
|
||||
from lib.core.convert import getBytes
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import SqlmapConnectionException
|
||||
@@ -58,7 +58,7 @@ class Connector(GenericConnector):
|
||||
retVal = False
|
||||
|
||||
try:
|
||||
self.cursor.execute(utf8encode(query))
|
||||
self.cursor.execute(getBytes(query))
|
||||
retVal = True
|
||||
except (pymssql.OperationalError, pymssql.ProgrammingError) as ex:
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) '%s'" % getSafeExString(ex).replace("\n", " "))
|
||||
|
||||
@@ -15,8 +15,8 @@ from lib.core.common import posixToNtSlashes
|
||||
from lib.core.common import randomStr
|
||||
from lib.core.common import readInput
|
||||
from lib.core.compat import xrange
|
||||
from lib.core.convert import base64encode
|
||||
from lib.core.convert import hexencode
|
||||
from lib.core.convert import encodeBase64
|
||||
from lib.core.convert import encodeHex
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
from lib.core.enums import CHARSET_TYPE
|
||||
@@ -44,7 +44,7 @@ class Filesystem(GenericFilesystem):
|
||||
scrString = ""
|
||||
|
||||
for lineChar in fileContent[fileLine:fileLine + lineLen]:
|
||||
strLineChar = hexencode(lineChar, conf.encoding)
|
||||
strLineChar = encodeHex(lineChar, binary=False)
|
||||
|
||||
if not scrString:
|
||||
scrString = "e %x %s" % (lineAddr, strLineChar)
|
||||
@@ -170,7 +170,7 @@ class Filesystem(GenericFilesystem):
|
||||
infoMsg += "to file '%s'" % dFile
|
||||
logger.info(infoMsg)
|
||||
|
||||
encodedFileContent = base64encode(wFileContent)
|
||||
encodedFileContent = encodeBase64(wFileContent, binary=False)
|
||||
encodedBase64File = "tmpf%s.txt" % randomStr(lowercase=True)
|
||||
encodedBase64FilePath = "%s\\%s" % (tmpPath, encodedBase64File)
|
||||
|
||||
@@ -330,7 +330,7 @@ class Filesystem(GenericFilesystem):
|
||||
End Function""" % (randFilePath, dFile)
|
||||
|
||||
vbs = vbs.replace(" ", "")
|
||||
encodedFileContent = base64encode(wFileContent)
|
||||
encodedFileContent = encodeBase64(wFileContent, binary=False)
|
||||
|
||||
logger.debug("uploading the file base64-encoded content to %s, please wait.." % randFilePath)
|
||||
|
||||
@@ -359,7 +359,7 @@ class Filesystem(GenericFilesystem):
|
||||
randFile = "tmpf%s.txt" % randomStr(lowercase=True)
|
||||
randFilePath = "%s\\%s" % (tmpPath, randFile)
|
||||
|
||||
encodedFileContent = base64encode(wFileContent)
|
||||
encodedFileContent = encodeBase64(wFileContent, binary=False)
|
||||
|
||||
splittedEncodedFileContent = '\n'.join([encodedFileContent[i:i + chunkMaxSize] for i in xrange(0, len(encodedFileContent), chunkMaxSize)])
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'LICENSE' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.common import getOrds
|
||||
from plugins.generic.syntax import Syntax as GenericSyntax
|
||||
from lib.core.convert import getOrds
|
||||
|
||||
class Syntax(GenericSyntax):
|
||||
@staticmethod
|
||||
|
||||
@@ -8,8 +8,8 @@ See the file 'LICENSE' for copying permission
|
||||
import binascii
|
||||
|
||||
from lib.core.common import Backend
|
||||
from lib.core.common import getBytes
|
||||
from lib.core.compat import xrange
|
||||
from lib.core.convert import getBytes
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import SqlmapUnsupportedFeatureException
|
||||
from lib.request import inject
|
||||
|
||||
@@ -7,9 +7,9 @@ See the file 'LICENSE' for copying permission
|
||||
|
||||
import binascii
|
||||
|
||||
from lib.core.common import getBytes
|
||||
from lib.core.common import getOrds
|
||||
from lib.core.common import getUnicode
|
||||
from lib.core.convert import getBytes
|
||||
from lib.core.convert import getOrds
|
||||
from plugins.generic.syntax import Syntax as GenericSyntax
|
||||
|
||||
class Syntax(GenericSyntax):
|
||||
|
||||
@@ -15,7 +15,7 @@ import os
|
||||
import re
|
||||
|
||||
from lib.core.common import getSafeExString
|
||||
from lib.core.convert import utf8encode
|
||||
from lib.core.convert import getBytes
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import SqlmapConnectionException
|
||||
@@ -34,9 +34,9 @@ class Connector(GenericConnector):
|
||||
def connect(self):
|
||||
self.initConnection()
|
||||
self.__dsn = cx_Oracle.makedsn(self.hostname, self.port, self.db)
|
||||
self.__dsn = utf8encode(self.__dsn)
|
||||
self.user = utf8encode(self.user)
|
||||
self.password = utf8encode(self.password)
|
||||
self.__dsn = getBytes(self.__dsn)
|
||||
self.user = getBytes(self.user)
|
||||
self.password = getBytes(self.password)
|
||||
|
||||
try:
|
||||
self.connector = cx_Oracle.connect(dsn=self.__dsn, user=self.user, password=self.password, mode=cx_Oracle.SYSDBA)
|
||||
@@ -67,7 +67,7 @@ class Connector(GenericConnector):
|
||||
retVal = False
|
||||
|
||||
try:
|
||||
self.cursor.execute(utf8encode(query))
|
||||
self.cursor.execute(getBytes(query))
|
||||
retVal = True
|
||||
except cx_Oracle.DatabaseError as ex:
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) '%s'" % getSafeExString(ex))
|
||||
|
||||
@@ -5,7 +5,7 @@ Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'LICENSE' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.common import getOrds
|
||||
from lib.core.convert import getOrds
|
||||
from plugins.generic.syntax import Syntax as GenericSyntax
|
||||
|
||||
class Syntax(GenericSyntax):
|
||||
|
||||
@@ -5,7 +5,7 @@ Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'LICENSE' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.common import getOrds
|
||||
from lib.core.convert import getOrds
|
||||
from plugins.generic.syntax import Syntax as GenericSyntax
|
||||
|
||||
class Syntax(GenericSyntax):
|
||||
|
||||
@@ -13,7 +13,7 @@ except:
|
||||
import logging
|
||||
|
||||
from lib.core.common import getSafeExString
|
||||
from lib.core.convert import utf8encode
|
||||
from lib.core.convert import getBytes
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import SqlmapConnectionException
|
||||
@@ -75,7 +75,7 @@ class Connector(GenericConnector):
|
||||
|
||||
def execute(self, query):
|
||||
try:
|
||||
self.cursor.execute(utf8encode(query))
|
||||
self.cursor.execute(getBytes(query))
|
||||
except self.__sqlite.OperationalError as ex:
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) '%s'" % getSafeExString(ex))
|
||||
except self.__sqlite.DatabaseError as ex:
|
||||
|
||||
@@ -7,9 +7,9 @@ See the file 'LICENSE' for copying permission
|
||||
|
||||
import binascii
|
||||
|
||||
from lib.core.common import getBytes
|
||||
from lib.core.common import getUnicode
|
||||
from lib.core.common import isDBMSVersionAtLeast
|
||||
from lib.core.convert import getBytes
|
||||
from plugins.generic.syntax import Syntax as GenericSyntax
|
||||
|
||||
class Syntax(GenericSyntax):
|
||||
|
||||
@@ -14,7 +14,7 @@ except:
|
||||
import logging
|
||||
|
||||
from lib.core.common import getSafeExString
|
||||
from lib.core.convert import utf8encode
|
||||
from lib.core.convert import getBytes
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import logger
|
||||
from lib.core.exception import SqlmapConnectionException
|
||||
@@ -58,7 +58,7 @@ class Connector(GenericConnector):
|
||||
retVal = False
|
||||
|
||||
try:
|
||||
self.cursor.execute(utf8encode(query))
|
||||
self.cursor.execute(getBytes(query))
|
||||
retVal = True
|
||||
except (pymssql.OperationalError, pymssql.ProgrammingError) as ex:
|
||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) '%s'" % getSafeExString(ex).replace("\n", " "))
|
||||
|
||||
@@ -5,7 +5,7 @@ Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'LICENSE' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.common import getOrds
|
||||
from lib.core.convert import getOrds
|
||||
from plugins.generic.syntax import Syntax as GenericSyntax
|
||||
|
||||
class Syntax(GenericSyntax):
|
||||
|
||||
Reference in New Issue
Block a user