Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sqlmapproject
GitHub Repository: sqlmapproject/sqlmap
Path: blob/master/plugins/dbms/postgresql/__init__.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.enums import DBMS
9
from lib.core.settings import PGSQL_SYSTEM_DBS
10
from lib.core.unescaper import unescaper
11
from plugins.dbms.postgresql.enumeration import Enumeration
12
from plugins.dbms.postgresql.filesystem import Filesystem
13
from plugins.dbms.postgresql.fingerprint import Fingerprint
14
from plugins.dbms.postgresql.syntax import Syntax
15
from plugins.dbms.postgresql.takeover import Takeover
16
from plugins.generic.misc import Miscellaneous
17
18
class PostgreSQLMap(Syntax, Fingerprint, Enumeration, Filesystem, Miscellaneous, Takeover):
19
"""
20
This class defines PostgreSQL methods
21
"""
22
23
def __init__(self):
24
self.excludeDbsList = PGSQL_SYSTEM_DBS
25
self.sysUdfs = {
26
# UDF name: UDF parameters' input data-type and return data-type
27
"sys_exec": {"input": ["text"], "return": "int4"},
28
"sys_eval": {"input": ["text"], "return": "text"},
29
"sys_bineval": {"input": ["text"], "return": "int4"},
30
"sys_fileread": {"input": ["text"], "return": "text"}
31
}
32
33
for cls in self.__class__.__bases__:
34
cls.__init__(self)
35
36
unescaper[DBMS.PGSQL] = Syntax.escape
37
38