2019-05-08 13:47:52 +03:00
|
|
|
#!/usr/bin/env python
|
2018-10-16 13:23:07 +03:00
|
|
|
|
|
|
|
"""
|
2024-01-04 01:11:52 +03:00
|
|
|
Copyright (c) 2006-2024 sqlmap developers (https://sqlmap.org/)
|
2018-10-16 13:23:07 +03:00
|
|
|
See the file 'LICENSE' for copying permission
|
|
|
|
"""
|
|
|
|
|
2019-06-04 15:44:06 +03:00
|
|
|
from lib.core.common import unArrayizeValue
|
2018-10-16 13:23:07 +03:00
|
|
|
from lib.core.data import conf
|
|
|
|
from lib.core.data import kb
|
|
|
|
from lib.core.data import logger
|
|
|
|
from lib.core.data import queries
|
|
|
|
from lib.core.enums import DBMS
|
2018-10-16 14:26:55 +03:00
|
|
|
from lib.core.settings import H2_DEFAULT_SCHEMA
|
2018-10-16 13:23:07 +03:00
|
|
|
from lib.request import inject
|
2019-06-04 15:44:06 +03:00
|
|
|
from plugins.generic.enumeration import Enumeration as GenericEnumeration
|
2018-10-16 13:23:07 +03:00
|
|
|
|
|
|
|
class Enumeration(GenericEnumeration):
|
|
|
|
def getBanner(self):
|
|
|
|
if not conf.getBanner:
|
|
|
|
return
|
|
|
|
|
|
|
|
if kb.data.banner is None:
|
|
|
|
infoMsg = "fetching banner"
|
|
|
|
logger.info(infoMsg)
|
|
|
|
|
|
|
|
query = queries[DBMS.H2].banner.query
|
|
|
|
kb.data.banner = unArrayizeValue(inject.getValue(query, safeCharEncode=True))
|
|
|
|
|
|
|
|
return kb.data.banner
|
|
|
|
|
2019-05-30 23:55:54 +03:00
|
|
|
def getPrivileges(self, *args, **kwargs):
|
2018-10-16 13:23:07 +03:00
|
|
|
warnMsg = "on H2 it is not possible to enumerate the user privileges"
|
2022-06-22 13:04:34 +03:00
|
|
|
logger.warning(warnMsg)
|
2018-10-16 13:23:07 +03:00
|
|
|
|
|
|
|
return {}
|
|
|
|
|
|
|
|
def getHostname(self):
|
|
|
|
warnMsg = "on H2 it is not possible to enumerate the hostname"
|
2022-06-22 13:04:34 +03:00
|
|
|
logger.warning(warnMsg)
|
2018-10-16 14:26:55 +03:00
|
|
|
|
|
|
|
def getCurrentDb(self):
|
|
|
|
return H2_DEFAULT_SCHEMA
|
|
|
|
|
|
|
|
def getPasswordHashes(self):
|
2020-01-17 19:14:41 +03:00
|
|
|
warnMsg = "on H2 it is not possible to enumerate password hashes"
|
2022-06-22 13:04:34 +03:00
|
|
|
logger.warning(warnMsg)
|
2018-10-16 14:26:55 +03:00
|
|
|
|
|
|
|
return {}
|
2019-05-29 16:52:33 +03:00
|
|
|
|
|
|
|
def getStatements(self):
|
|
|
|
warnMsg = "on H2 it is not possible to enumerate the SQL statements"
|
2022-06-22 13:04:34 +03:00
|
|
|
logger.warning(warnMsg)
|
2019-05-29 16:52:33 +03:00
|
|
|
|
|
|
|
return []
|