From c2a6f210959b5723f5e91a338f282b18fedcc5ae Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 30 Mar 2010 13:03:19 +0000 Subject: [PATCH] refactoring regarding usage of conf.dbmsConnector.connect() --- lib/controller/action.py | 3 +++ plugins/dbms/access/fingerprint.py | 3 --- plugins/dbms/firebird/fingerprint.py | 3 --- plugins/dbms/mysql/fingerprint.py | 3 --- plugins/dbms/oracle/fingerprint.py | 3 --- plugins/dbms/postgresql/fingerprint.py | 3 --- plugins/dbms/sqlite/fingerprint.py | 3 --- 7 files changed, 3 insertions(+), 18 deletions(-) diff --git a/lib/controller/action.py b/lib/controller/action.py index d1f7e737f..3cd59a674 100644 --- a/lib/controller/action.py +++ b/lib/controller/action.py @@ -65,6 +65,9 @@ def action(): raise sqlmapUnsupportedDBMSException, errMsg + if conf.direct: + conf.dbmsConnector.connect() + print "%s\n" % conf.dbmsHandler.getFingerprint() # Techniques options diff --git a/plugins/dbms/access/fingerprint.py b/plugins/dbms/access/fingerprint.py index 417bf79bf..23f1c5054 100644 --- a/plugins/dbms/access/fingerprint.py +++ b/plugins/dbms/access/fingerprint.py @@ -145,9 +145,6 @@ class Fingerprint(GenericFingerprint): logMsg = "testing Microsoft Access" logger.info(logMsg) - - if conf.direct: - conf.dbmsConnector.connect() payload = agent.fullPayload(" AND VAL(CVAR(1))=1") result = Request.queryPage(payload) diff --git a/plugins/dbms/firebird/fingerprint.py b/plugins/dbms/firebird/fingerprint.py index 002d54d54..8091c54e8 100644 --- a/plugins/dbms/firebird/fingerprint.py +++ b/plugins/dbms/firebird/fingerprint.py @@ -127,9 +127,6 @@ class Fingerprint(GenericFingerprint): logMsg = "testing Firebird" logger.info(logMsg) - if conf.direct: - conf.dbmsConnector.connect() - randInt = randomInt() payload = agent.fullPayload(" AND EXISTS(SELECT * FROM RDB$DATABASE WHERE %d=%d)" % (randInt, randInt)) diff --git a/plugins/dbms/mysql/fingerprint.py b/plugins/dbms/mysql/fingerprint.py index 7a4cc57da..eca88c568 100644 --- a/plugins/dbms/mysql/fingerprint.py +++ b/plugins/dbms/mysql/fingerprint.py @@ -157,9 +157,6 @@ class Fingerprint(GenericFingerprint): infoMsg = "testing MySQL" logger.info(infoMsg) - if conf.direct: - conf.dbmsConnector.connect() - if conf.dbms in MYSQL_ALIASES and kb.dbmsVersion and kb.dbmsVersion[0].isdigit(): setDbms("MySQL %s" % kb.dbmsVersion[0]) diff --git a/plugins/dbms/oracle/fingerprint.py b/plugins/dbms/oracle/fingerprint.py index 384e3d3b3..08a945461 100644 --- a/plugins/dbms/oracle/fingerprint.py +++ b/plugins/dbms/oracle/fingerprint.py @@ -81,9 +81,6 @@ class Fingerprint(GenericFingerprint): logMsg = "testing Oracle" logger.info(logMsg) - if conf.direct: - conf.dbmsConnector.connect() - if conf.dbms in ORACLE_ALIASES: setDbms("Oracle") diff --git a/plugins/dbms/postgresql/fingerprint.py b/plugins/dbms/postgresql/fingerprint.py index a8ebe2303..69e31ba46 100644 --- a/plugins/dbms/postgresql/fingerprint.py +++ b/plugins/dbms/postgresql/fingerprint.py @@ -89,9 +89,6 @@ class Fingerprint(GenericFingerprint): infoMsg = "testing PostgreSQL" logger.info(infoMsg) - if conf.direct: - conf.dbmsConnector.connect() - if conf.dbms in PGSQL_ALIASES: setDbms("PostgreSQL") diff --git a/plugins/dbms/sqlite/fingerprint.py b/plugins/dbms/sqlite/fingerprint.py index 29ae8c7a8..2839d6b06 100644 --- a/plugins/dbms/sqlite/fingerprint.py +++ b/plugins/dbms/sqlite/fingerprint.py @@ -93,9 +93,6 @@ class Fingerprint(GenericFingerprint): logMsg = "testing SQLite" logger.info(logMsg) - - if conf.direct: - conf.dbmsConnector.connect() payload = agent.fullPayload(" AND LAST_INSERT_ROWID()=LAST_INSERT_ROWID()") result = Request.queryPage(payload)