Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4335ae8

Browse files
committed
Patching previous commit
1 parent 94639d1 commit 4335ae8

4 files changed

Lines changed: 2 additions & 15 deletions

File tree

lib/core/agent.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
from lib.core.settings import CUSTOM_INJECTION_MARK_CHAR
3838
from lib.core.settings import DEFAULT_COOKIE_DELIMITER
3939
from lib.core.settings import DEFAULT_GET_POST_DELIMITER
40-
from lib.core.settings import DEFAULT_MYSQL_CHARACTER_SET
4140
from lib.core.settings import GENERIC_SQL_COMMENT
4241
from lib.core.settings import PAYLOAD_DELIMITER
4342
from lib.core.settings import REPLACEMENT_MARKER
@@ -401,10 +400,7 @@ def nullAndCastField(self, field):
401400
nulledCastedField = field
402401
else:
403402
if not (Backend.isDbms(DBMS.SQLITE) and not isDBMSVersionAtLeast('3')):
404-
if Backend.isDbms(DBMS.MYSQL):
405-
nulledCastedField = rootQuery.cast.query.replace(")", " CHARACTER SET %s)") % (field, DEFAULT_MYSQL_CHARACTER_SET)
406-
else:
407-
nulledCastedField = rootQuery.cast.query % field
403+
nulledCastedField = rootQuery.cast.query % field
408404
if Backend.getIdentifiedDbms() in (DBMS.ACCESS,):
409405
nulledCastedField = rootQuery.isnull.query % (nulledCastedField, nulledCastedField)
410406
else:

lib/core/settings.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,6 @@
224224

225225
HSQLDB_DEFAULT_SCHEMA = "PUBLIC"
226226

227-
# Default character set used in MySQL
228-
# Reference: http://pieroxy.net/blog/2013/05/28/mysql_charset_hell.html
229-
DEFAULT_MYSQL_CHARACTER_SET = "latin1"
230-
231227
# Names that can't be used to name files on Windows OS
232228
WINDOWS_RESERVED_NAMES = ("CON", "PRN", "AUX", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9")
233229

lib/techniques/blind/inference.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
from lib.core.enums import PAYLOAD
3838
from lib.core.exception import SqlmapThreadException
3939
from lib.core.settings import CHAR_INFERENCE_MARK
40-
from lib.core.settings import DEFAULT_MYSQL_CHARACTER_SET
4140
from lib.core.settings import INFERENCE_BLANK_BREAK
4241
from lib.core.settings import INFERENCE_UNKNOWN_CHAR
4342
from lib.core.settings import INFERENCE_GREATER_CHAR
@@ -593,9 +592,6 @@ def blindThread():
593592

594593
_ = finalValue or partialValue
595594

596-
if Backend.isDbms(DBMS.MYSQL) and safechardecode(_) != _:
597-
_ = getUnicode(safechardecode(_).encode(DEFAULT_MYSQL_CHARACTER_SET))
598-
599595
return getCounter(kb.technique), safecharencode(_) if kb.safeCharEncode else _
600596

601597
def queryOutputLength(expression, payload):

plugins/dbms/mysql/syntax.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import binascii
99

1010
from lib.core.convert import utf8encode
11-
from lib.core.settings import DEFAULT_MYSQL_CHARACTER_SET
1211
from plugins.generic.syntax import Syntax as GenericSyntax
1312

1413
class Syntax(GenericSyntax):
@@ -27,7 +26,7 @@ def escaper(value):
2726
try:
2827
retVal = "0x%s" % binascii.hexlify(value)
2928
except UnicodeEncodeError:
30-
retVal = "CONVERT(0x%s USING %s)" % ("".join("%.2x" % ord(_) for _ in utf8encode(value)), DEFAULT_MYSQL_CHARACTER_SET)
29+
retVal = "CONVERT(0x%s USING utf8)" % "".join("%.2x" % ord(_) for _ in utf8encode(value))
3130
return retVal
3231

3332
return Syntax._escape(expression, quote, escaper)

0 commit comments

Comments
 (0)