Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sqlmapproject
GitHub Repository: sqlmapproject/sqlmap
Path: blob/master/plugins/dbms/h2/enumeration.py
2992 views
1
#!/usr/bin/env python
2
3
"""
4
Copyright (c) 2006-2025 sqlmap developers (https://sqlmap.org)
5
See the file 'LICENSE' for copying permission
6
"""
7
8
from lib.core.common import unArrayizeValue
9
from lib.core.data import conf
10
from lib.core.data import kb
11
from lib.core.data import logger
12
from lib.core.data import queries
13
from lib.core.enums import DBMS
14
from lib.core.settings import H2_DEFAULT_SCHEMA
15
from lib.request import inject
16
from plugins.generic.enumeration import Enumeration as GenericEnumeration
17
18
class Enumeration(GenericEnumeration):
19
def getBanner(self):
20
if not conf.getBanner:
21
return
22
23
if kb.data.banner is None:
24
infoMsg = "fetching banner"
25
logger.info(infoMsg)
26
27
query = queries[DBMS.H2].banner.query
28
kb.data.banner = unArrayizeValue(inject.getValue(query, safeCharEncode=True))
29
30
return kb.data.banner
31
32
def getPrivileges(self, *args, **kwargs):
33
warnMsg = "on H2 it is not possible to enumerate the user privileges"
34
logger.warning(warnMsg)
35
36
return {}
37
38
def getHostname(self):
39
warnMsg = "on H2 it is not possible to enumerate the hostname"
40
logger.warning(warnMsg)
41
42
def getCurrentDb(self):
43
return H2_DEFAULT_SCHEMA
44
45
def getPasswordHashes(self):
46
warnMsg = "on H2 it is not possible to enumerate password hashes"
47
logger.warning(warnMsg)
48
49
return {}
50
51
def getStatements(self):
52
warnMsg = "on H2 it is not possible to enumerate the SQL statements"
53
logger.warning(warnMsg)
54
55
return []
56
57