mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-07-29 17:39:56 +03:00
Merge 1f5a8d4068
into 9e75bb7f68
This commit is contained in:
commit
ef139e661a
|
@ -59,7 +59,7 @@ def main():
|
||||||
if not args.inputFile:
|
if not args.inputFile:
|
||||||
parser.error('Missing the input file, -h for help')
|
parser.error('Missing the input file, -h for help')
|
||||||
|
|
||||||
except (OptionError, TypeError), e:
|
except (OptionError, TypeError) as e:
|
||||||
parser.error(e)
|
parser.error(e)
|
||||||
|
|
||||||
if not os.path.isfile(args.inputFile):
|
if not os.path.isfile(args.inputFile):
|
||||||
|
|
|
@ -86,7 +86,7 @@ if __name__ == "__main__":
|
||||||
if not args.inputFile:
|
if not args.inputFile:
|
||||||
parser.error("Missing the input file, -h for help")
|
parser.error("Missing the input file, -h for help")
|
||||||
|
|
||||||
except (OptionError, TypeError), e:
|
except (OptionError, TypeError) as e:
|
||||||
parser.error(e)
|
parser.error(e)
|
||||||
|
|
||||||
inputFile = args.inputFile
|
inputFile = args.inputFile
|
||||||
|
|
|
@ -108,7 +108,7 @@ def main():
|
||||||
if not args.inputFile:
|
if not args.inputFile:
|
||||||
parser.error('Missing the input file, -h for help')
|
parser.error('Missing the input file, -h for help')
|
||||||
|
|
||||||
except (OptionError, TypeError), e:
|
except (OptionError, TypeError) as e:
|
||||||
parser.error(e)
|
parser.error(e)
|
||||||
|
|
||||||
if not os.path.isfile(args.inputFile):
|
if not os.path.isfile(args.inputFile):
|
||||||
|
|
|
@ -56,7 +56,7 @@ def send_email(msg):
|
||||||
s.sendmail(FROM, TO, msg.as_string())
|
s.sendmail(FROM, TO, msg.as_string())
|
||||||
s.quit()
|
s.quit()
|
||||||
# Catch all for SMTP exceptions
|
# Catch all for SMTP exceptions
|
||||||
except smtplib.SMTPException, e:
|
except smtplib.SMTPException as e:
|
||||||
print "Failure to send email: %s" % str(e)
|
print "Failure to send email: %s" % str(e)
|
||||||
|
|
||||||
def failure_email(msg):
|
def failure_email(msg):
|
||||||
|
@ -157,7 +157,7 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
try:
|
try:
|
||||||
main()
|
main()
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
log_fd.write("An exception has occurred:\n%s" % str(traceback.format_exc()))
|
log_fd.write("An exception has occurred:\n%s" % str(traceback.format_exc()))
|
||||||
|
|
||||||
log_fd.write("Regression test finished at %s\n\n" % time.strftime("%H:%M:%S %d-%m-%Y", time.gmtime()))
|
log_fd.write("Regression test finished at %s\n\n" % time.strftime("%H:%M:%S %d-%m-%Y", time.gmtime()))
|
||||||
|
|
|
@ -75,7 +75,7 @@ def main():
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
except Exception, msg:
|
except Exception as msg:
|
||||||
print msg
|
print msg
|
||||||
|
|
||||||
if abort:
|
if abort:
|
||||||
|
@ -118,7 +118,7 @@ def main():
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
except Exception, msg:
|
except Exception as msg:
|
||||||
print msg
|
print msg
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -75,7 +75,7 @@ def action():
|
||||||
if conf.getPasswordHashes:
|
if conf.getPasswordHashes:
|
||||||
try:
|
try:
|
||||||
conf.dumper.userSettings("database management system users password hashes", conf.dbmsHandler.getPasswordHashes(), "password hash", CONTENT_TYPE.PASSWORDS)
|
conf.dumper.userSettings("database management system users password hashes", conf.dbmsHandler.getPasswordHashes(), "password hash", CONTENT_TYPE.PASSWORDS)
|
||||||
except SqlmapNoneDataException, ex:
|
except SqlmapNoneDataException as ex:
|
||||||
logger.critical(ex)
|
logger.critical(ex)
|
||||||
except:
|
except:
|
||||||
raise
|
raise
|
||||||
|
@ -83,7 +83,7 @@ def action():
|
||||||
if conf.getPrivileges:
|
if conf.getPrivileges:
|
||||||
try:
|
try:
|
||||||
conf.dumper.userSettings("database management system users privileges", conf.dbmsHandler.getPrivileges(), "privilege", CONTENT_TYPE.PRIVILEGES)
|
conf.dumper.userSettings("database management system users privileges", conf.dbmsHandler.getPrivileges(), "privilege", CONTENT_TYPE.PRIVILEGES)
|
||||||
except SqlmapNoneDataException, ex:
|
except SqlmapNoneDataException as ex:
|
||||||
logger.critical(ex)
|
logger.critical(ex)
|
||||||
except:
|
except:
|
||||||
raise
|
raise
|
||||||
|
@ -91,7 +91,7 @@ def action():
|
||||||
if conf.getRoles:
|
if conf.getRoles:
|
||||||
try:
|
try:
|
||||||
conf.dumper.userSettings("database management system users roles", conf.dbmsHandler.getRoles(), "role", CONTENT_TYPE.ROLES)
|
conf.dumper.userSettings("database management system users roles", conf.dbmsHandler.getRoles(), "role", CONTENT_TYPE.ROLES)
|
||||||
except SqlmapNoneDataException, ex:
|
except SqlmapNoneDataException as ex:
|
||||||
logger.critical(ex)
|
logger.critical(ex)
|
||||||
except:
|
except:
|
||||||
raise
|
raise
|
||||||
|
|
|
@ -602,7 +602,7 @@ def checkSqlInjection(place, parameter, value):
|
||||||
|
|
||||||
injectable = True
|
injectable = True
|
||||||
|
|
||||||
except SqlmapConnectionException, msg:
|
except SqlmapConnectionException as msg:
|
||||||
debugMsg = "problem occurred most likely because the "
|
debugMsg = "problem occurred most likely because the "
|
||||||
debugMsg += "server hasn't recovered as expected from the "
|
debugMsg += "server hasn't recovered as expected from the "
|
||||||
debugMsg += "error-based payload used ('%s')" % msg
|
debugMsg += "error-based payload used ('%s')" % msg
|
||||||
|
@ -1405,7 +1405,7 @@ def identifyWaf():
|
||||||
try:
|
try:
|
||||||
logger.debug("checking for WAF/IPS/IDS product '%s'" % product)
|
logger.debug("checking for WAF/IPS/IDS product '%s'" % product)
|
||||||
found = function(_)
|
found = function(_)
|
||||||
except Exception, ex:
|
except Exception as ex:
|
||||||
errMsg = "exception occurred while running "
|
errMsg = "exception occurred while running "
|
||||||
errMsg += "WAF script for '%s' ('%s')" % (product, getSafeExString(ex))
|
errMsg += "WAF script for '%s' ('%s')" % (product, getSafeExString(ex))
|
||||||
logger.critical(errMsg)
|
logger.critical(errMsg)
|
||||||
|
@ -1506,7 +1506,7 @@ def checkConnection(suppressOutput=False):
|
||||||
except socket.gaierror:
|
except socket.gaierror:
|
||||||
errMsg = "host '%s' does not exist" % conf.hostname
|
errMsg = "host '%s' does not exist" % conf.hostname
|
||||||
raise SqlmapConnectionException(errMsg)
|
raise SqlmapConnectionException(errMsg)
|
||||||
except socket.error, ex:
|
except socket.error as ex:
|
||||||
errMsg = "problem occurred while "
|
errMsg = "problem occurred while "
|
||||||
errMsg += "resolving a host name '%s' ('%s')" % (conf.hostname, getSafeExString(ex))
|
errMsg += "resolving a host name '%s' ('%s')" % (conf.hostname, getSafeExString(ex))
|
||||||
raise SqlmapConnectionException(errMsg)
|
raise SqlmapConnectionException(errMsg)
|
||||||
|
@ -1537,7 +1537,7 @@ def checkConnection(suppressOutput=False):
|
||||||
else:
|
else:
|
||||||
kb.errorIsNone = True
|
kb.errorIsNone = True
|
||||||
|
|
||||||
except SqlmapConnectionException, ex:
|
except SqlmapConnectionException as ex:
|
||||||
if conf.ipv6:
|
if conf.ipv6:
|
||||||
warnMsg = "check connection to a provided "
|
warnMsg = "check connection to a provided "
|
||||||
warnMsg += "IPv6 address with a tool like ping6 "
|
warnMsg += "IPv6 address with a tool like ping6 "
|
||||||
|
|
|
@ -672,7 +672,7 @@ def start():
|
||||||
except SqlmapSilentQuitException:
|
except SqlmapSilentQuitException:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
except SqlmapBaseException, ex:
|
except SqlmapBaseException as ex:
|
||||||
errMsg = getSafeExString(ex)
|
errMsg = getSafeExString(ex)
|
||||||
|
|
||||||
if conf.multipleTargets:
|
if conf.multipleTargets:
|
||||||
|
|
|
@ -87,7 +87,7 @@ class BigArray(list):
|
||||||
try:
|
try:
|
||||||
with open(self.chunks[-1], "rb") as f:
|
with open(self.chunks[-1], "rb") as f:
|
||||||
self.chunks[-1] = pickle.loads(bz2.decompress(f.read()))
|
self.chunks[-1] = pickle.loads(bz2.decompress(f.read()))
|
||||||
except IOError, ex:
|
except IOError as ex:
|
||||||
errMsg = "exception occurred while retrieving data "
|
errMsg = "exception occurred while retrieving data "
|
||||||
errMsg += "from a temporary file ('%s')" % ex.message
|
errMsg += "from a temporary file ('%s')" % ex.message
|
||||||
raise SqlmapSystemException, errMsg
|
raise SqlmapSystemException, errMsg
|
||||||
|
@ -109,7 +109,7 @@ class BigArray(list):
|
||||||
with open(filename, "w+b") as f:
|
with open(filename, "w+b") as f:
|
||||||
f.write(bz2.compress(pickle.dumps(chunk, pickle.HIGHEST_PROTOCOL), BIGARRAY_COMPRESS_LEVEL))
|
f.write(bz2.compress(pickle.dumps(chunk, pickle.HIGHEST_PROTOCOL), BIGARRAY_COMPRESS_LEVEL))
|
||||||
return filename
|
return filename
|
||||||
except (OSError, IOError), ex:
|
except (OSError, IOError) as ex:
|
||||||
errMsg = "exception occurred while storing data "
|
errMsg = "exception occurred while storing data "
|
||||||
errMsg += "to a temporary file ('%s'). Please " % ex.message
|
errMsg += "to a temporary file ('%s'). Please " % ex.message
|
||||||
errMsg += "make sure that there is enough disk space left. If problem persists, "
|
errMsg += "make sure that there is enough disk space left. If problem persists, "
|
||||||
|
@ -126,7 +126,7 @@ class BigArray(list):
|
||||||
try:
|
try:
|
||||||
with open(self.chunks[index], "rb") as f:
|
with open(self.chunks[index], "rb") as f:
|
||||||
self.cache = Cache(index, pickle.loads(bz2.decompress(f.read())), False)
|
self.cache = Cache(index, pickle.loads(bz2.decompress(f.read())), False)
|
||||||
except IOError, ex:
|
except IOError as ex:
|
||||||
errMsg = "exception occurred while retrieving data "
|
errMsg = "exception occurred while retrieving data "
|
||||||
errMsg += "from a temporary file ('%s')" % ex.message
|
errMsg += "from a temporary file ('%s')" % ex.message
|
||||||
raise SqlmapSystemException, errMsg
|
raise SqlmapSystemException, errMsg
|
||||||
|
|
|
@ -924,7 +924,7 @@ def dataToTrafficFile(data):
|
||||||
try:
|
try:
|
||||||
conf.trafficFP.write(data)
|
conf.trafficFP.write(data)
|
||||||
conf.trafficFP.flush()
|
conf.trafficFP.flush()
|
||||||
except IOError, ex:
|
except IOError as ex:
|
||||||
errMsg = "something went wrong while trying "
|
errMsg = "something went wrong while trying "
|
||||||
errMsg += "to write to the traffic file '%s' ('%s')" % (conf.trafficFile, getSafeExString(ex))
|
errMsg += "to write to the traffic file '%s' ('%s')" % (conf.trafficFile, getSafeExString(ex))
|
||||||
raise SqlmapSystemException(errMsg)
|
raise SqlmapSystemException(errMsg)
|
||||||
|
@ -933,7 +933,7 @@ def dataToDumpFile(dumpFile, data):
|
||||||
try:
|
try:
|
||||||
dumpFile.write(data)
|
dumpFile.write(data)
|
||||||
dumpFile.flush()
|
dumpFile.flush()
|
||||||
except IOError, ex:
|
except IOError as ex:
|
||||||
if "No space left" in getUnicode(ex):
|
if "No space left" in getUnicode(ex):
|
||||||
errMsg = "no space left on output device"
|
errMsg = "no space left on output device"
|
||||||
logger.error(errMsg)
|
logger.error(errMsg)
|
||||||
|
@ -953,7 +953,7 @@ def dataToOutFile(filename, data):
|
||||||
try:
|
try:
|
||||||
with open(retVal, "w+b") as f: # has to stay as non-codecs because data is raw ASCII encoded data
|
with open(retVal, "w+b") as f: # has to stay as non-codecs because data is raw ASCII encoded data
|
||||||
f.write(unicodeencode(data))
|
f.write(unicodeencode(data))
|
||||||
except UnicodeEncodeError, ex:
|
except UnicodeEncodeError as ex:
|
||||||
_ = normalizeUnicode(filename)
|
_ = normalizeUnicode(filename)
|
||||||
if filename != _:
|
if filename != _:
|
||||||
filename = _
|
filename = _
|
||||||
|
@ -961,7 +961,7 @@ def dataToOutFile(filename, data):
|
||||||
errMsg = "couldn't write to the "
|
errMsg = "couldn't write to the "
|
||||||
errMsg += "output file ('%s')" % getSafeExString(ex)
|
errMsg += "output file ('%s')" % getSafeExString(ex)
|
||||||
raise SqlmapGenericException(errMsg)
|
raise SqlmapGenericException(errMsg)
|
||||||
except IOError, ex:
|
except IOError as ex:
|
||||||
errMsg = "something went wrong while trying to write "
|
errMsg = "something went wrong while trying to write "
|
||||||
errMsg += "to the output file ('%s')" % getSafeExString(ex)
|
errMsg += "to the output file ('%s')" % getSafeExString(ex)
|
||||||
raise SqlmapGenericException(errMsg)
|
raise SqlmapGenericException(errMsg)
|
||||||
|
@ -1410,7 +1410,7 @@ def parseTargetUrl():
|
||||||
|
|
||||||
try:
|
try:
|
||||||
urlSplit = urlparse.urlsplit(conf.url)
|
urlSplit = urlparse.urlsplit(conf.url)
|
||||||
except ValueError, ex:
|
except ValueError as ex:
|
||||||
errMsg = "invalid URL '%s' has been given ('%s'). " % (conf.url, getSafeExString(ex))
|
errMsg = "invalid URL '%s' has been given ('%s'). " % (conf.url, getSafeExString(ex))
|
||||||
errMsg += "Please be sure that you don't have any leftover characters (e.g. '[' or ']') "
|
errMsg += "Please be sure that you don't have any leftover characters (e.g. '[' or ']') "
|
||||||
errMsg += "in the hostname part"
|
errMsg += "in the hostname part"
|
||||||
|
@ -1982,7 +1982,7 @@ def parseXmlFile(xmlFile, handler):
|
||||||
try:
|
try:
|
||||||
with contextlib.closing(StringIO(readCachedFileContent(xmlFile))) as stream:
|
with contextlib.closing(StringIO(readCachedFileContent(xmlFile))) as stream:
|
||||||
parse(stream, handler)
|
parse(stream, handler)
|
||||||
except (SAXParseException, UnicodeError), ex:
|
except (SAXParseException, UnicodeError) as ex:
|
||||||
errMsg = "something appears to be wrong with "
|
errMsg = "something appears to be wrong with "
|
||||||
errMsg += "the file '%s' ('%s'). Please make " % (xmlFile, getSafeExString(ex))
|
errMsg += "the file '%s' ('%s'). Please make " % (xmlFile, getSafeExString(ex))
|
||||||
errMsg += "sure that you haven't made any changes to it"
|
errMsg += "sure that you haven't made any changes to it"
|
||||||
|
@ -2042,7 +2042,7 @@ def readCachedFileContent(filename, mode='rb'):
|
||||||
try:
|
try:
|
||||||
with openFile(filename, mode) as f:
|
with openFile(filename, mode) as f:
|
||||||
kb.cache.content[filename] = f.read()
|
kb.cache.content[filename] = f.read()
|
||||||
except (IOError, OSError, MemoryError), ex:
|
except (IOError, OSError, MemoryError) as ex:
|
||||||
errMsg = "something went wrong while trying "
|
errMsg = "something went wrong while trying "
|
||||||
errMsg += "to read the content of file '%s' ('%s')" % (filename, getSafeExString(ex))
|
errMsg += "to read the content of file '%s' ('%s')" % (filename, getSafeExString(ex))
|
||||||
raise SqlmapSystemException(errMsg)
|
raise SqlmapSystemException(errMsg)
|
||||||
|
@ -2156,7 +2156,7 @@ def getFileItems(filename, commentPrefix='#', unicode_=True, lowercase=False, un
|
||||||
retVal[line] = True
|
retVal[line] = True
|
||||||
else:
|
else:
|
||||||
retVal.append(line)
|
retVal.append(line)
|
||||||
except (IOError, OSError, MemoryError), ex:
|
except (IOError, OSError, MemoryError) as ex:
|
||||||
errMsg = "something went wrong while trying "
|
errMsg = "something went wrong while trying "
|
||||||
errMsg += "to read the content of file '%s' ('%s')" % (filename, getSafeExString(ex))
|
errMsg += "to read the content of file '%s' ('%s')" % (filename, getSafeExString(ex))
|
||||||
raise SqlmapSystemException(errMsg)
|
raise SqlmapSystemException(errMsg)
|
||||||
|
@ -2289,7 +2289,7 @@ def getUnicode(value, encoding=None, noneToNull=False):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
return unicode(value, encoding or (kb.get("pageEncoding") if kb.get("originalPage") else None) or UNICODE_ENCODING)
|
return unicode(value, encoding or (kb.get("pageEncoding") if kb.get("originalPage") else None) or UNICODE_ENCODING)
|
||||||
except UnicodeDecodeError, ex:
|
except UnicodeDecodeError as ex:
|
||||||
try:
|
try:
|
||||||
return unicode(value, UNICODE_ENCODING)
|
return unicode(value, UNICODE_ENCODING)
|
||||||
except:
|
except:
|
||||||
|
@ -2345,7 +2345,7 @@ def pushValue(value):
|
||||||
getCurrentThreadData().valueStack.append(copy.deepcopy(value))
|
getCurrentThreadData().valueStack.append(copy.deepcopy(value))
|
||||||
success = True
|
success = True
|
||||||
break
|
break
|
||||||
except Exception, ex:
|
except Exception as ex:
|
||||||
_ = ex
|
_ = ex
|
||||||
|
|
||||||
if not success:
|
if not success:
|
||||||
|
@ -3033,7 +3033,7 @@ def saveConfig(conf, filename):
|
||||||
with openFile(filename, "wb") as f:
|
with openFile(filename, "wb") as f:
|
||||||
try:
|
try:
|
||||||
config.write(f)
|
config.write(f)
|
||||||
except IOError, ex:
|
except IOError as ex:
|
||||||
errMsg = "something went wrong while trying "
|
errMsg = "something went wrong while trying "
|
||||||
errMsg += "to write to the configuration file '%s' ('%s')" % (filename, getSafeExString(ex))
|
errMsg += "to write to the configuration file '%s' ('%s')" % (filename, getSafeExString(ex))
|
||||||
raise SqlmapSystemException(errMsg)
|
raise SqlmapSystemException(errMsg)
|
||||||
|
@ -3361,7 +3361,7 @@ def createGithubIssue(errMsg, excMsg):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
content = urllib2.urlopen(req).read()
|
content = urllib2.urlopen(req).read()
|
||||||
except Exception, ex:
|
except Exception as ex:
|
||||||
content = None
|
content = None
|
||||||
|
|
||||||
issueUrl = re.search(r"https://github.com/sqlmapproject/sqlmap/issues/\d+", content or "")
|
issueUrl = re.search(r"https://github.com/sqlmapproject/sqlmap/issues/\d+", content or "")
|
||||||
|
@ -3971,7 +3971,7 @@ def findPageForms(content, url, raise_=False, addToTargets=False):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
request = form.click()
|
request = form.click()
|
||||||
except (ValueError, TypeError), ex:
|
except (ValueError, TypeError) as ex:
|
||||||
errMsg = "there has been a problem while "
|
errMsg = "there has been a problem while "
|
||||||
errMsg += "processing page forms ('%s')" % getSafeExString(ex)
|
errMsg += "processing page forms ('%s')" % getSafeExString(ex)
|
||||||
if raise_:
|
if raise_:
|
||||||
|
@ -4092,7 +4092,7 @@ def evaluateCode(code, variables=None):
|
||||||
exec(code, variables)
|
exec(code, variables)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
raise
|
raise
|
||||||
except Exception, ex:
|
except Exception as ex:
|
||||||
errMsg = "an error occurred while evaluating provided code ('%s') " % getSafeExString(ex)
|
errMsg = "an error occurred while evaluating provided code ('%s') " % getSafeExString(ex)
|
||||||
raise SqlmapGenericException(errMsg)
|
raise SqlmapGenericException(errMsg)
|
||||||
|
|
||||||
|
@ -4299,7 +4299,7 @@ def resetCookieJar(cookieJar):
|
||||||
errMsg = "no valid cookies found"
|
errMsg = "no valid cookies found"
|
||||||
raise SqlmapGenericException(errMsg)
|
raise SqlmapGenericException(errMsg)
|
||||||
|
|
||||||
except cookielib.LoadError, msg:
|
except cookielib.LoadError as msg:
|
||||||
errMsg = "there was a problem loading "
|
errMsg = "there was a problem loading "
|
||||||
errMsg += "cookies file ('%s')" % re.sub(r"(cookies) file '[^']+'", "\g<1>", str(msg))
|
errMsg += "cookies file ('%s')" % re.sub(r"(cookies) file '[^']+'", "\g<1>", str(msg))
|
||||||
raise SqlmapGenericException(errMsg)
|
raise SqlmapGenericException(errMsg)
|
||||||
|
|
|
@ -77,7 +77,7 @@ class Dump(object):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self._outputFP.write(text)
|
self._outputFP.write(text)
|
||||||
except IOError, ex:
|
except IOError as ex:
|
||||||
errMsg = "error occurred while writing to log file ('%s')" % getSafeExString(ex)
|
errMsg = "error occurred while writing to log file ('%s')" % getSafeExString(ex)
|
||||||
raise SqlmapGenericException(errMsg)
|
raise SqlmapGenericException(errMsg)
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ class Dump(object):
|
||||||
self._outputFile = os.path.join(conf.outputPath, "log")
|
self._outputFile = os.path.join(conf.outputPath, "log")
|
||||||
try:
|
try:
|
||||||
self._outputFP = openFile(self._outputFile, "ab" if not conf.flushSession else "wb")
|
self._outputFP = openFile(self._outputFile, "ab" if not conf.flushSession else "wb")
|
||||||
except IOError, ex:
|
except IOError as ex:
|
||||||
errMsg = "error occurred while opening log file ('%s')" % getSafeExString(ex)
|
errMsg = "error occurred while opening log file ('%s')" % getSafeExString(ex)
|
||||||
raise SqlmapGenericException(errMsg)
|
raise SqlmapGenericException(errMsg)
|
||||||
|
|
||||||
|
@ -424,10 +424,10 @@ class Dump(object):
|
||||||
if not os.path.isdir(dumpDbPath):
|
if not os.path.isdir(dumpDbPath):
|
||||||
try:
|
try:
|
||||||
os.makedirs(dumpDbPath, 0755)
|
os.makedirs(dumpDbPath, 0755)
|
||||||
except Exception, ex:
|
except Exception as ex:
|
||||||
try:
|
try:
|
||||||
tempDir = tempfile.mkdtemp(prefix="sqlmapdb")
|
tempDir = tempfile.mkdtemp(prefix="sqlmapdb")
|
||||||
except IOError, _:
|
except IOError as _:
|
||||||
errMsg = "unable to write to the temporary directory ('%s'). " % _
|
errMsg = "unable to write to the temporary directory ('%s'). " % _
|
||||||
errMsg += "Please make sure that your disk is not full and "
|
errMsg += "Please make sure that your disk is not full and "
|
||||||
errMsg += "that you have sufficient write permissions to "
|
errMsg += "that you have sufficient write permissions to "
|
||||||
|
@ -621,7 +621,7 @@ class Dump(object):
|
||||||
with open(filepath, "wb") as f:
|
with open(filepath, "wb") as f:
|
||||||
_ = safechardecode(value, True)
|
_ = safechardecode(value, True)
|
||||||
f.write(_)
|
f.write(_)
|
||||||
except magic.MagicException, err:
|
except magic.MagicException as err:
|
||||||
logger.debug(str(err))
|
logger.debug(str(err))
|
||||||
|
|
||||||
if conf.dumpFormat == DUMP_FORMAT.CSV:
|
if conf.dumpFormat == DUMP_FORMAT.CSV:
|
||||||
|
|
|
@ -353,7 +353,7 @@ def _feedTargetsDict(reqFile, addedTargetUrls):
|
||||||
try:
|
try:
|
||||||
with openFile(reqFile, "rb") as f:
|
with openFile(reqFile, "rb") as f:
|
||||||
content = f.read()
|
content = f.read()
|
||||||
except (IOError, OSError, MemoryError), ex:
|
except (IOError, OSError, MemoryError) as ex:
|
||||||
errMsg = "something went wrong while trying "
|
errMsg = "something went wrong while trying "
|
||||||
errMsg += "to read the content of file '%s' ('%s')" % (reqFile, getSafeExString(ex))
|
errMsg += "to read the content of file '%s' ('%s')" % (reqFile, getSafeExString(ex))
|
||||||
raise SqlmapSystemException(errMsg)
|
raise SqlmapSystemException(errMsg)
|
||||||
|
@ -398,7 +398,7 @@ def _loadQueries():
|
||||||
tree = ElementTree()
|
tree = ElementTree()
|
||||||
try:
|
try:
|
||||||
tree.parse(paths.QUERIES_XML)
|
tree.parse(paths.QUERIES_XML)
|
||||||
except Exception, ex:
|
except Exception as ex:
|
||||||
errMsg = "something appears to be wrong with "
|
errMsg = "something appears to be wrong with "
|
||||||
errMsg += "the file '%s' ('%s'). Please make " % (paths.QUERIES_XML, getSafeExString(ex))
|
errMsg += "the file '%s' ('%s'). Please make " % (paths.QUERIES_XML, getSafeExString(ex))
|
||||||
errMsg += "sure that you haven't made any changes to it"
|
errMsg += "sure that you haven't made any changes to it"
|
||||||
|
@ -514,7 +514,7 @@ def _setCrawler():
|
||||||
if conf.verbose in (1, 2):
|
if conf.verbose in (1, 2):
|
||||||
status = "%d/%d links visited (%d%%)" % (i + 1, len(targets), round(100.0 * (i + 1) / len(targets)))
|
status = "%d/%d links visited (%d%%)" % (i + 1, len(targets), round(100.0 * (i + 1) / len(targets)))
|
||||||
dataToStdout("\r[%s] [INFO] %s" % (time.strftime("%X"), status), True)
|
dataToStdout("\r[%s] [INFO] %s" % (time.strftime("%X"), status), True)
|
||||||
except Exception, ex:
|
except Exception as ex:
|
||||||
errMsg = "problem occurred while crawling at '%s' ('%s')" % (target, getSafeExString(ex))
|
errMsg = "problem occurred while crawling at '%s' ('%s')" % (target, getSafeExString(ex))
|
||||||
logger.error(errMsg)
|
logger.error(errMsg)
|
||||||
|
|
||||||
|
@ -650,7 +650,7 @@ def _findPageForms():
|
||||||
dataToStdout("\r[%s] [INFO] %s" % (time.strftime("%X"), status), True)
|
dataToStdout("\r[%s] [INFO] %s" % (time.strftime("%X"), status), True)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
break
|
break
|
||||||
except Exception, ex:
|
except Exception as ex:
|
||||||
errMsg = "problem occurred while searching for forms at '%s' ('%s')" % (target, getSafeExString(ex))
|
errMsg = "problem occurred while searching for forms at '%s' ('%s')" % (target, getSafeExString(ex))
|
||||||
logger.error(errMsg)
|
logger.error(errMsg)
|
||||||
|
|
||||||
|
@ -931,7 +931,7 @@ def _setTamperingFunctions():
|
||||||
|
|
||||||
try:
|
try:
|
||||||
module = __import__(filename[:-3].encode(sys.getfilesystemencoding() or UNICODE_ENCODING))
|
module = __import__(filename[:-3].encode(sys.getfilesystemencoding() or UNICODE_ENCODING))
|
||||||
except (ImportError, SyntaxError), ex:
|
except (ImportError, SyntaxError) as ex:
|
||||||
raise SqlmapSyntaxException("cannot import tamper script '%s' (%s)" % (filename[:-3], getSafeExString(ex)))
|
raise SqlmapSyntaxException("cannot import tamper script '%s' (%s)" % (filename[:-3], getSafeExString(ex)))
|
||||||
|
|
||||||
priority = PRIORITY.NORMAL if not hasattr(module, "__priority__") else module.__priority__
|
priority = PRIORITY.NORMAL if not hasattr(module, "__priority__") else module.__priority__
|
||||||
|
@ -1004,7 +1004,7 @@ def _setWafFunctions():
|
||||||
if filename[:-3] in sys.modules:
|
if filename[:-3] in sys.modules:
|
||||||
del sys.modules[filename[:-3]]
|
del sys.modules[filename[:-3]]
|
||||||
module = __import__(filename[:-3].encode(sys.getfilesystemencoding() or UNICODE_ENCODING))
|
module = __import__(filename[:-3].encode(sys.getfilesystemencoding() or UNICODE_ENCODING))
|
||||||
except ImportError, msg:
|
except ImportError as msg:
|
||||||
raise SqlmapSyntaxException("cannot import WAF script '%s' (%s)" % (filename[:-3], msg))
|
raise SqlmapSyntaxException("cannot import WAF script '%s' (%s)" % (filename[:-3], msg))
|
||||||
|
|
||||||
_ = dict(inspect.getmembers(module))
|
_ = dict(inspect.getmembers(module))
|
||||||
|
@ -1126,7 +1126,7 @@ def _setHTTPHandlers():
|
||||||
|
|
||||||
try:
|
try:
|
||||||
_ = urlparse.urlsplit(conf.proxy)
|
_ = urlparse.urlsplit(conf.proxy)
|
||||||
except Exception, ex:
|
except Exception as ex:
|
||||||
errMsg = "invalid proxy address '%s' ('%s')" % (conf.proxy, getSafeExString(ex))
|
errMsg = "invalid proxy address '%s' ('%s')" % (conf.proxy, getSafeExString(ex))
|
||||||
raise SqlmapSyntaxException, errMsg
|
raise SqlmapSyntaxException, errMsg
|
||||||
|
|
||||||
|
@ -1577,7 +1577,7 @@ def _createTemporaryDirectory():
|
||||||
|
|
||||||
warnMsg = "using '%s' as the temporary directory" % conf.tmpDir
|
warnMsg = "using '%s' as the temporary directory" % conf.tmpDir
|
||||||
logger.warn(warnMsg)
|
logger.warn(warnMsg)
|
||||||
except (OSError, IOError), ex:
|
except (OSError, IOError) as ex:
|
||||||
errMsg = "there has been a problem while accessing "
|
errMsg = "there has been a problem while accessing "
|
||||||
errMsg += "temporary directory location(s) ('%s')" % getSafeExString(ex)
|
errMsg += "temporary directory location(s) ('%s')" % getSafeExString(ex)
|
||||||
raise SqlmapSystemException, errMsg
|
raise SqlmapSystemException, errMsg
|
||||||
|
@ -1585,7 +1585,7 @@ def _createTemporaryDirectory():
|
||||||
try:
|
try:
|
||||||
if not os.path.isdir(tempfile.gettempdir()):
|
if not os.path.isdir(tempfile.gettempdir()):
|
||||||
os.makedirs(tempfile.gettempdir())
|
os.makedirs(tempfile.gettempdir())
|
||||||
except (OSError, IOError, WindowsError), ex:
|
except (OSError, IOError, WindowsError) as ex:
|
||||||
warnMsg = "there has been a problem while accessing "
|
warnMsg = "there has been a problem while accessing "
|
||||||
warnMsg += "system's temporary directory location(s) ('%s'). Please " % getSafeExString(ex)
|
warnMsg += "system's temporary directory location(s) ('%s'). Please " % getSafeExString(ex)
|
||||||
warnMsg += "make sure that there is enough disk space left. If problem persists, "
|
warnMsg += "make sure that there is enough disk space left. If problem persists, "
|
||||||
|
@ -1604,7 +1604,7 @@ def _createTemporaryDirectory():
|
||||||
if not os.path.isdir(tempfile.tempdir):
|
if not os.path.isdir(tempfile.tempdir):
|
||||||
try:
|
try:
|
||||||
os.makedirs(tempfile.tempdir)
|
os.makedirs(tempfile.tempdir)
|
||||||
except (OSError, IOError, WindowsError), ex:
|
except (OSError, IOError, WindowsError) as ex:
|
||||||
errMsg = "there has been a problem while setting "
|
errMsg = "there has been a problem while setting "
|
||||||
errMsg += "temporary directory location ('%s')" % getSafeExString(ex)
|
errMsg += "temporary directory location ('%s')" % getSafeExString(ex)
|
||||||
raise SqlmapSystemException, errMsg
|
raise SqlmapSystemException, errMsg
|
||||||
|
@ -2269,7 +2269,7 @@ def _setDNSServer():
|
||||||
try:
|
try:
|
||||||
conf.dnsServer = DNSServer()
|
conf.dnsServer = DNSServer()
|
||||||
conf.dnsServer.run()
|
conf.dnsServer.run()
|
||||||
except socket.error, msg:
|
except socket.error as msg:
|
||||||
errMsg = "there was an error while setting up "
|
errMsg = "there was an error while setting up "
|
||||||
errMsg += "DNS server instance ('%s')" % msg
|
errMsg += "DNS server instance ('%s')" % msg
|
||||||
raise SqlmapGenericException(errMsg)
|
raise SqlmapGenericException(errMsg)
|
||||||
|
@ -2456,14 +2456,14 @@ def _basicOptionValidation():
|
||||||
if conf.regexp:
|
if conf.regexp:
|
||||||
try:
|
try:
|
||||||
re.compile(conf.regexp)
|
re.compile(conf.regexp)
|
||||||
except Exception, ex:
|
except Exception as ex:
|
||||||
errMsg = "invalid regular expression '%s' ('%s')" % (conf.regexp, getSafeExString(ex))
|
errMsg = "invalid regular expression '%s' ('%s')" % (conf.regexp, getSafeExString(ex))
|
||||||
raise SqlmapSyntaxException(errMsg)
|
raise SqlmapSyntaxException(errMsg)
|
||||||
|
|
||||||
if conf.crawlExclude:
|
if conf.crawlExclude:
|
||||||
try:
|
try:
|
||||||
re.compile(conf.crawlExclude)
|
re.compile(conf.crawlExclude)
|
||||||
except Exception, ex:
|
except Exception as ex:
|
||||||
errMsg = "invalid regular expression '%s' ('%s')" % (conf.crawlExclude, getSafeExString(ex))
|
errMsg = "invalid regular expression '%s' ('%s')" % (conf.crawlExclude, getSafeExString(ex))
|
||||||
raise SqlmapSyntaxException(errMsg)
|
raise SqlmapSyntaxException(errMsg)
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ def profile(profileOutputFile=None, dotOutputFile=None, imageOutputFile=None):
|
||||||
import gobject
|
import gobject
|
||||||
import gtk
|
import gtk
|
||||||
import pydot
|
import pydot
|
||||||
except ImportError, e:
|
except ImportError as e:
|
||||||
errMsg = "profiling requires third-party libraries ('%s') " % getUnicode(e, UNICODE_ENCODING)
|
errMsg = "profiling requires third-party libraries ('%s') " % getUnicode(e, UNICODE_ENCODING)
|
||||||
errMsg += "(Hint: 'sudo apt-get install python-pydot python-pyparsing python-profiler graphviz')"
|
errMsg += "(Hint: 'sudo apt-get install python-pydot python-pyparsing python-profiler graphviz')"
|
||||||
logger.error(errMsg)
|
logger.error(errMsg)
|
||||||
|
|
|
@ -27,7 +27,7 @@ class Replication(object):
|
||||||
self.connection = sqlite3.connect(dbpath)
|
self.connection = sqlite3.connect(dbpath)
|
||||||
self.connection.isolation_level = None
|
self.connection.isolation_level = None
|
||||||
self.cursor = self.connection.cursor()
|
self.cursor = self.connection.cursor()
|
||||||
except sqlite3.OperationalError, ex:
|
except sqlite3.OperationalError as ex:
|
||||||
errMsg = "error occurred while opening a replication "
|
errMsg = "error occurred while opening a replication "
|
||||||
errMsg += "file '%s' ('%s')" % (self.filepath, getSafeExString(ex))
|
errMsg += "file '%s' ('%s')" % (self.filepath, getSafeExString(ex))
|
||||||
raise SqlmapConnectionException(errMsg)
|
raise SqlmapConnectionException(errMsg)
|
||||||
|
@ -63,7 +63,7 @@ class Replication(object):
|
||||||
self.execute('CREATE TABLE "%s" (%s)' % (self.name, ','.join('"%s" %s' % (unsafeSQLIdentificatorNaming(colname), coltype) for colname, coltype in self.columns)))
|
self.execute('CREATE TABLE "%s" (%s)' % (self.name, ','.join('"%s" %s' % (unsafeSQLIdentificatorNaming(colname), coltype) for colname, coltype in self.columns)))
|
||||||
else:
|
else:
|
||||||
self.execute('CREATE TABLE "%s" (%s)' % (self.name, ','.join('"%s"' % unsafeSQLIdentificatorNaming(colname) for colname in self.columns)))
|
self.execute('CREATE TABLE "%s" (%s)' % (self.name, ','.join('"%s"' % unsafeSQLIdentificatorNaming(colname) for colname in self.columns)))
|
||||||
except Exception, ex:
|
except Exception as ex:
|
||||||
errMsg = "problem occurred ('%s') while initializing the sqlite database " % getSafeExString(ex, UNICODE_ENCODING)
|
errMsg = "problem occurred ('%s') while initializing the sqlite database " % getSafeExString(ex, UNICODE_ENCODING)
|
||||||
errMsg += "located at '%s'" % self.parent.dbpath
|
errMsg += "located at '%s'" % self.parent.dbpath
|
||||||
raise SqlmapGenericException(errMsg)
|
raise SqlmapGenericException(errMsg)
|
||||||
|
@ -82,7 +82,7 @@ class Replication(object):
|
||||||
def execute(self, sql, parameters=[]):
|
def execute(self, sql, parameters=[]):
|
||||||
try:
|
try:
|
||||||
self.parent.cursor.execute(sql, parameters)
|
self.parent.cursor.execute(sql, parameters)
|
||||||
except sqlite3.OperationalError, ex:
|
except sqlite3.OperationalError as ex:
|
||||||
errMsg = "problem occurred ('%s') while accessing sqlite database " % getSafeExString(ex, UNICODE_ENCODING)
|
errMsg = "problem occurred ('%s') while accessing sqlite database " % getSafeExString(ex, UNICODE_ENCODING)
|
||||||
errMsg += "located at '%s'. Please make sure that " % self.parent.dbpath
|
errMsg += "located at '%s'. Please make sure that " % self.parent.dbpath
|
||||||
errMsg += "it's not used by some other program"
|
errMsg += "it's not used by some other program"
|
||||||
|
|
|
@ -72,7 +72,7 @@ def saveHistory(completion=None):
|
||||||
readline.set_history_length(MAX_HISTORY_LENGTH)
|
readline.set_history_length(MAX_HISTORY_LENGTH)
|
||||||
try:
|
try:
|
||||||
readline.write_history_file(historyPath)
|
readline.write_history_file(historyPath)
|
||||||
except IOError, msg:
|
except IOError as msg:
|
||||||
warnMsg = "there was a problem writing the history file '%s' (%s)" % (historyPath, msg)
|
warnMsg = "there was a problem writing the history file '%s' (%s)" % (historyPath, msg)
|
||||||
logger.warn(warnMsg)
|
logger.warn(warnMsg)
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ def loadHistory(completion=None):
|
||||||
if os.path.exists(historyPath):
|
if os.path.exists(historyPath):
|
||||||
try:
|
try:
|
||||||
readline.read_history_file(historyPath)
|
readline.read_history_file(historyPath)
|
||||||
except IOError, msg:
|
except IOError as msg:
|
||||||
warnMsg = "there was a problem loading the history file '%s' (%s)" % (historyPath, msg)
|
warnMsg = "there was a problem loading the history file '%s' (%s)" % (historyPath, msg)
|
||||||
logger.warn(warnMsg)
|
logger.warn(warnMsg)
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ def blockingReadFromFD(fd):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
output += os.read(fd, 8192)
|
output += os.read(fd, 8192)
|
||||||
except (OSError, IOError), ioe:
|
except (OSError, IOError) as ioe:
|
||||||
if ioe.args[0] in (errno.EAGAIN, errno.EINTR):
|
if ioe.args[0] in (errno.EAGAIN, errno.EINTR):
|
||||||
# Uncomment the following line if the process seems to
|
# Uncomment the following line if the process seems to
|
||||||
# take a huge amount of cpu time
|
# take a huge amount of cpu time
|
||||||
|
@ -58,7 +58,7 @@ def blockingWriteToFD(fd, data):
|
||||||
try:
|
try:
|
||||||
data_length = len(data)
|
data_length = len(data)
|
||||||
wrote_data = os.write(fd, data)
|
wrote_data = os.write(fd, data)
|
||||||
except (OSError, IOError), io:
|
except (OSError, IOError) as io:
|
||||||
if io.errno in (errno.EAGAIN, errno.EINTR):
|
if io.errno in (errno.EAGAIN, errno.EINTR):
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
|
@ -101,7 +101,7 @@ class Popen(subprocess.Popen):
|
||||||
(errCode, written) = WriteFile(x, input)
|
(errCode, written) = WriteFile(x, input)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
return self._close('stdin')
|
return self._close('stdin')
|
||||||
except (subprocess.pywintypes.error, Exception), why:
|
except (subprocess.pywintypes.error, Exception) as why:
|
||||||
if why[0] in (109, errno.ESHUTDOWN):
|
if why[0] in (109, errno.ESHUTDOWN):
|
||||||
return self._close('stdin')
|
return self._close('stdin')
|
||||||
raise
|
raise
|
||||||
|
@ -122,7 +122,7 @@ class Popen(subprocess.Popen):
|
||||||
(errCode, read) = ReadFile(x, nAvail, None)
|
(errCode, read) = ReadFile(x, nAvail, None)
|
||||||
except (ValueError, NameError):
|
except (ValueError, NameError):
|
||||||
return self._close(which)
|
return self._close(which)
|
||||||
except (subprocess.pywintypes.error, Exception), why:
|
except (subprocess.pywintypes.error, Exception) as why:
|
||||||
if why[0] in (109, errno.ESHUTDOWN):
|
if why[0] in (109, errno.ESHUTDOWN):
|
||||||
return self._close(which)
|
return self._close(which)
|
||||||
raise
|
raise
|
||||||
|
@ -140,7 +140,7 @@ class Popen(subprocess.Popen):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
written = os.write(self.stdin.fileno(), input)
|
written = os.write(self.stdin.fileno(), input)
|
||||||
except OSError, why:
|
except OSError as why:
|
||||||
if why[0] == errno.EPIPE: # broken pipe
|
if why[0] == errno.EPIPE: # broken pipe
|
||||||
return self._close('stdin')
|
return self._close('stdin')
|
||||||
raise
|
raise
|
||||||
|
|
|
@ -422,7 +422,7 @@ def _setHashDB():
|
||||||
try:
|
try:
|
||||||
os.remove(conf.hashDBFile)
|
os.remove(conf.hashDBFile)
|
||||||
logger.info("flushing session file")
|
logger.info("flushing session file")
|
||||||
except OSError, msg:
|
except OSError as msg:
|
||||||
errMsg = "unable to flush the session file (%s)" % msg
|
errMsg = "unable to flush the session file (%s)" % msg
|
||||||
raise SqlmapFilePathException(errMsg)
|
raise SqlmapFilePathException(errMsg)
|
||||||
|
|
||||||
|
@ -550,7 +550,7 @@ def _setResultsFile():
|
||||||
conf.resultsFilename = os.path.join(paths.SQLMAP_OUTPUT_PATH, time.strftime(RESULTS_FILE_FORMAT).lower())
|
conf.resultsFilename = os.path.join(paths.SQLMAP_OUTPUT_PATH, time.strftime(RESULTS_FILE_FORMAT).lower())
|
||||||
try:
|
try:
|
||||||
conf.resultsFP = openFile(conf.resultsFilename, "a", UNICODE_ENCODING, buffering=0)
|
conf.resultsFP = openFile(conf.resultsFilename, "a", UNICODE_ENCODING, buffering=0)
|
||||||
except (OSError, IOError), ex:
|
except (OSError, IOError) as ex:
|
||||||
try:
|
try:
|
||||||
warnMsg = "unable to create results file '%s' ('%s'). " % (conf.resultsFilename, getUnicode(ex))
|
warnMsg = "unable to create results file '%s' ('%s'). " % (conf.resultsFilename, getUnicode(ex))
|
||||||
handle, conf.resultsFilename = tempfile.mkstemp(prefix=MKSTEMP_PREFIX.RESULTS, suffix=".csv")
|
handle, conf.resultsFilename = tempfile.mkstemp(prefix=MKSTEMP_PREFIX.RESULTS, suffix=".csv")
|
||||||
|
@ -558,7 +558,7 @@ def _setResultsFile():
|
||||||
conf.resultsFP = openFile(conf.resultsFilename, "w+", UNICODE_ENCODING, buffering=0)
|
conf.resultsFP = openFile(conf.resultsFilename, "w+", UNICODE_ENCODING, buffering=0)
|
||||||
warnMsg += "Using temporary file '%s' instead" % conf.resultsFilename
|
warnMsg += "Using temporary file '%s' instead" % conf.resultsFilename
|
||||||
logger.warn(warnMsg)
|
logger.warn(warnMsg)
|
||||||
except IOError, _:
|
except IOError as _:
|
||||||
errMsg = "unable to write to the temporary directory ('%s'). " % _
|
errMsg = "unable to write to the temporary directory ('%s'). " % _
|
||||||
errMsg += "Please make sure that your disk is not full and "
|
errMsg += "Please make sure that your disk is not full and "
|
||||||
errMsg += "that you have sufficient write permissions to "
|
errMsg += "that you have sufficient write permissions to "
|
||||||
|
@ -582,7 +582,7 @@ def _createFilesDir():
|
||||||
if not os.path.isdir(conf.filePath):
|
if not os.path.isdir(conf.filePath):
|
||||||
try:
|
try:
|
||||||
os.makedirs(conf.filePath, 0755)
|
os.makedirs(conf.filePath, 0755)
|
||||||
except OSError, ex:
|
except OSError as ex:
|
||||||
tempDir = tempfile.mkdtemp(prefix="sqlmapfiles")
|
tempDir = tempfile.mkdtemp(prefix="sqlmapfiles")
|
||||||
warnMsg = "unable to create files directory "
|
warnMsg = "unable to create files directory "
|
||||||
warnMsg += "'%s' (%s). " % (conf.filePath, getUnicode(ex))
|
warnMsg += "'%s' (%s). " % (conf.filePath, getUnicode(ex))
|
||||||
|
@ -604,7 +604,7 @@ def _createDumpDir():
|
||||||
if not os.path.isdir(conf.dumpPath):
|
if not os.path.isdir(conf.dumpPath):
|
||||||
try:
|
try:
|
||||||
os.makedirs(conf.dumpPath, 0755)
|
os.makedirs(conf.dumpPath, 0755)
|
||||||
except OSError, ex:
|
except OSError as ex:
|
||||||
tempDir = tempfile.mkdtemp(prefix="sqlmapdump")
|
tempDir = tempfile.mkdtemp(prefix="sqlmapdump")
|
||||||
warnMsg = "unable to create dump directory "
|
warnMsg = "unable to create dump directory "
|
||||||
warnMsg += "'%s' (%s). " % (conf.dumpPath, getUnicode(ex))
|
warnMsg += "'%s' (%s). " % (conf.dumpPath, getUnicode(ex))
|
||||||
|
@ -633,10 +633,10 @@ def _createTargetDirs():
|
||||||
if conf.outputDir:
|
if conf.outputDir:
|
||||||
warnMsg = "using '%s' as the output directory" % paths.SQLMAP_OUTPUT_PATH
|
warnMsg = "using '%s' as the output directory" % paths.SQLMAP_OUTPUT_PATH
|
||||||
logger.warn(warnMsg)
|
logger.warn(warnMsg)
|
||||||
except (OSError, IOError), ex:
|
except (OSError, IOError) as ex:
|
||||||
try:
|
try:
|
||||||
tempDir = tempfile.mkdtemp(prefix="sqlmapoutput")
|
tempDir = tempfile.mkdtemp(prefix="sqlmapoutput")
|
||||||
except Exception, _:
|
except Exception as _:
|
||||||
errMsg = "unable to write to the temporary directory ('%s'). " % _
|
errMsg = "unable to write to the temporary directory ('%s'). " % _
|
||||||
errMsg += "Please make sure that your disk is not full and "
|
errMsg += "Please make sure that your disk is not full and "
|
||||||
errMsg += "that you have sufficient write permissions to "
|
errMsg += "that you have sufficient write permissions to "
|
||||||
|
@ -655,10 +655,10 @@ def _createTargetDirs():
|
||||||
try:
|
try:
|
||||||
if not os.path.isdir(conf.outputPath):
|
if not os.path.isdir(conf.outputPath):
|
||||||
os.makedirs(conf.outputPath, 0755)
|
os.makedirs(conf.outputPath, 0755)
|
||||||
except (OSError, IOError, TypeError), ex:
|
except (OSError, IOError, TypeError) as ex:
|
||||||
try:
|
try:
|
||||||
tempDir = tempfile.mkdtemp(prefix="sqlmapoutput")
|
tempDir = tempfile.mkdtemp(prefix="sqlmapoutput")
|
||||||
except Exception, _:
|
except Exception as _:
|
||||||
errMsg = "unable to write to the temporary directory ('%s'). " % _
|
errMsg = "unable to write to the temporary directory ('%s'). " % _
|
||||||
errMsg += "Please make sure that your disk is not full and "
|
errMsg += "Please make sure that your disk is not full and "
|
||||||
errMsg += "that you have sufficient write permissions to "
|
errMsg += "that you have sufficient write permissions to "
|
||||||
|
@ -679,7 +679,7 @@ def _createTargetDirs():
|
||||||
f.write(" # %s" % getUnicode(subprocess.list2cmdline(sys.argv), encoding=sys.stdin.encoding))
|
f.write(" # %s" % getUnicode(subprocess.list2cmdline(sys.argv), encoding=sys.stdin.encoding))
|
||||||
if conf.data:
|
if conf.data:
|
||||||
f.write("\n\n%s" % getUnicode(conf.data))
|
f.write("\n\n%s" % getUnicode(conf.data))
|
||||||
except IOError, ex:
|
except IOError as ex:
|
||||||
if "denied" in getUnicode(ex):
|
if "denied" in getUnicode(ex):
|
||||||
errMsg = "you don't have enough permissions "
|
errMsg = "you don't have enough permissions "
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -71,7 +71,7 @@ def smokeTest():
|
||||||
try:
|
try:
|
||||||
__import__(path)
|
__import__(path)
|
||||||
module = sys.modules[path]
|
module = sys.modules[path]
|
||||||
except Exception, msg:
|
except Exception as msg:
|
||||||
retVal = False
|
retVal = False
|
||||||
dataToStdout("\r")
|
dataToStdout("\r")
|
||||||
errMsg = "smoke test failed at importing module '%s' (%s):\n%s" % (path, os.path.join(root, filename), msg)
|
errMsg = "smoke test failed at importing module '%s' (%s):\n%s" % (path, os.path.join(root, filename), msg)
|
||||||
|
@ -271,9 +271,9 @@ def runCase(parse):
|
||||||
result = start()
|
result = start()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
pass
|
pass
|
||||||
except SqlmapBaseException, e:
|
except SqlmapBaseException as e:
|
||||||
handled_exception = e
|
handled_exception = e
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
unhandled_exception = e
|
unhandled_exception = e
|
||||||
finally:
|
finally:
|
||||||
sys.stdout.seek(0)
|
sys.stdout.seek(0)
|
||||||
|
|
|
@ -91,7 +91,7 @@ def exceptionHandledFunction(threadFunction, silent=False):
|
||||||
kb.threadContinue = False
|
kb.threadContinue = False
|
||||||
kb.threadException = True
|
kb.threadException = True
|
||||||
raise
|
raise
|
||||||
except Exception, ex:
|
except Exception as ex:
|
||||||
if not silent:
|
if not silent:
|
||||||
logger.error("thread %s: %s" % (threading.currentThread().getName(), ex.message))
|
logger.error("thread %s: %s" % (threading.currentThread().getName(), ex.message))
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardExceptio
|
||||||
|
|
||||||
try:
|
try:
|
||||||
thread.start()
|
thread.start()
|
||||||
except Exception, ex:
|
except Exception as ex:
|
||||||
errMsg = "error occurred while starting new thread ('%s')" % ex.message
|
errMsg = "error occurred while starting new thread ('%s')" % ex.message
|
||||||
logger.critical(errMsg)
|
logger.critical(errMsg)
|
||||||
break
|
break
|
||||||
|
@ -166,7 +166,7 @@ def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardExceptio
|
||||||
alive = True
|
alive = True
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
except (KeyboardInterrupt, SqlmapUserQuitException), ex:
|
except (KeyboardInterrupt, SqlmapUserQuitException) as ex:
|
||||||
print
|
print
|
||||||
kb.threadContinue = False
|
kb.threadContinue = False
|
||||||
kb.threadException = True
|
kb.threadException = True
|
||||||
|
@ -183,7 +183,7 @@ def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardExceptio
|
||||||
if forwardException:
|
if forwardException:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
except (SqlmapConnectionException, SqlmapValueException), ex:
|
except (SqlmapConnectionException, SqlmapValueException) as ex:
|
||||||
print
|
print
|
||||||
kb.threadException = True
|
kb.threadException = True
|
||||||
logger.error("thread %s: %s" % (threading.currentThread().getName(), ex.message))
|
logger.error("thread %s: %s" % (threading.currentThread().getName(), ex.message))
|
||||||
|
|
|
@ -46,7 +46,7 @@ def update():
|
||||||
pollProcess(process, True)
|
pollProcess(process, True)
|
||||||
stdout, stderr = process.communicate()
|
stdout, stderr = process.communicate()
|
||||||
success = not process.returncode
|
success = not process.returncode
|
||||||
except (IOError, OSError), ex:
|
except (IOError, OSError) as ex:
|
||||||
success = False
|
success = False
|
||||||
stderr = getSafeExString(ex)
|
stderr = getSafeExString(ex)
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ class Wordlist(object):
|
||||||
if os.path.splitext(self.current)[1].lower() == ".zip":
|
if os.path.splitext(self.current)[1].lower() == ".zip":
|
||||||
try:
|
try:
|
||||||
_ = zipfile.ZipFile(self.current, 'r')
|
_ = zipfile.ZipFile(self.current, 'r')
|
||||||
except zipfile.error, ex:
|
except zipfile.error as ex:
|
||||||
errMsg = "something appears to be wrong with "
|
errMsg = "something appears to be wrong with "
|
||||||
errMsg += "the file '%s' ('%s'). Please make " % (self.current, getSafeExString(ex))
|
errMsg += "the file '%s' ('%s'). Please make " % (self.current, getSafeExString(ex))
|
||||||
errMsg += "sure that you haven't made any changes to it"
|
errMsg += "sure that you haven't made any changes to it"
|
||||||
|
@ -69,7 +69,7 @@ class Wordlist(object):
|
||||||
self.counter += 1
|
self.counter += 1
|
||||||
try:
|
try:
|
||||||
retVal = self.iter.next().rstrip()
|
retVal = self.iter.next().rstrip()
|
||||||
except zipfile.error, ex:
|
except zipfile.error as ex:
|
||||||
errMsg = "something appears to be wrong with "
|
errMsg = "something appears to be wrong with "
|
||||||
errMsg += "the file '%s' ('%s'). Please make " % (self.current, getSafeExString(ex))
|
errMsg += "the file '%s' ('%s'). Please make " % (self.current, getSafeExString(ex))
|
||||||
errMsg += "sure that you haven't made any changes to it"
|
errMsg += "sure that you haven't made any changes to it"
|
||||||
|
|
|
@ -908,7 +908,7 @@ def cmdLineParser(argv=None):
|
||||||
try:
|
try:
|
||||||
for arg in shlex.split(command):
|
for arg in shlex.split(command):
|
||||||
argv.append(getUnicode(arg, encoding=sys.stdin.encoding))
|
argv.append(getUnicode(arg, encoding=sys.stdin.encoding))
|
||||||
except ValueError, ex:
|
except ValueError as ex:
|
||||||
raise SqlmapSyntaxException, "something went wrong during command line parsing ('%s')" % ex.message
|
raise SqlmapSyntaxException, "something went wrong during command line parsing ('%s')" % ex.message
|
||||||
|
|
||||||
for i in xrange(len(argv)):
|
for i in xrange(len(argv)):
|
||||||
|
@ -954,7 +954,7 @@ def cmdLineParser(argv=None):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
(args, _) = parser.parse_args(argv)
|
(args, _) = parser.parse_args(argv)
|
||||||
except UnicodeEncodeError, ex:
|
except UnicodeEncodeError as ex:
|
||||||
dataToStdout("\n[!] %s\n" % ex.object.encode("unicode-escape"))
|
dataToStdout("\n[!] %s\n" % ex.object.encode("unicode-escape"))
|
||||||
raise SystemExit
|
raise SystemExit
|
||||||
except SystemExit:
|
except SystemExit:
|
||||||
|
@ -985,7 +985,7 @@ def cmdLineParser(argv=None):
|
||||||
|
|
||||||
return args
|
return args
|
||||||
|
|
||||||
except (OptionError, TypeError), e:
|
except (OptionError, TypeError) as e:
|
||||||
parser.error(e)
|
parser.error(e)
|
||||||
|
|
||||||
except SystemExit:
|
except SystemExit:
|
||||||
|
|
|
@ -39,7 +39,7 @@ def configFileProxy(section, option, datatype):
|
||||||
value = config.getfloat(section, option) if config.get(section, option) else 0.0
|
value = config.getfloat(section, option) if config.get(section, option) else 0.0
|
||||||
else:
|
else:
|
||||||
value = config.get(section, option)
|
value = config.get(section, option)
|
||||||
except ValueError, ex:
|
except ValueError as ex:
|
||||||
errMsg = "error occurred while processing the option "
|
errMsg = "error occurred while processing the option "
|
||||||
errMsg += "'%s' in provided configuration file ('%s')" % (option, getUnicode(ex))
|
errMsg += "'%s' in provided configuration file ('%s')" % (option, getUnicode(ex))
|
||||||
raise SqlmapSyntaxException(errMsg)
|
raise SqlmapSyntaxException(errMsg)
|
||||||
|
@ -71,7 +71,7 @@ def configFileParser(configFile):
|
||||||
try:
|
try:
|
||||||
config = UnicodeRawConfigParser()
|
config = UnicodeRawConfigParser()
|
||||||
config.readfp(configFP)
|
config.readfp(configFP)
|
||||||
except Exception, ex:
|
except Exception as ex:
|
||||||
errMsg = "you have provided an invalid and/or unreadable configuration file ('%s')" % getSafeExString(ex)
|
errMsg = "you have provided an invalid and/or unreadable configuration file ('%s')" % getSafeExString(ex)
|
||||||
raise SqlmapSyntaxException(errMsg)
|
raise SqlmapSyntaxException(errMsg)
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ def parseXmlNode(node):
|
||||||
def loadBoundaries():
|
def loadBoundaries():
|
||||||
try:
|
try:
|
||||||
doc = et.parse(paths.BOUNDARIES_XML)
|
doc = et.parse(paths.BOUNDARIES_XML)
|
||||||
except Exception, ex:
|
except Exception as ex:
|
||||||
errMsg = "something appears to be wrong with "
|
errMsg = "something appears to be wrong with "
|
||||||
errMsg += "the file '%s' ('%s'). Please make " % (paths.BOUNDARIES_XML, getSafeExString(ex))
|
errMsg += "the file '%s' ('%s'). Please make " % (paths.BOUNDARIES_XML, getSafeExString(ex))
|
||||||
errMsg += "sure that you haven't made any changes to it"
|
errMsg += "sure that you haven't made any changes to it"
|
||||||
|
@ -89,7 +89,7 @@ def loadPayloads():
|
||||||
|
|
||||||
try:
|
try:
|
||||||
doc = et.parse(payloadFilePath)
|
doc = et.parse(payloadFilePath)
|
||||||
except Exception, ex:
|
except Exception as ex:
|
||||||
errMsg = "something appears to be wrong with "
|
errMsg = "something appears to be wrong with "
|
||||||
errMsg += "the file '%s' ('%s'). Please make " % (payloadFilePath, getSafeExString(ex))
|
errMsg += "the file '%s' ('%s'). Please make " % (payloadFilePath, getSafeExString(ex))
|
||||||
errMsg += "sure that you haven't made any changes to it"
|
errMsg += "sure that you haven't made any changes to it"
|
||||||
|
|
|
@ -283,7 +283,7 @@ def decodePage(page, contentEncoding, contentType):
|
||||||
raise Exception("size too large")
|
raise Exception("size too large")
|
||||||
|
|
||||||
page = data.read()
|
page = data.read()
|
||||||
except Exception, msg:
|
except Exception as msg:
|
||||||
if "<html" not in page: # in some cases, invalid "Content-Encoding" appears for plain HTML (should be ignored)
|
if "<html" not in page: # in some cases, invalid "Content-Encoding" appears for plain HTML (should be ignored)
|
||||||
errMsg = "detected invalid data for declared content "
|
errMsg = "detected invalid data for declared content "
|
||||||
errMsg += "encoding '%s' ('%s')" % (contentEncoding, msg)
|
errMsg += "encoding '%s' ('%s')" % (contentEncoding, msg)
|
||||||
|
|
|
@ -540,11 +540,11 @@ class Connect(object):
|
||||||
if hasattr(conn.fp, '_sock'):
|
if hasattr(conn.fp, '_sock'):
|
||||||
conn.fp._sock.close()
|
conn.fp._sock.close()
|
||||||
conn.close()
|
conn.close()
|
||||||
except Exception, ex:
|
except Exception as ex:
|
||||||
warnMsg = "problem occurred during connection closing ('%s')" % getSafeExString(ex)
|
warnMsg = "problem occurred during connection closing ('%s')" % getSafeExString(ex)
|
||||||
logger.warn(warnMsg)
|
logger.warn(warnMsg)
|
||||||
|
|
||||||
except SqlmapConnectionException, ex:
|
except SqlmapConnectionException as ex:
|
||||||
if conf.proxyList and not kb.threadException:
|
if conf.proxyList and not kb.threadException:
|
||||||
warnMsg = "unable to connect to the target URL ('%s')" % ex
|
warnMsg = "unable to connect to the target URL ('%s')" % ex
|
||||||
logger.critical(warnMsg)
|
logger.critical(warnMsg)
|
||||||
|
@ -553,7 +553,7 @@ class Connect(object):
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
except urllib2.HTTPError, ex:
|
except urllib2.HTTPError as ex:
|
||||||
page = None
|
page = None
|
||||||
responseHeaders = None
|
responseHeaders = None
|
||||||
|
|
||||||
|
@ -817,7 +817,7 @@ class Connect(object):
|
||||||
for function in kb.tamperFunctions:
|
for function in kb.tamperFunctions:
|
||||||
try:
|
try:
|
||||||
payload = function(payload=payload, headers=auxHeaders)
|
payload = function(payload=payload, headers=auxHeaders)
|
||||||
except Exception, ex:
|
except Exception as ex:
|
||||||
errMsg = "error occurred while running tamper "
|
errMsg = "error occurred while running tamper "
|
||||||
errMsg += "function '%s' ('%s')" % (function.func_name, getSafeExString(ex))
|
errMsg += "function '%s' ('%s')" % (function.func_name, getSafeExString(ex))
|
||||||
raise SqlmapGenericException(errMsg)
|
raise SqlmapGenericException(errMsg)
|
||||||
|
@ -1058,7 +1058,7 @@ class Connect(object):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
compiler.parse(unicodeencode(conf.evalCode.replace(';', '\n')))
|
compiler.parse(unicodeencode(conf.evalCode.replace(';', '\n')))
|
||||||
except SyntaxError, ex:
|
except SyntaxError as ex:
|
||||||
if ex.text:
|
if ex.text:
|
||||||
original = replacement = ex.text.strip()
|
original = replacement = ex.text.strip()
|
||||||
if '=' in original:
|
if '=' in original:
|
||||||
|
|
|
@ -149,7 +149,7 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
except socket.error, ex:
|
except socket.error as ex:
|
||||||
if 'Permission' in str(ex):
|
if 'Permission' in str(ex):
|
||||||
print "[x] Please run with sudo/Administrator privileges"
|
print "[x] Please run with sudo/Administrator privileges"
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -62,7 +62,7 @@ class HTTPSConnection(httplib.HTTPSConnection):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
sock.close()
|
sock.close()
|
||||||
except (ssl.SSLError, socket.error, httplib.BadStatusLine), ex:
|
except (ssl.SSLError, socket.error, httplib.BadStatusLine) as ex:
|
||||||
self._tunnel_host = None
|
self._tunnel_host = None
|
||||||
logger.debug("SSL connection error occurred ('%s')" % getSafeExString(ex))
|
logger.debug("SSL connection error occurred ('%s')" % getSafeExString(ex))
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ class HTTPSConnection(httplib.HTTPSConnection):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
sock.close()
|
sock.close()
|
||||||
except (ssl.SSLError, socket.error, httplib.BadStatusLine), ex:
|
except (ssl.SSLError, socket.error, httplib.BadStatusLine) as ex:
|
||||||
self._tunnel_host = None
|
self._tunnel_host = None
|
||||||
logger.debug("SSL connection error occurred ('%s')" % getSafeExString(ex))
|
logger.debug("SSL connection error occurred ('%s')" % getSafeExString(ex))
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ class SmartRedirectHandler(urllib2.HTTPRedirectHandler):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
content = fp.read(MAX_CONNECTION_TOTAL_SIZE)
|
content = fp.read(MAX_CONNECTION_TOTAL_SIZE)
|
||||||
except Exception, msg:
|
except Exception as msg:
|
||||||
dbgMsg = "there was a problem while retrieving "
|
dbgMsg = "there was a problem while retrieving "
|
||||||
dbgMsg += "redirect response content (%s)" % msg
|
dbgMsg += "redirect response content (%s)" % msg
|
||||||
logger.debug(dbgMsg)
|
logger.debug(dbgMsg)
|
||||||
|
@ -132,7 +132,7 @@ class SmartRedirectHandler(urllib2.HTTPRedirectHandler):
|
||||||
req.headers[HTTP_HEADER.COOKIE] = re.sub(r"%s{2,}" % delimiter, delimiter, ("%s%s%s" % (re.sub(r"\b%s=[^%s]*%s?" % (re.escape(_.split('=')[0]), delimiter, delimiter), "", req.headers[HTTP_HEADER.COOKIE]), delimiter, _)).strip(delimiter))
|
req.headers[HTTP_HEADER.COOKIE] = re.sub(r"%s{2,}" % delimiter, delimiter, ("%s%s%s" % (re.sub(r"\b%s=[^%s]*%s?" % (re.escape(_.split('=')[0]), delimiter, delimiter), "", req.headers[HTTP_HEADER.COOKIE]), delimiter, _)).strip(delimiter))
|
||||||
try:
|
try:
|
||||||
result = urllib2.HTTPRedirectHandler.http_error_302(self, req, fp, code, msg, headers)
|
result = urllib2.HTTPRedirectHandler.http_error_302(self, req, fp, code, msg, headers)
|
||||||
except urllib2.HTTPError, e:
|
except urllib2.HTTPError as e:
|
||||||
result = e
|
result = e
|
||||||
|
|
||||||
# Dirty hack for http://bugs.python.org/issue15701
|
# Dirty hack for http://bugs.python.org/issue15701
|
||||||
|
|
|
@ -93,7 +93,7 @@ class Database(object):
|
||||||
self.cursor.execute(statement, arguments)
|
self.cursor.execute(statement, arguments)
|
||||||
else:
|
else:
|
||||||
self.cursor.execute(statement)
|
self.cursor.execute(statement)
|
||||||
except sqlite3.OperationalError, ex:
|
except sqlite3.OperationalError as ex:
|
||||||
if not "locked" in getSafeExString(ex):
|
if not "locked" in getSafeExString(ex):
|
||||||
raise
|
raise
|
||||||
else:
|
else:
|
||||||
|
@ -276,7 +276,7 @@ def setRestAPILog():
|
||||||
try:
|
try:
|
||||||
conf.databaseCursor = Database(conf.database)
|
conf.databaseCursor = Database(conf.database)
|
||||||
conf.databaseCursor.connect("client")
|
conf.databaseCursor.connect("client")
|
||||||
except sqlite3.OperationalError, ex:
|
except sqlite3.OperationalError as ex:
|
||||||
raise SqlmapConnectionException, "%s ('%s')" % (ex, conf.database)
|
raise SqlmapConnectionException, "%s ('%s')" % (ex, conf.database)
|
||||||
|
|
||||||
# Set a logging handler that writes log messages to a IPC database
|
# Set a logging handler that writes log messages to a IPC database
|
||||||
|
@ -699,7 +699,7 @@ def server(host=RESTAPI_DEFAULT_ADDRESS, port=RESTAPI_DEFAULT_PORT, adapter=REST
|
||||||
eventlet.monkey_patch()
|
eventlet.monkey_patch()
|
||||||
logger.debug("Using adapter '%s' to run bottle" % adapter)
|
logger.debug("Using adapter '%s' to run bottle" % adapter)
|
||||||
run(host=host, port=port, quiet=True, debug=True, server=adapter)
|
run(host=host, port=port, quiet=True, debug=True, server=adapter)
|
||||||
except socket.error, ex:
|
except socket.error as ex:
|
||||||
if "already in use" in getSafeExString(ex):
|
if "already in use" in getSafeExString(ex):
|
||||||
logger.error("Address already in use ('%s:%s')" % (host, port))
|
logger.error("Address already in use ('%s:%s')" % (host, port))
|
||||||
else:
|
else:
|
||||||
|
@ -753,7 +753,7 @@ def client(host=RESTAPI_DEFAULT_ADDRESS, port=RESTAPI_DEFAULT_PORT, username=Non
|
||||||
|
|
||||||
try:
|
try:
|
||||||
_client(addr)
|
_client(addr)
|
||||||
except Exception, ex:
|
except Exception as ex:
|
||||||
if not isinstance(ex, urllib2.HTTPError) or ex.code == httplib.UNAUTHORIZED:
|
if not isinstance(ex, urllib2.HTTPError) or ex.code == httplib.UNAUTHORIZED:
|
||||||
errMsg = "There has been a problem while connecting to the "
|
errMsg = "There has been a problem while connecting to the "
|
||||||
errMsg += "REST-JSON API server at '%s' " % addr
|
errMsg += "REST-JSON API server at '%s' " % addr
|
||||||
|
@ -805,7 +805,7 @@ def client(host=RESTAPI_DEFAULT_ADDRESS, port=RESTAPI_DEFAULT_PORT, username=Non
|
||||||
|
|
||||||
try:
|
try:
|
||||||
argv = ["sqlmap.py"] + shlex.split(command)[1:]
|
argv = ["sqlmap.py"] + shlex.split(command)[1:]
|
||||||
except Exception, ex:
|
except Exception as ex:
|
||||||
logger.error("Error occurred while parsing arguments ('%s')" % ex)
|
logger.error("Error occurred while parsing arguments ('%s')" % ex)
|
||||||
taskid = None
|
taskid = None
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -63,14 +63,14 @@ def crawl(target):
|
||||||
try:
|
try:
|
||||||
if current:
|
if current:
|
||||||
content = Request.getPage(url=current, crawling=True, raise404=False)[0]
|
content = Request.getPage(url=current, crawling=True, raise404=False)[0]
|
||||||
except SqlmapConnectionException, ex:
|
except SqlmapConnectionException as ex:
|
||||||
errMsg = "connection exception detected ('%s'). skipping " % getSafeExString(ex)
|
errMsg = "connection exception detected ('%s'). skipping " % getSafeExString(ex)
|
||||||
errMsg += "URL '%s'" % current
|
errMsg += "URL '%s'" % current
|
||||||
logger.critical(errMsg)
|
logger.critical(errMsg)
|
||||||
except SqlmapSyntaxException:
|
except SqlmapSyntaxException:
|
||||||
errMsg = "invalid URL detected. skipping '%s'" % current
|
errMsg = "invalid URL detected. skipping '%s'" % current
|
||||||
logger.critical(errMsg)
|
logger.critical(errMsg)
|
||||||
except httplib.InvalidURL, ex:
|
except httplib.InvalidURL as ex:
|
||||||
errMsg = "invalid URL detected ('%s'). skipping " % getSafeExString(ex)
|
errMsg = "invalid URL detected ('%s'). skipping " % getSafeExString(ex)
|
||||||
errMsg += "URL '%s'" % current
|
errMsg += "URL '%s'" % current
|
||||||
logger.critical(errMsg)
|
logger.critical(errMsg)
|
||||||
|
@ -138,7 +138,7 @@ def crawl(target):
|
||||||
url = urlparse.urljoin(target, "/sitemap.xml")
|
url = urlparse.urljoin(target, "/sitemap.xml")
|
||||||
try:
|
try:
|
||||||
items = parseSitemap(url)
|
items = parseSitemap(url)
|
||||||
except SqlmapConnectionException, ex:
|
except SqlmapConnectionException as ex:
|
||||||
if "page not found" in getSafeExString(ex):
|
if "page not found" in getSafeExString(ex):
|
||||||
found = False
|
found = False
|
||||||
logger.warn("'sitemap.xml' not found")
|
logger.warn("'sitemap.xml' not found")
|
||||||
|
|
|
@ -767,7 +767,7 @@ def _bruteProcessVariantA(attack_info, hash_regex, suffix, retVal, proc_id, proc
|
||||||
except (UnicodeEncodeError, UnicodeDecodeError):
|
except (UnicodeEncodeError, UnicodeDecodeError):
|
||||||
pass # ignore possible encoding problems caused by some words in custom dictionaries
|
pass # ignore possible encoding problems caused by some words in custom dictionaries
|
||||||
|
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
warnMsg = "there was a problem while hashing entry: %s (%s). " % (repr(word), e)
|
warnMsg = "there was a problem while hashing entry: %s (%s). " % (repr(word), e)
|
||||||
warnMsg += "Please report by e-mail to '%s'" % DEV_EMAIL_ADDRESS
|
warnMsg += "Please report by e-mail to '%s'" % DEV_EMAIL_ADDRESS
|
||||||
logger.critical(warnMsg)
|
logger.critical(warnMsg)
|
||||||
|
@ -843,7 +843,7 @@ def _bruteProcessVariantB(user, hash_, kwargs, hash_regex, suffix, retVal, found
|
||||||
except (UnicodeEncodeError, UnicodeDecodeError):
|
except (UnicodeEncodeError, UnicodeDecodeError):
|
||||||
pass # ignore possible encoding problems caused by some words in custom dictionaries
|
pass # ignore possible encoding problems caused by some words in custom dictionaries
|
||||||
|
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
warnMsg = "there was a problem while hashing entry: %s (%s). " % (repr(word), e)
|
warnMsg = "there was a problem while hashing entry: %s (%s). " % (repr(word), e)
|
||||||
warnMsg += "Please report by e-mail to '%s'" % DEV_EMAIL_ADDRESS
|
warnMsg += "Please report by e-mail to '%s'" % DEV_EMAIL_ADDRESS
|
||||||
logger.critical(warnMsg)
|
logger.critical(warnMsg)
|
||||||
|
@ -994,7 +994,7 @@ def dictionaryAttack(attack_dict):
|
||||||
|
|
||||||
kb.wordlists = dictPaths
|
kb.wordlists = dictPaths
|
||||||
|
|
||||||
except Exception, ex:
|
except Exception as ex:
|
||||||
warnMsg = "there was a problem while loading dictionaries"
|
warnMsg = "there was a problem while loading dictionaries"
|
||||||
warnMsg += " ('%s')" % getSafeExString(ex)
|
warnMsg += " ('%s')" % getSafeExString(ex)
|
||||||
logger.critical(warnMsg)
|
logger.critical(warnMsg)
|
||||||
|
|
|
@ -41,7 +41,7 @@ class HashDB(object):
|
||||||
threadData.hashDBCursor = connection.cursor()
|
threadData.hashDBCursor = connection.cursor()
|
||||||
threadData.hashDBCursor.execute("CREATE TABLE IF NOT EXISTS storage (id INTEGER PRIMARY KEY, value TEXT)")
|
threadData.hashDBCursor.execute("CREATE TABLE IF NOT EXISTS storage (id INTEGER PRIMARY KEY, value TEXT)")
|
||||||
connection.commit()
|
connection.commit()
|
||||||
except Exception, ex:
|
except Exception as ex:
|
||||||
errMsg = "error occurred while opening a session "
|
errMsg = "error occurred while opening a session "
|
||||||
errMsg += "file '%s' ('%s')" % (self.filepath, getSafeExString(ex))
|
errMsg += "file '%s' ('%s')" % (self.filepath, getSafeExString(ex))
|
||||||
raise SqlmapConnectionException(errMsg)
|
raise SqlmapConnectionException(errMsg)
|
||||||
|
@ -81,7 +81,7 @@ class HashDB(object):
|
||||||
try:
|
try:
|
||||||
for row in self.cursor.execute("SELECT value FROM storage WHERE id=?", (hash_,)):
|
for row in self.cursor.execute("SELECT value FROM storage WHERE id=?", (hash_,)):
|
||||||
retVal = row[0]
|
retVal = row[0]
|
||||||
except sqlite3.OperationalError, ex:
|
except sqlite3.OperationalError as ex:
|
||||||
if any(_ in getSafeExString(ex) for _ in ("locked", "no such table")):
|
if any(_ in getSafeExString(ex) for _ in ("locked", "no such table")):
|
||||||
warnMsg = "problem occurred while accessing session file '%s' ('%s')" % (self.filepath, getSafeExString(ex))
|
warnMsg = "problem occurred while accessing session file '%s' ('%s')" % (self.filepath, getSafeExString(ex))
|
||||||
singleTimeWarnMessage(warnMsg)
|
singleTimeWarnMessage(warnMsg)
|
||||||
|
@ -89,7 +89,7 @@ class HashDB(object):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
except sqlite3.DatabaseError, ex:
|
except sqlite3.DatabaseError as ex:
|
||||||
errMsg = "error occurred while accessing session file '%s' ('%s'). " % (self.filepath, getSafeExString(ex))
|
errMsg = "error occurred while accessing session file '%s' ('%s'). " % (self.filepath, getSafeExString(ex))
|
||||||
errMsg += "If the problem persists please rerun with `--flush-session`"
|
errMsg += "If the problem persists please rerun with `--flush-session`"
|
||||||
raise SqlmapConnectionException, errMsg
|
raise SqlmapConnectionException, errMsg
|
||||||
|
@ -141,7 +141,7 @@ class HashDB(object):
|
||||||
self.cursor.execute("INSERT INTO storage VALUES (?, ?)", (hash_, value,))
|
self.cursor.execute("INSERT INTO storage VALUES (?, ?)", (hash_, value,))
|
||||||
except sqlite3.IntegrityError:
|
except sqlite3.IntegrityError:
|
||||||
self.cursor.execute("UPDATE storage SET value=? WHERE id=?", (value, hash_,))
|
self.cursor.execute("UPDATE storage SET value=? WHERE id=?", (value, hash_,))
|
||||||
except sqlite3.DatabaseError, ex:
|
except sqlite3.DatabaseError as ex:
|
||||||
if not os.path.exists(self.filepath):
|
if not os.path.exists(self.filepath):
|
||||||
debugMsg = "session file '%s' does not exist" % self.filepath
|
debugMsg = "session file '%s' does not exist" % self.filepath
|
||||||
logger.debug(debugMsg)
|
logger.debug(debugMsg)
|
||||||
|
|
|
@ -174,7 +174,7 @@ def pivotDumpTable(table, colList, count=None, blind=True):
|
||||||
warnMsg += "will display partial output"
|
warnMsg += "will display partial output"
|
||||||
logger.warn(warnMsg)
|
logger.warn(warnMsg)
|
||||||
|
|
||||||
except SqlmapConnectionException, e:
|
except SqlmapConnectionException as e:
|
||||||
errMsg = "connection exception detected. sqlmap "
|
errMsg = "connection exception detected. sqlmap "
|
||||||
errMsg += "will display partial output"
|
errMsg += "will display partial output"
|
||||||
errMsg += "'%s'" % e
|
errMsg += "'%s'" % e
|
||||||
|
|
|
@ -79,5 +79,5 @@ def purge(directory):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
shutil.rmtree(directory)
|
shutil.rmtree(directory)
|
||||||
except OSError, ex:
|
except OSError as ex:
|
||||||
logger.error("problem occurred while removing directory '%s' ('%s')" % (directory, getSafeExString(ex)))
|
logger.error("problem occurred while removing directory '%s' ('%s')" % (directory, getSafeExString(ex)))
|
||||||
|
|
|
@ -53,7 +53,7 @@ def _search(dork):
|
||||||
try:
|
try:
|
||||||
req = urllib2.Request("https://www.google.com/ncr", headers=headers)
|
req = urllib2.Request("https://www.google.com/ncr", headers=headers)
|
||||||
conn = urllib2.urlopen(req)
|
conn = urllib2.urlopen(req)
|
||||||
except Exception, ex:
|
except Exception as ex:
|
||||||
errMsg = "unable to connect to Google ('%s')" % getSafeExString(ex)
|
errMsg = "unable to connect to Google ('%s')" % getSafeExString(ex)
|
||||||
raise SqlmapConnectionException(errMsg)
|
raise SqlmapConnectionException(errMsg)
|
||||||
|
|
||||||
|
@ -87,10 +87,10 @@ def _search(dork):
|
||||||
responseMsg += "%s\n%s\n" % (responseHeaders, page)
|
responseMsg += "%s\n%s\n" % (responseHeaders, page)
|
||||||
|
|
||||||
logger.log(CUSTOM_LOGGING.TRAFFIC_IN, responseMsg)
|
logger.log(CUSTOM_LOGGING.TRAFFIC_IN, responseMsg)
|
||||||
except urllib2.HTTPError, e:
|
except urllib2.HTTPError as e:
|
||||||
try:
|
try:
|
||||||
page = e.read()
|
page = e.read()
|
||||||
except Exception, ex:
|
except Exception as ex:
|
||||||
warnMsg = "problem occurred while trying to get "
|
warnMsg = "problem occurred while trying to get "
|
||||||
warnMsg += "an error page information (%s)" % getSafeExString(ex)
|
warnMsg += "an error page information (%s)" % getSafeExString(ex)
|
||||||
logger.critical(warnMsg)
|
logger.critical(warnMsg)
|
||||||
|
@ -149,7 +149,7 @@ def _search(dork):
|
||||||
responseMsg += "%s\n%s\n" % (responseHeaders, page)
|
responseMsg += "%s\n%s\n" % (responseHeaders, page)
|
||||||
|
|
||||||
logger.log(CUSTOM_LOGGING.TRAFFIC_IN, responseMsg)
|
logger.log(CUSTOM_LOGGING.TRAFFIC_IN, responseMsg)
|
||||||
except urllib2.HTTPError, e:
|
except urllib2.HTTPError as e:
|
||||||
try:
|
try:
|
||||||
page = e.read()
|
page = e.read()
|
||||||
except socket.timeout:
|
except socket.timeout:
|
||||||
|
@ -171,7 +171,7 @@ def search(dork):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return _search(dork)
|
return _search(dork)
|
||||||
except SqlmapBaseException, ex:
|
except SqlmapBaseException as ex:
|
||||||
if conf.proxyList:
|
if conf.proxyList:
|
||||||
logger.critical(getSafeExString(ex))
|
logger.critical(getSafeExString(ex))
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ class SQLAlchemy(GenericConnector):
|
||||||
raise
|
raise
|
||||||
except SqlmapFilePathException:
|
except SqlmapFilePathException:
|
||||||
raise
|
raise
|
||||||
except Exception, msg:
|
except Exception as msg:
|
||||||
raise SqlmapConnectionException("SQLAlchemy connection issue ('%s')" % msg[0])
|
raise SqlmapConnectionException("SQLAlchemy connection issue ('%s')" % msg[0])
|
||||||
|
|
||||||
self.printConnected()
|
self.printConnected()
|
||||||
|
@ -86,16 +86,16 @@ class SQLAlchemy(GenericConnector):
|
||||||
for row in self.cursor.fetchall():
|
for row in self.cursor.fetchall():
|
||||||
retVal.append(tuple(row))
|
retVal.append(tuple(row))
|
||||||
return retVal
|
return retVal
|
||||||
except _sqlalchemy.exc.ProgrammingError, msg:
|
except _sqlalchemy.exc.ProgrammingError as msg:
|
||||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg.message if hasattr(msg, "message") else msg)
|
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg.message if hasattr(msg, "message") else msg)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def execute(self, query):
|
def execute(self, query):
|
||||||
try:
|
try:
|
||||||
self.cursor = self.connector.execute(query)
|
self.cursor = self.connector.execute(query)
|
||||||
except (_sqlalchemy.exc.OperationalError, _sqlalchemy.exc.ProgrammingError), msg:
|
except (_sqlalchemy.exc.OperationalError, _sqlalchemy.exc.ProgrammingError) as msg:
|
||||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg.message if hasattr(msg, "message") else msg)
|
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg.message if hasattr(msg, "message") else msg)
|
||||||
except _sqlalchemy.exc.InternalError, msg:
|
except _sqlalchemy.exc.InternalError as msg:
|
||||||
raise SqlmapConnectionException(msg[1])
|
raise SqlmapConnectionException(msg[1])
|
||||||
|
|
||||||
def select(self, query):
|
def select(self, query):
|
||||||
|
|
|
@ -22,7 +22,7 @@ def timeout(func, args=(), kwargs={}, duration=1, default=None):
|
||||||
try:
|
try:
|
||||||
self.result = func(*args, **kwargs)
|
self.result = func(*args, **kwargs)
|
||||||
self.timeout_state = TIMEOUT_STATE.NORMAL
|
self.timeout_state = TIMEOUT_STATE.NORMAL
|
||||||
except Exception, msg:
|
except Exception as msg:
|
||||||
logger.log(CUSTOM_LOGGING.TRAFFIC_IN, msg)
|
logger.log(CUSTOM_LOGGING.TRAFFIC_IN, msg)
|
||||||
self.result = default
|
self.result = default
|
||||||
self.timeout_state = TIMEOUT_STATE.EXCEPTION
|
self.timeout_state = TIMEOUT_STATE.EXCEPTION
|
||||||
|
|
|
@ -42,7 +42,7 @@ class Connector(GenericConnector):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.connector = pyodbc.connect('Driver={Microsoft Access Driver (*.mdb)};Dbq=%s;Uid=Admin;Pwd=;' % self.db)
|
self.connector = pyodbc.connect('Driver={Microsoft Access Driver (*.mdb)};Dbq=%s;Uid=Admin;Pwd=;' % self.db)
|
||||||
except (pyodbc.Error, pyodbc.OperationalError), msg:
|
except (pyodbc.Error, pyodbc.OperationalError) as msg:
|
||||||
raise SqlmapConnectionException(msg[1])
|
raise SqlmapConnectionException(msg[1])
|
||||||
|
|
||||||
self.initCursor()
|
self.initCursor()
|
||||||
|
@ -51,16 +51,16 @@ class Connector(GenericConnector):
|
||||||
def fetchall(self):
|
def fetchall(self):
|
||||||
try:
|
try:
|
||||||
return self.cursor.fetchall()
|
return self.cursor.fetchall()
|
||||||
except pyodbc.ProgrammingError, msg:
|
except pyodbc.ProgrammingError as msg:
|
||||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def execute(self, query):
|
def execute(self, query):
|
||||||
try:
|
try:
|
||||||
self.cursor.execute(query)
|
self.cursor.execute(query)
|
||||||
except (pyodbc.OperationalError, pyodbc.ProgrammingError), msg:
|
except (pyodbc.OperationalError, pyodbc.ProgrammingError) as msg:
|
||||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
||||||
except pyodbc.Error, msg:
|
except pyodbc.Error as msg:
|
||||||
raise SqlmapConnectionException(msg[1])
|
raise SqlmapConnectionException(msg[1])
|
||||||
|
|
||||||
self.connector.commit()
|
self.connector.commit()
|
||||||
|
|
|
@ -34,7 +34,7 @@ class Connector(GenericConnector):
|
||||||
try:
|
try:
|
||||||
database = "DRIVER={IBM DB2 ODBC DRIVER};DATABASE=%s;HOSTNAME=%s;PORT=%s;PROTOCOL=TCPIP;" % (self.db, self.hostname, self.port)
|
database = "DRIVER={IBM DB2 ODBC DRIVER};DATABASE=%s;HOSTNAME=%s;PORT=%s;PROTOCOL=TCPIP;" % (self.db, self.hostname, self.port)
|
||||||
self.connector = ibm_db_dbi.connect(database, self.user, self.password)
|
self.connector = ibm_db_dbi.connect(database, self.user, self.password)
|
||||||
except ibm_db_dbi.OperationalError, msg:
|
except ibm_db_dbi.OperationalError as msg:
|
||||||
raise SqlmapConnectionException(msg)
|
raise SqlmapConnectionException(msg)
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,16 +44,16 @@ class Connector(GenericConnector):
|
||||||
def fetchall(self):
|
def fetchall(self):
|
||||||
try:
|
try:
|
||||||
return self.cursor.fetchall()
|
return self.cursor.fetchall()
|
||||||
except ibm_db_dbi.ProgrammingError, msg:
|
except ibm_db_dbi.ProgrammingError as msg:
|
||||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def execute(self, query):
|
def execute(self, query):
|
||||||
try:
|
try:
|
||||||
self.cursor.execute(query)
|
self.cursor.execute(query)
|
||||||
except (ibm_db_dbi.OperationalError, ibm_db_dbi.ProgrammingError), msg:
|
except (ibm_db_dbi.OperationalError, ibm_db_dbi.ProgrammingError) as msg:
|
||||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
||||||
except ibm_db_dbi.InternalError, msg:
|
except ibm_db_dbi.InternalError as msg:
|
||||||
raise SqlmapConnectionException(msg[1])
|
raise SqlmapConnectionException(msg[1])
|
||||||
|
|
||||||
self.connector.commit()
|
self.connector.commit()
|
||||||
|
|
|
@ -41,7 +41,7 @@ class Connector(GenericConnector):
|
||||||
try:
|
try:
|
||||||
self.connector = kinterbasdb.connect(host=self.hostname.encode(UNICODE_ENCODING), database=self.db.encode(UNICODE_ENCODING), \
|
self.connector = kinterbasdb.connect(host=self.hostname.encode(UNICODE_ENCODING), database=self.db.encode(UNICODE_ENCODING), \
|
||||||
user=self.user.encode(UNICODE_ENCODING), password=self.password.encode(UNICODE_ENCODING), charset="UTF8") # Reference: http://www.daniweb.com/forums/thread248499.html
|
user=self.user.encode(UNICODE_ENCODING), password=self.password.encode(UNICODE_ENCODING), charset="UTF8") # Reference: http://www.daniweb.com/forums/thread248499.html
|
||||||
except kinterbasdb.OperationalError, msg:
|
except kinterbasdb.OperationalError as msg:
|
||||||
raise SqlmapConnectionException(msg[1])
|
raise SqlmapConnectionException(msg[1])
|
||||||
|
|
||||||
self.initCursor()
|
self.initCursor()
|
||||||
|
@ -50,16 +50,16 @@ class Connector(GenericConnector):
|
||||||
def fetchall(self):
|
def fetchall(self):
|
||||||
try:
|
try:
|
||||||
return self.cursor.fetchall()
|
return self.cursor.fetchall()
|
||||||
except kinterbasdb.OperationalError, msg:
|
except kinterbasdb.OperationalError as msg:
|
||||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def execute(self, query):
|
def execute(self, query):
|
||||||
try:
|
try:
|
||||||
self.cursor.execute(query)
|
self.cursor.execute(query)
|
||||||
except kinterbasdb.OperationalError, msg:
|
except kinterbasdb.OperationalError as msg:
|
||||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
||||||
except kinterbasdb.Error, msg:
|
except kinterbasdb.Error as msg:
|
||||||
raise SqlmapConnectionException(msg[1])
|
raise SqlmapConnectionException(msg[1])
|
||||||
|
|
||||||
self.connector.commit()
|
self.connector.commit()
|
||||||
|
|
|
@ -41,7 +41,7 @@ class Connector(GenericConnector):
|
||||||
args = "-Djava.class.path=%s" % jar
|
args = "-Djava.class.path=%s" % jar
|
||||||
jvm_path = jpype.getDefaultJVMPath()
|
jvm_path = jpype.getDefaultJVMPath()
|
||||||
jpype.startJVM(jvm_path, args)
|
jpype.startJVM(jvm_path, args)
|
||||||
except Exception, msg:
|
except Exception as msg:
|
||||||
raise SqlmapConnectionException(msg[0])
|
raise SqlmapConnectionException(msg[0])
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -51,7 +51,7 @@ class Connector(GenericConnector):
|
||||||
connection_string,
|
connection_string,
|
||||||
str(self.user),
|
str(self.user),
|
||||||
str(self.password))
|
str(self.password))
|
||||||
except Exception, msg:
|
except Exception as msg:
|
||||||
raise SqlmapConnectionException(msg[0])
|
raise SqlmapConnectionException(msg[0])
|
||||||
|
|
||||||
self.initCursor()
|
self.initCursor()
|
||||||
|
@ -60,7 +60,7 @@ class Connector(GenericConnector):
|
||||||
def fetchall(self):
|
def fetchall(self):
|
||||||
try:
|
try:
|
||||||
return self.cursor.fetchall()
|
return self.cursor.fetchall()
|
||||||
except Exception, msg:
|
except Exception as msg:
|
||||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ class Connector(GenericConnector):
|
||||||
try:
|
try:
|
||||||
self.cursor.execute(query)
|
self.cursor.execute(query)
|
||||||
retVal = True
|
retVal = True
|
||||||
except Exception, msg: #todo fix with specific error
|
except Exception as msg: #todo fix with specific error
|
||||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
||||||
|
|
||||||
self.connector.commit()
|
self.connector.commit()
|
||||||
|
|
|
@ -34,7 +34,7 @@ class Connector(GenericConnector):
|
||||||
try:
|
try:
|
||||||
database = "DATABASE=%s;HOSTNAME=%s;PORT=%s;PROTOCOL=TCPIP;" % (self.db, self.hostname, self.port)
|
database = "DATABASE=%s;HOSTNAME=%s;PORT=%s;PROTOCOL=TCPIP;" % (self.db, self.hostname, self.port)
|
||||||
self.connector = ibm_db_dbi.connect(database, self.user, self.password)
|
self.connector = ibm_db_dbi.connect(database, self.user, self.password)
|
||||||
except ibm_db_dbi.OperationalError, msg:
|
except ibm_db_dbi.OperationalError as msg:
|
||||||
raise SqlmapConnectionException(msg)
|
raise SqlmapConnectionException(msg)
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,16 +44,16 @@ class Connector(GenericConnector):
|
||||||
def fetchall(self):
|
def fetchall(self):
|
||||||
try:
|
try:
|
||||||
return self.cursor.fetchall()
|
return self.cursor.fetchall()
|
||||||
except ibm_db_dbi.ProgrammingError, msg:
|
except ibm_db_dbi.ProgrammingError as msg:
|
||||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def execute(self, query):
|
def execute(self, query):
|
||||||
try:
|
try:
|
||||||
self.cursor.execute(query)
|
self.cursor.execute(query)
|
||||||
except (ibm_db_dbi.OperationalError, ibm_db_dbi.ProgrammingError), msg:
|
except (ibm_db_dbi.OperationalError, ibm_db_dbi.ProgrammingError) as msg:
|
||||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
||||||
except ibm_db_dbi.InternalError, msg:
|
except ibm_db_dbi.InternalError as msg:
|
||||||
raise SqlmapConnectionException(msg[1])
|
raise SqlmapConnectionException(msg[1])
|
||||||
|
|
||||||
self.connector.commit()
|
self.connector.commit()
|
||||||
|
|
|
@ -41,7 +41,7 @@ class Connector(GenericConnector):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.connector = pymssql.connect(host="%s:%d" % (self.hostname, self.port), user=self.user, password=self.password, database=self.db, login_timeout=conf.timeout, timeout=conf.timeout)
|
self.connector = pymssql.connect(host="%s:%d" % (self.hostname, self.port), user=self.user, password=self.password, database=self.db, login_timeout=conf.timeout, timeout=conf.timeout)
|
||||||
except (pymssql.Error, _mssql.MssqlDatabaseException), msg:
|
except (pymssql.Error, _mssql.MssqlDatabaseException) as msg:
|
||||||
raise SqlmapConnectionException(msg)
|
raise SqlmapConnectionException(msg)
|
||||||
|
|
||||||
self.initCursor()
|
self.initCursor()
|
||||||
|
@ -50,7 +50,7 @@ class Connector(GenericConnector):
|
||||||
def fetchall(self):
|
def fetchall(self):
|
||||||
try:
|
try:
|
||||||
return self.cursor.fetchall()
|
return self.cursor.fetchall()
|
||||||
except (pymssql.Error, _mssql.MssqlDatabaseException), msg:
|
except (pymssql.Error, _mssql.MssqlDatabaseException) as msg:
|
||||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % str(msg).replace("\n", " "))
|
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % str(msg).replace("\n", " "))
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -60,9 +60,9 @@ class Connector(GenericConnector):
|
||||||
try:
|
try:
|
||||||
self.cursor.execute(utf8encode(query))
|
self.cursor.execute(utf8encode(query))
|
||||||
retVal = True
|
retVal = True
|
||||||
except (pymssql.OperationalError, pymssql.ProgrammingError), msg:
|
except (pymssql.OperationalError, pymssql.ProgrammingError) as msg:
|
||||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % str(msg).replace("\n", " "))
|
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % str(msg).replace("\n", " "))
|
||||||
except pymssql.InternalError, msg:
|
except pymssql.InternalError as msg:
|
||||||
raise SqlmapConnectionException(msg)
|
raise SqlmapConnectionException(msg)
|
||||||
|
|
||||||
return retVal
|
return retVal
|
||||||
|
|
|
@ -37,9 +37,9 @@ class Connector(GenericConnector):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.connector = pymysql.connect(host=self.hostname, user=self.user, passwd=self.password, db=self.db, port=self.port, connect_timeout=conf.timeout, use_unicode=True)
|
self.connector = pymysql.connect(host=self.hostname, user=self.user, passwd=self.password, db=self.db, port=self.port, connect_timeout=conf.timeout, use_unicode=True)
|
||||||
except (pymysql.OperationalError, pymysql.InternalError), msg:
|
except (pymysql.OperationalError, pymysql.InternalError) as msg:
|
||||||
raise SqlmapConnectionException(msg[1])
|
raise SqlmapConnectionException(msg[1])
|
||||||
except struct.error, msg:
|
except struct.error as msg:
|
||||||
raise SqlmapConnectionException(msg)
|
raise SqlmapConnectionException(msg)
|
||||||
|
|
||||||
self.initCursor()
|
self.initCursor()
|
||||||
|
@ -48,7 +48,7 @@ class Connector(GenericConnector):
|
||||||
def fetchall(self):
|
def fetchall(self):
|
||||||
try:
|
try:
|
||||||
return self.cursor.fetchall()
|
return self.cursor.fetchall()
|
||||||
except pymysql.ProgrammingError, msg:
|
except pymysql.ProgrammingError as msg:
|
||||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -58,9 +58,9 @@ class Connector(GenericConnector):
|
||||||
try:
|
try:
|
||||||
self.cursor.execute(query)
|
self.cursor.execute(query)
|
||||||
retVal = True
|
retVal = True
|
||||||
except (pymysql.OperationalError, pymysql.ProgrammingError), msg:
|
except (pymysql.OperationalError, pymysql.ProgrammingError) as msg:
|
||||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1])
|
||||||
except pymysql.InternalError, msg:
|
except pymysql.InternalError as msg:
|
||||||
raise SqlmapConnectionException(msg[1])
|
raise SqlmapConnectionException(msg[1])
|
||||||
|
|
||||||
self.connector.commit()
|
self.connector.commit()
|
||||||
|
|
|
@ -43,7 +43,7 @@ class Connector(GenericConnector):
|
||||||
try:
|
try:
|
||||||
self.connector = cx_Oracle.connect(dsn=self.__dsn, user=self.user, password=self.password, mode=cx_Oracle.SYSDBA)
|
self.connector = cx_Oracle.connect(dsn=self.__dsn, user=self.user, password=self.password, mode=cx_Oracle.SYSDBA)
|
||||||
logger.info("successfully connected as SYSDBA")
|
logger.info("successfully connected as SYSDBA")
|
||||||
except (cx_Oracle.OperationalError, cx_Oracle.DatabaseError, cx_Oracle.InterfaceError), ex:
|
except (cx_Oracle.OperationalError, cx_Oracle.DatabaseError, cx_Oracle.InterfaceError) as ex:
|
||||||
if "Oracle Client library" in str(ex):
|
if "Oracle Client library" in str(ex):
|
||||||
msg = re.sub(r"DPI-\d+:\s+", "", str(ex))
|
msg = re.sub(r"DPI-\d+:\s+", "", str(ex))
|
||||||
msg = re.sub(r': ("[^"]+")', r" (\g<1>)", msg)
|
msg = re.sub(r': ("[^"]+")', r" (\g<1>)", msg)
|
||||||
|
@ -52,7 +52,7 @@ class Connector(GenericConnector):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.connector = cx_Oracle.connect(dsn=self.__dsn, user=self.user, password=self.password)
|
self.connector = cx_Oracle.connect(dsn=self.__dsn, user=self.user, password=self.password)
|
||||||
except (cx_Oracle.OperationalError, cx_Oracle.DatabaseError, cx_Oracle.InterfaceError), msg:
|
except (cx_Oracle.OperationalError, cx_Oracle.DatabaseError, cx_Oracle.InterfaceError) as msg:
|
||||||
raise SqlmapConnectionException(msg)
|
raise SqlmapConnectionException(msg)
|
||||||
|
|
||||||
self.initCursor()
|
self.initCursor()
|
||||||
|
@ -61,7 +61,7 @@ class Connector(GenericConnector):
|
||||||
def fetchall(self):
|
def fetchall(self):
|
||||||
try:
|
try:
|
||||||
return self.cursor.fetchall()
|
return self.cursor.fetchall()
|
||||||
except cx_Oracle.InterfaceError, msg:
|
except cx_Oracle.InterfaceError as msg:
|
||||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg)
|
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ class Connector(GenericConnector):
|
||||||
try:
|
try:
|
||||||
self.cursor.execute(utf8encode(query))
|
self.cursor.execute(utf8encode(query))
|
||||||
retVal = True
|
retVal = True
|
||||||
except cx_Oracle.DatabaseError, msg:
|
except cx_Oracle.DatabaseError as msg:
|
||||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg)
|
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg)
|
||||||
|
|
||||||
self.connector.commit()
|
self.connector.commit()
|
||||||
|
|
|
@ -36,7 +36,7 @@ class Connector(GenericConnector):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.connector = psycopg2.connect(host=self.hostname, user=self.user, password=self.password, database=self.db, port=self.port)
|
self.connector = psycopg2.connect(host=self.hostname, user=self.user, password=self.password, database=self.db, port=self.port)
|
||||||
except psycopg2.OperationalError, msg:
|
except psycopg2.OperationalError as msg:
|
||||||
raise SqlmapConnectionException(msg)
|
raise SqlmapConnectionException(msg)
|
||||||
|
|
||||||
self.connector.set_client_encoding('UNICODE')
|
self.connector.set_client_encoding('UNICODE')
|
||||||
|
@ -47,7 +47,7 @@ class Connector(GenericConnector):
|
||||||
def fetchall(self):
|
def fetchall(self):
|
||||||
try:
|
try:
|
||||||
return self.cursor.fetchall()
|
return self.cursor.fetchall()
|
||||||
except psycopg2.ProgrammingError, msg:
|
except psycopg2.ProgrammingError as msg:
|
||||||
logger.warn(msg)
|
logger.warn(msg)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -57,9 +57,9 @@ class Connector(GenericConnector):
|
||||||
try:
|
try:
|
||||||
self.cursor.execute(query)
|
self.cursor.execute(query)
|
||||||
retVal = True
|
retVal = True
|
||||||
except (psycopg2.OperationalError, psycopg2.ProgrammingError), msg:
|
except (psycopg2.OperationalError, psycopg2.ProgrammingError) as msg:
|
||||||
logger.warn(("(remote) %s" % msg).strip())
|
logger.warn(("(remote) %s" % msg).strip())
|
||||||
except psycopg2.InternalError, msg:
|
except psycopg2.InternalError as msg:
|
||||||
raise SqlmapConnectionException(msg)
|
raise SqlmapConnectionException(msg)
|
||||||
|
|
||||||
self.connector.commit()
|
self.connector.commit()
|
||||||
|
|
|
@ -46,7 +46,7 @@ class Connector(GenericConnector):
|
||||||
cursor.execute("SELECT * FROM sqlite_master")
|
cursor.execute("SELECT * FROM sqlite_master")
|
||||||
cursor.close()
|
cursor.close()
|
||||||
|
|
||||||
except (self.__sqlite.DatabaseError, self.__sqlite.OperationalError), msg:
|
except (self.__sqlite.DatabaseError, self.__sqlite.OperationalError) as msg:
|
||||||
warnMsg = "unable to connect using SQLite 3 library, trying with SQLite 2"
|
warnMsg = "unable to connect using SQLite 3 library, trying with SQLite 2"
|
||||||
logger.warn(warnMsg)
|
logger.warn(warnMsg)
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ class Connector(GenericConnector):
|
||||||
|
|
||||||
self.__sqlite = sqlite
|
self.__sqlite = sqlite
|
||||||
self.connector = self.__sqlite.connect(database=self.db, check_same_thread=False, timeout=conf.timeout)
|
self.connector = self.__sqlite.connect(database=self.db, check_same_thread=False, timeout=conf.timeout)
|
||||||
except (self.__sqlite.DatabaseError, self.__sqlite.OperationalError), msg:
|
except (self.__sqlite.DatabaseError, self.__sqlite.OperationalError) as msg:
|
||||||
raise SqlmapConnectionException(msg[0])
|
raise SqlmapConnectionException(msg[0])
|
||||||
|
|
||||||
self.initCursor()
|
self.initCursor()
|
||||||
|
@ -69,16 +69,16 @@ class Connector(GenericConnector):
|
||||||
def fetchall(self):
|
def fetchall(self):
|
||||||
try:
|
try:
|
||||||
return self.cursor.fetchall()
|
return self.cursor.fetchall()
|
||||||
except self.__sqlite.OperationalError, msg:
|
except self.__sqlite.OperationalError as msg:
|
||||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[0])
|
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[0])
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def execute(self, query):
|
def execute(self, query):
|
||||||
try:
|
try:
|
||||||
self.cursor.execute(utf8encode(query))
|
self.cursor.execute(utf8encode(query))
|
||||||
except self.__sqlite.OperationalError, msg:
|
except self.__sqlite.OperationalError as msg:
|
||||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[0])
|
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[0])
|
||||||
except self.__sqlite.DatabaseError, msg:
|
except self.__sqlite.DatabaseError as msg:
|
||||||
raise SqlmapConnectionException(msg[0])
|
raise SqlmapConnectionException(msg[0])
|
||||||
|
|
||||||
self.connector.commit()
|
self.connector.commit()
|
||||||
|
|
|
@ -41,7 +41,7 @@ class Connector(GenericConnector):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.connector = pymssql.connect(host="%s:%d" % (self.hostname, self.port), user=self.user, password=self.password, database=self.db, login_timeout=conf.timeout, timeout=conf.timeout)
|
self.connector = pymssql.connect(host="%s:%d" % (self.hostname, self.port), user=self.user, password=self.password, database=self.db, login_timeout=conf.timeout, timeout=conf.timeout)
|
||||||
except (pymssql.Error, _mssql.MssqlDatabaseException), msg:
|
except (pymssql.Error, _mssql.MssqlDatabaseException) as msg:
|
||||||
raise SqlmapConnectionException(msg)
|
raise SqlmapConnectionException(msg)
|
||||||
|
|
||||||
self.initCursor()
|
self.initCursor()
|
||||||
|
@ -50,7 +50,7 @@ class Connector(GenericConnector):
|
||||||
def fetchall(self):
|
def fetchall(self):
|
||||||
try:
|
try:
|
||||||
return self.cursor.fetchall()
|
return self.cursor.fetchall()
|
||||||
except (pymssql.Error, _mssql.MssqlDatabaseException), msg:
|
except (pymssql.Error, _mssql.MssqlDatabaseException) as msg:
|
||||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % str(msg).replace("\n", " "))
|
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % str(msg).replace("\n", " "))
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -60,9 +60,9 @@ class Connector(GenericConnector):
|
||||||
try:
|
try:
|
||||||
self.cursor.execute(utf8encode(query))
|
self.cursor.execute(utf8encode(query))
|
||||||
retVal = True
|
retVal = True
|
||||||
except (pymssql.OperationalError, pymssql.ProgrammingError), msg:
|
except (pymssql.OperationalError, pymssql.ProgrammingError) as msg:
|
||||||
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % str(msg).replace("\n", " "))
|
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % str(msg).replace("\n", " "))
|
||||||
except pymssql.InternalError, msg:
|
except pymssql.InternalError as msg:
|
||||||
raise SqlmapConnectionException(msg)
|
raise SqlmapConnectionException(msg)
|
||||||
|
|
||||||
return retVal
|
return retVal
|
||||||
|
|
|
@ -50,7 +50,7 @@ class Connector:
|
||||||
self.cursor.close()
|
self.cursor.close()
|
||||||
if self.connector:
|
if self.connector:
|
||||||
self.connector.close()
|
self.connector.close()
|
||||||
except Exception, msg:
|
except Exception as msg:
|
||||||
logger.debug(msg)
|
logger.debug(msg)
|
||||||
finally:
|
finally:
|
||||||
self.closed()
|
self.closed()
|
||||||
|
|
|
@ -70,7 +70,7 @@ class Custom:
|
||||||
|
|
||||||
output = NULL
|
output = NULL
|
||||||
|
|
||||||
except SqlmapNoneDataException, ex:
|
except SqlmapNoneDataException as ex:
|
||||||
logger.warn(ex)
|
logger.warn(ex)
|
||||||
|
|
||||||
return output
|
return output
|
||||||
|
|
|
@ -424,13 +424,13 @@ class Entries:
|
||||||
"db": safeSQLIdentificatorNaming(conf.db)}
|
"db": safeSQLIdentificatorNaming(conf.db)}
|
||||||
try:
|
try:
|
||||||
attackDumpedTable()
|
attackDumpedTable()
|
||||||
except (IOError, OSError), ex:
|
except (IOError, OSError) as ex:
|
||||||
errMsg = "an error occurred while attacking "
|
errMsg = "an error occurred while attacking "
|
||||||
errMsg += "table dump ('%s')" % getSafeExString(ex)
|
errMsg += "table dump ('%s')" % getSafeExString(ex)
|
||||||
logger.critical(errMsg)
|
logger.critical(errMsg)
|
||||||
conf.dumper.dbTableValues(kb.data.dumpedTable)
|
conf.dumper.dbTableValues(kb.data.dumpedTable)
|
||||||
|
|
||||||
except SqlmapConnectionException, ex:
|
except SqlmapConnectionException as ex:
|
||||||
errMsg = "connection exception detected in dumping phase "
|
errMsg = "connection exception detected in dumping phase "
|
||||||
errMsg += "('%s')" % getSafeExString(ex)
|
errMsg += "('%s')" % getSafeExString(ex)
|
||||||
logger.critical(errMsg)
|
logger.critical(errMsg)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user