Switching to the getSafeExString (where it can be used)

This commit is contained in:
Miroslav Stampar
2015-09-10 15:51:33 +02:00
parent 7a261ef447
commit f494004f44
15 changed files with 66 additions and 39 deletions

View File

@@ -17,6 +17,7 @@ import time
import urllib2
from lib.core.common import dataToStdout
from lib.core.common import getSafeExString
from lib.core.common import unArrayizeValue
from lib.core.convert import base64pickle
from lib.core.convert import hexencode
@@ -87,7 +88,7 @@ class Database(object):
else:
self.cursor.execute(statement)
except sqlite3.OperationalError, ex:
if not "locked" in ex.message:
if not "locked" in getSafeExString(ex):
raise
else:
break

View File

@@ -12,6 +12,7 @@ import socket
import urllib
import urllib2
from lib.core.common import getSafeExString
from lib.core.common import getUnicode
from lib.core.common import readInput
from lib.core.common import urlencode
@@ -50,7 +51,7 @@ class Google(object):
conn = self.opener.open("http://www.google.com/ncr")
conn.info() # retrieve session cookie
except Exception, ex:
errMsg = "unable to connect to Google ('%s')" % ex.message
errMsg = "unable to connect to Google ('%s')" % getSafeExString(ex)
raise SqlmapConnectionException(errMsg)
def search(self, dork):

View File

@@ -44,6 +44,7 @@ from lib.core.common import clearConsoleLine
from lib.core.common import dataToStdout
from lib.core.common import getFileItems
from lib.core.common import getPublicTypeMembers
from lib.core.common import getSafeExString
from lib.core.common import hashDBRetrieve
from lib.core.common import hashDBWrite
from lib.core.common import normalizeUnicode
@@ -771,7 +772,7 @@ def dictionaryAttack(attack_dict):
except Exception, ex:
warnMsg = "there was a problem while loading dictionaries"
warnMsg += " ('%s')" % ex.message
warnMsg += " ('%s')" % getSafeExString(ex)
logger.critical(warnMsg)
message = "do you want to use common password suffixes? (slow!) [y/N] "

View File

@@ -11,6 +11,7 @@ import sqlite3
import threading
import time
from lib.core.common import getSafeExString
from lib.core.common import getUnicode
from lib.core.common import serializeObject
from lib.core.common import unserializeObject
@@ -77,7 +78,7 @@ class HashDB(object):
for row in self.cursor.execute("SELECT value FROM storage WHERE id=?", (hash_,)):
retVal = row[0]
except sqlite3.OperationalError, ex:
if not "locked" in ex.message:
if not "locked" in getSafeExString(ex):
raise
except sqlite3.DatabaseError, ex:
errMsg = "error occurred while accessing session file '%s' ('%s'). " % (self.filepath, ex)
@@ -127,7 +128,7 @@ class HashDB(object):
if retries == 0:
warnMsg = "there has been a problem while writing to "
warnMsg += "the session file ('%s')" % ex.message
warnMsg += "the session file ('%s')" % getSafeExString(ex)
logger.warn(warnMsg)
if retries >= HASHDB_FLUSH_RETRIES: