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

Skip to content

Commit f24187f

Browse files
committed
few fixes here and there
1 parent 7e78876 commit f24187f

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

lib/core/common.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,3 +1359,9 @@ def getCommonStart(strings=[]):
13591359
count += 1
13601360

13611361
return retVal
1362+
1363+
def getBruteUnicode(string):
1364+
retVal = unicode()
1365+
for char in string:
1366+
retVal += unichr(ord(char))
1367+
return retVal

plugins/dbms/mysql/connector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def connect(self):
5151
self.initConnection()
5252

5353
try:
54-
self.connector = MySQLdb.connect(host=self.hostname, user=self.user, passwd=self.password, db=self.db, port=self.port, connect_timeout=conf.timeout)
54+
self.connector = MySQLdb.connect(host=self.hostname, user=self.user, passwd=self.password, db=self.db, port=self.port, connect_timeout=conf.timeout, use_unicode=True)
5555
except MySQLdb.OperationalError, msg:
5656
raise sqlmapConnectionException, msg[1]
5757

plugins/generic/enumeration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ def getPrivileges(self, query2=False):
440440

441441
# In PostgreSQL we get 1 if the privilege is
442442
# True, 0 otherwise
443-
if kb.dbms == "PostgreSQL" and str(privilege).isdigit():
443+
if kb.dbms == "PostgreSQL" and unicode(privilege).isdigit():
444444
for position, pgsqlPriv in pgsqlPrivs:
445445
if count == position and int(privilege) == 1:
446446
privileges.add(pgsqlPriv)
@@ -1058,7 +1058,7 @@ def dumpTable(self):
10581058
else:
10591059
colEntry = entry[index]
10601060

1061-
colEntryLen = len(str(colEntry))
1061+
colEntryLen = len(unicode(colEntry))
10621062
maxLen = max(colLen, colEntryLen)
10631063

10641064
if maxLen > kb.data.dumpedTable[column]["length"]:

0 commit comments

Comments
 (0)