mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-07 13:11:29 +00:00
More drei stuff
This commit is contained in:
@@ -8,6 +8,7 @@ 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.data import logger
|
||||
from lib.core.exception import SqlmapUnsupportedFeatureException
|
||||
@@ -67,7 +68,7 @@ class Takeover(GenericTakeover):
|
||||
raise SqlmapUnsupportedFeatureException(errMsg)
|
||||
|
||||
shellcodeChar = ""
|
||||
hexStr = binascii.hexlify(self.shellcodeString[:-1])
|
||||
hexStr = binascii.hexlify(getBytes(self.shellcodeString[:-1]))
|
||||
|
||||
for hexPair in xrange(0, len(hexStr), 2):
|
||||
shellcodeChar += "CHAR(0x%s)+" % hexStr[hexPair:hexPair + 2]
|
||||
|
||||
@@ -7,7 +7,8 @@ See the file 'LICENSE' for copying permission
|
||||
|
||||
import binascii
|
||||
|
||||
from lib.core.convert import utf8encode
|
||||
from lib.core.common import getBytes
|
||||
from lib.core.common import getUnicode
|
||||
from plugins.generic.syntax import Syntax as GenericSyntax
|
||||
|
||||
class Syntax(GenericSyntax):
|
||||
@@ -19,11 +20,6 @@ class Syntax(GenericSyntax):
|
||||
"""
|
||||
|
||||
def escaper(value):
|
||||
retVal = None
|
||||
try:
|
||||
retVal = "0x%s" % binascii.hexlify(value)
|
||||
except UnicodeEncodeError:
|
||||
retVal = "CONVERT(0x%s USING utf8)" % "".join("%.2x" % ord(_) for _ in utf8encode(value))
|
||||
return retVal
|
||||
return "0x%s" % getUnicode(binascii.hexlify(getBytes(value)))
|
||||
|
||||
return Syntax._escape(expression, quote, escaper)
|
||||
|
||||
Reference in New Issue
Block a user