Major code refactoring - moved to one location only (getIdentifiedDBMS() in common.py) the retrieval of identified/fingerprinted DBMS.

Minor bug fixes thanks to previous refactoring too.
This commit is contained in:
Bernardo Damele
2011-01-13 17:36:54 +00:00
parent a1d1f69c3f
commit 2ac8debea0
37 changed files with 342 additions and 314 deletions

View File

@@ -13,6 +13,7 @@ from xml.sax.handler import ContentHandler
from lib.core.common import checkFile
from lib.core.common import getCompiledRegex
from lib.core.common import getIdentifiedDBMS
from lib.core.common import parseXmlFile
from lib.core.common import sanitizeStr
from lib.core.data import kb
@@ -94,13 +95,13 @@ def bannerParser(banner):
xmlfile = None
if kb.dbms == DBMS.MSSQL:
if getIdentifiedDBMS() == DBMS.MSSQL:
xmlfile = paths.MSSQL_XML
elif kb.dbms == DBMS.MYSQL:
elif getIdentifiedDBMS() == DBMS.MYSQL:
xmlfile = paths.MYSQL_XML
elif kb.dbms == DBMS.ORACLE:
elif getIdentifiedDBMS() == DBMS.ORACLE:
xmlfile = paths.ORACLE_XML
elif kb.dbms == DBMS.PGSQL:
elif getIdentifiedDBMS() == DBMS.PGSQL:
xmlfile = paths.PGSQL_XML
if not xmlfile:
@@ -108,7 +109,7 @@ def bannerParser(banner):
checkFile(xmlfile)
if kb.dbms == DBMS.MSSQL:
if getIdentifiedDBMS() == DBMS.MSSQL:
handler = MSSQLBannerHandler(banner, kb.bannerFp)
parseXmlFile(xmlfile, handler)