mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 12:41:30 +00:00
Taking some goodies from Pull request #284
This commit is contained in:
@@ -168,7 +168,6 @@ class XMLDump:
|
||||
lstElem = self.__doc.createElement(LST_ELEM_NAME)
|
||||
lstElem.setAttributeNode(self.__createAttribute(TYPE_ATTR, header))
|
||||
if elements:
|
||||
|
||||
if sort:
|
||||
try:
|
||||
elements = set(elements)
|
||||
@@ -525,6 +524,7 @@ class XMLDump:
|
||||
self.__write(prettyprint.formatXML(self.__doc, encoding=UNICODE_ENCODING))
|
||||
self.__outputFP.close()
|
||||
|
||||
|
||||
def closeDumper(status, msg=""):
|
||||
"""
|
||||
Closes the dumper of the session
|
||||
|
||||
@@ -18,7 +18,7 @@ class HTTPRangeHandler(urllib2.BaseHandler):
|
||||
|
||||
This was extremely simple. The Range header is a HTTP feature to
|
||||
begin with so all this class does is tell urllib2 that the
|
||||
"206 Partial Content" reponse from the HTTP server is what we
|
||||
"206 Partial Content" response from the HTTP server is what we
|
||||
expected.
|
||||
|
||||
Example:
|
||||
|
||||
@@ -39,7 +39,7 @@ def checkDependencies():
|
||||
import pyodbc
|
||||
elif dbmsName == DBMS.FIREBIRD:
|
||||
import kinterbasdb
|
||||
except ImportError, _:
|
||||
except ImportError:
|
||||
warnMsg = "sqlmap requires '%s' third-party library " % data[1]
|
||||
warnMsg += "in order to directly connect to the database "
|
||||
warnMsg += "%s. Download from %s" % (dbmsName, data[2])
|
||||
@@ -55,7 +55,7 @@ def checkDependencies():
|
||||
import impacket
|
||||
debugMsg = "'python-impacket' third-party library is found"
|
||||
logger.debug(debugMsg)
|
||||
except ImportError, _:
|
||||
except ImportError:
|
||||
warnMsg = "sqlmap requires 'python-impacket' third-party library for "
|
||||
warnMsg += "out-of-band takeover feature. Download from "
|
||||
warnMsg += "http://code.google.com/p/impacket/"
|
||||
@@ -66,7 +66,7 @@ def checkDependencies():
|
||||
import ntlm
|
||||
debugMsg = "'python-ntlm' third-party library is found"
|
||||
logger.debug(debugMsg)
|
||||
except ImportError, _:
|
||||
except ImportError:
|
||||
warnMsg = "sqlmap requires 'python-ntlm' third-party library for "
|
||||
warnMsg += "if you plan to attack a web application behind NTLM "
|
||||
warnMsg += "authentication. Download from http://code.google.com/p/python-ntlm/"
|
||||
@@ -78,7 +78,7 @@ def checkDependencies():
|
||||
import pyreadline
|
||||
debugMsg = "'python-pyreadline' third-party library is found"
|
||||
logger.debug(debugMsg)
|
||||
except ImportError, _:
|
||||
except ImportError:
|
||||
warnMsg = "sqlmap requires 'pyreadline' third-party library to "
|
||||
warnMsg += "be able to take advantage of the sqlmap TAB "
|
||||
warnMsg += "completion and history support features in the SQL "
|
||||
|
||||
@@ -7,7 +7,7 @@ See the file 'doc/COPYING' for copying permission
|
||||
|
||||
try:
|
||||
from crypt import crypt
|
||||
except ImportError, _:
|
||||
except ImportError:
|
||||
from thirdparty.fcrypt.fcrypt import crypt
|
||||
|
||||
_multiprocessing = None
|
||||
|
||||
@@ -7,7 +7,7 @@ See the file 'doc/COPYING' for copying permission
|
||||
|
||||
try:
|
||||
import pyodbc
|
||||
except ImportError, _:
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
import logging
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
$Id$
|
||||
|
||||
Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
@@ -7,7 +7,7 @@ See the file 'doc/COPYING' for copying permission
|
||||
|
||||
try:
|
||||
import ibm_db_dbi
|
||||
except ImportError, _:
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
import logging
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
$Id$
|
||||
|
||||
Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
$Id$
|
||||
|
||||
Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
|
||||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
@@ -7,7 +7,7 @@ See the file 'doc/COPYING' for copying permission
|
||||
|
||||
try:
|
||||
import kinterbasdb
|
||||
except ImportError, _:
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
import logging
|
||||
|
||||
@@ -8,7 +8,7 @@ See the file 'doc/COPYING' for copying permission
|
||||
try:
|
||||
import _mssql
|
||||
import pymssql
|
||||
except ImportError, _:
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
import logging
|
||||
|
||||
@@ -7,7 +7,7 @@ See the file 'doc/COPYING' for copying permission
|
||||
|
||||
try:
|
||||
import pymysql
|
||||
except ImportError, _:
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
import logging
|
||||
|
||||
@@ -7,7 +7,7 @@ See the file 'doc/COPYING' for copying permission
|
||||
|
||||
try:
|
||||
import cx_Oracle
|
||||
except ImportError, _:
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
import logging
|
||||
|
||||
@@ -164,4 +164,4 @@ class Enumeration(GenericEnumeration):
|
||||
errMsg += "for the database users"
|
||||
raise sqlmapNoneDataException, errMsg
|
||||
|
||||
return ( kb.data.cachedUsersRoles, areAdmins )
|
||||
return kb.data.cachedUsersRoles, areAdmins
|
||||
|
||||
@@ -10,7 +10,7 @@ try:
|
||||
import psycopg2.extensions
|
||||
psycopg2.extensions.register_type(psycopg2.extensions.UNICODE)
|
||||
psycopg2.extensions.register_type(psycopg2.extensions.UNICODEARRAY)
|
||||
except ImportError, _:
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
from lib.core.data import logger
|
||||
|
||||
@@ -7,7 +7,7 @@ See the file 'doc/COPYING' for copying permission
|
||||
|
||||
try:
|
||||
import sqlite3
|
||||
except ImportError, _:
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
import logging
|
||||
@@ -53,7 +53,7 @@ class Connector(GenericConnector):
|
||||
try:
|
||||
try:
|
||||
import sqlite
|
||||
except ImportError, _:
|
||||
except ImportError:
|
||||
errMsg = "sqlmap requires 'python-sqlite2' third-party library "
|
||||
errMsg += "in order to directly connect to the database '%s'" % self.db
|
||||
raise sqlmapMissingDependence, errMsg
|
||||
|
||||
@@ -8,7 +8,7 @@ See the file 'doc/COPYING' for copying permission
|
||||
try:
|
||||
import _mssql
|
||||
import pymssql
|
||||
except ImportError, _:
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
import logging
|
||||
|
||||
@@ -129,7 +129,7 @@ class Takeover(Abstraction, Metasploit, ICMPsh, Registry, Miscellaneous):
|
||||
try:
|
||||
from impacket import ImpactDecoder
|
||||
from impacket import ImpactPacket
|
||||
except ImportError, _:
|
||||
except ImportError:
|
||||
errMsg = "sqlmap requires 'impacket' third-party library "
|
||||
errMsg += "in order to run icmpsh master. Download from "
|
||||
errMsg += "http://oss.coresecurity.com/projects/impacket.html"
|
||||
|
||||
Reference in New Issue
Block a user