Path: blob/master/plugins/dbms/altibase/fingerprint.py
2992 views
#!/usr/bin/env python12"""3Copyright (c) 2006-2025 sqlmap developers (https://sqlmap.org)4See the file 'LICENSE' for copying permission5"""67from lib.core.common import Backend8from lib.core.common import Format9from lib.core.data import conf10from lib.core.data import kb11from lib.core.data import logger12from lib.core.enums import DBMS13from lib.core.session import setDbms14from lib.core.settings import ALTIBASE_ALIASES15from lib.request import inject16from plugins.generic.fingerprint import Fingerprint as GenericFingerprint1718class Fingerprint(GenericFingerprint):19def __init__(self):20GenericFingerprint.__init__(self, DBMS.ALTIBASE)2122def getFingerprint(self):23value = ""24wsOsFp = Format.getOs("web server", kb.headersFp)2526if wsOsFp:27value += "%s\n" % wsOsFp2829if kb.data.banner:30dbmsOsFp = Format.getOs("back-end DBMS", kb.bannerFp)3132if dbmsOsFp:33value += "%s\n" % dbmsOsFp3435value += "back-end DBMS: "3637if not conf.extensiveFp:38value += DBMS.ALTIBASE39return value4041actVer = Format.getDbms()42blank = " " * 1543value += "active fingerprint: %s" % actVer4445if kb.bannerFp:46banVer = kb.bannerFp.get("dbmsVersion")4748if banVer:49banVer = Format.getDbms([banVer])50value += "\n%sbanner parsing fingerprint: %s" % (blank, banVer)5152htmlErrorFp = Format.getErrorParsedDBMSes()5354if htmlErrorFp:55value += "\n%shtml error message fingerprint: %s" % (blank, htmlErrorFp)5657return value5859def checkDbms(self):60if not conf.extensiveFp and Backend.isDbmsWithin(ALTIBASE_ALIASES):61setDbms(DBMS.ALTIBASE)6263self.getBanner()6465return True6667infoMsg = "testing %s" % DBMS.ALTIBASE68logger.info(infoMsg)6970# Reference: http://support.altibase.com/fileDownload.do?gubun=admin&no=22871result = inject.checkBooleanExpression("CHOSUNG(NULL) IS NULL")7273if result:74infoMsg = "confirming %s" % DBMS.ALTIBASE75logger.info(infoMsg)7677result = inject.checkBooleanExpression("TDESENCRYPT(NULL,NULL) IS NULL")7879if not result:80warnMsg = "the back-end DBMS is not %s" % DBMS.ALTIBASE81logger.warning(warnMsg)8283return False8485setDbms(DBMS.ALTIBASE)8687self.getBanner()8889return True90else:91warnMsg = "the back-end DBMS is not %s" % DBMS.ALTIBASE92logger.warning(warnMsg)9394return False959697