diff --git a/lib/core/dump.py b/lib/core/dump.py index 0ebba1a5c..6a2f04db3 100644 --- a/lib/core/dump.py +++ b/lib/core/dump.py @@ -503,10 +503,10 @@ class Dump: if tbl in _[db]: _[db][tbl][col] = dataType else: - _[db][tbl] = { col: dataType } + _[db][tbl] = {col: dataType} else: _[db] = {} - _[db][tbl] = { col: dataType } + _[db][tbl] = {col: dataType} continue diff --git a/lib/core/settings.py b/lib/core/settings.py index 7a5929bdd..d7b7edcab 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -161,16 +161,17 @@ DBMS_DIRECTORY_DICT = dict((getattr(DBMS, _), getattr(DBMS_DIRECTORY_NAME, _)) f SUPPORTED_DBMS = MSSQL_ALIASES + MYSQL_ALIASES + PGSQL_ALIASES + ORACLE_ALIASES + SQLITE_ALIASES + ACCESS_ALIASES + FIREBIRD_ALIASES + MAXDB_ALIASES + SYBASE_ALIASES + DB2_ALIASES SUPPORTED_OS = ( "linux", "windows" ) -DBMS_DICT = { DBMS.MSSQL: (MSSQL_ALIASES, "python-pymssql", "http://pymssql.sourceforge.net/"), - DBMS.MYSQL: (MYSQL_ALIASES, "python pymysql", "http://code.google.com/p/pymysql/"), - DBMS.PGSQL: (PGSQL_ALIASES, "python-psycopg2", "http://initd.org/psycopg/"), - DBMS.ORACLE: (ORACLE_ALIASES, "python cx_Oracle", "http://cx-oracle.sourceforge.net/"), - DBMS.SQLITE: (SQLITE_ALIASES, "python-pysqlite2", "http://pysqlite.googlecode.com/"), - DBMS.ACCESS: (ACCESS_ALIASES, "python-pyodbc", "http://pyodbc.googlecode.com/"), - DBMS.FIREBIRD: (FIREBIRD_ALIASES, "python-kinterbasdb", "http://kinterbasdb.sourceforge.net/"), - DBMS.MAXDB: (MAXDB_ALIASES, None, None), - DBMS.SYBASE: (SYBASE_ALIASES, "python-pymssql", "http://pymssql.sourceforge.net/"), - DBMS.DB2: (DB2_ALIASES, "python ibm-db", "http://code.google.com/p/ibm-db/") +DBMS_DICT = { + DBMS.MSSQL: (MSSQL_ALIASES, "python-pymssql", "http://pymssql.sourceforge.net/"), + DBMS.MYSQL: (MYSQL_ALIASES, "python pymysql", "http://code.google.com/p/pymysql/"), + DBMS.PGSQL: (PGSQL_ALIASES, "python-psycopg2", "http://initd.org/psycopg/"), + DBMS.ORACLE: (ORACLE_ALIASES, "python cx_Oracle", "http://cx-oracle.sourceforge.net/"), + DBMS.SQLITE: (SQLITE_ALIASES, "python-pysqlite2", "http://pysqlite.googlecode.com/"), + DBMS.ACCESS: (ACCESS_ALIASES, "python-pyodbc", "http://pyodbc.googlecode.com/"), + DBMS.FIREBIRD: (FIREBIRD_ALIASES, "python-kinterbasdb", "http://kinterbasdb.sourceforge.net/"), + DBMS.MAXDB: (MAXDB_ALIASES, None, None), + DBMS.SYBASE: (SYBASE_ALIASES, "python-pymssql", "http://pymssql.sourceforge.net/"), + DBMS.DB2: (DB2_ALIASES, "python ibm-db", "http://code.google.com/p/ibm-db/") } USER_AGENT_ALIASES = ( "ua", "useragent", "user-agent" ) @@ -178,11 +179,11 @@ REFERER_ALIASES = ( "ref", "referer", "referrer" ) HOST_ALIASES = ( "host", ) FROM_DUMMY_TABLE = { - DBMS.ORACLE: " FROM DUAL", - DBMS.ACCESS: " FROM MSysAccessObjects", - DBMS.FIREBIRD: " FROM RDB$DATABASE", - DBMS.MAXDB: " FROM VERSIONS", - DBMS.DB2: " FROM SYSIBM.SYSDUMMY1" + DBMS.ORACLE: " FROM DUAL", + DBMS.ACCESS: " FROM MSysAccessObjects", + DBMS.FIREBIRD: " FROM RDB$DATABASE", + DBMS.MAXDB: " FROM VERSIONS", + DBMS.DB2: " FROM SYSIBM.SYSDUMMY1" } SQL_STATEMENTS = { diff --git a/lib/core/target.py b/lib/core/target.py index 6c90fda71..777498dc8 100644 --- a/lib/core/target.py +++ b/lib/core/target.py @@ -83,10 +83,7 @@ def __setRequestParams(): else: conf.data = conf.data.replace("\n", " ") - if re.match(SOAP_REGEX, conf.data, re.I | re.M): - place = PLACE.SOAP - else: - place = PLACE.POST + place = PLACE.SOAP if re.match(SOAP_REGEX, conf.data, re.I | re.M) else PLACE.POST conf.parameters[place] = conf.data paramDict = paramToDict(place, conf.data) @@ -167,7 +164,7 @@ def __setRequestParams(): condition = any((not conf.testParameter, intersect(conf.testParameter, USER_AGENT_ALIASES))) if condition: - conf.paramDict[PLACE.UA] = { PLACE.UA: headerValue } + conf.paramDict[PLACE.UA] = {PLACE.UA: headerValue} testableParameters = True elif httpHeader == PLACE.REFERER: @@ -176,7 +173,7 @@ def __setRequestParams(): condition = any((not conf.testParameter, intersect(conf.testParameter, REFERER_ALIASES))) if condition: - conf.paramDict[PLACE.REFERER] = { PLACE.REFERER: headerValue } + conf.paramDict[PLACE.REFERER] = {PLACE.REFERER: headerValue} testableParameters = True elif httpHeader == PLACE.HOST: @@ -185,7 +182,7 @@ def __setRequestParams(): condition = any((not conf.testParameter, intersect(conf.testParameter, HOST_ALIASES))) if condition: - conf.paramDict[PLACE.HOST] = { PLACE.HOST: headerValue } + conf.paramDict[PLACE.HOST] = {PLACE.HOST: headerValue} testableParameters = True if not conf.parameters: diff --git a/lib/request/connect.py b/lib/request/connect.py index 35a5b6879..9060cb292 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -256,7 +256,7 @@ class Connect: requestMsg += " %s" % httplib.HTTPConnection._http_vsn_str # Prepare HTTP headers - headers = forgeHeaders({ HTTPHEADER.COOKIE: cookie, HTTPHEADER.USER_AGENT: ua, HTTPHEADER.REFERER: referer }) + headers = forgeHeaders({HTTPHEADER.COOKIE: cookie, HTTPHEADER.USER_AGENT: ua, HTTPHEADER.REFERER: referer}) if conf.realTest: headers[HTTPHEADER.REFERER] = "%s://%s" % (conf.scheme, conf.hostname) diff --git a/plugins/dbms/maxdb/enumeration.py b/plugins/dbms/maxdb/enumeration.py index ccca5a791..e77cc69dd 100644 --- a/plugins/dbms/maxdb/enumeration.py +++ b/plugins/dbms/maxdb/enumeration.py @@ -138,7 +138,7 @@ class Enumeration(GenericEnumeration): infoMsg += "database '%s'" % unsafeSQLIdentificatorNaming(conf.db) logger.info(infoMsg) - return { conf.db: kb.data.cachedColumns[conf.db]} + return {conf.db: kb.data.cachedColumns[conf.db]} infoMsg = "fetching columns " infoMsg += "for table '%s' " % unsafeSQLIdentificatorNaming(tbl) diff --git a/plugins/dbms/sybase/enumeration.py b/plugins/dbms/sybase/enumeration.py index e9f9b7bb3..7ce4b8328 100644 --- a/plugins/dbms/sybase/enumeration.py +++ b/plugins/dbms/sybase/enumeration.py @@ -216,7 +216,7 @@ class Enumeration(GenericEnumeration): infoMsg += "database '%s'" % unsafeSQLIdentificatorNaming(conf.db) logger.info(infoMsg) - return { conf.db: kb.data.cachedColumns[conf.db]} + return {conf.db: kb.data.cachedColumns[conf.db]} if colList: table = {}