Implementing PostgreSQL PL-extension RCE

This commit is contained in:
Miroslav Štampar
2026-07-12 18:38:09 +02:00
parent 38ab43f29e
commit dab476da8a
3 changed files with 54 additions and 2 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ from lib.core.enums import OS
from thirdparty import six
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.10.7.97"
VERSION = "1.10.7.98"
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
+7 -1
View File
@@ -52,6 +52,9 @@ class Abstraction(Web, UDF, XP_cmdshell):
elif self.webBackdoorUrl and (not isStackingAvailable() or kb.udfFail):
self.webBackdoorRunCmd(cmd)
elif Backend.isDbms(DBMS.PGSQL) and self.checkPlExec():
self.plExecCmd(cmd, silent=silent)
elif Backend.getIdentifiedDbms() in (DBMS.MYSQL, DBMS.PGSQL):
self.udfExecCmd(cmd, silent=silent)
@@ -74,6 +77,9 @@ class Abstraction(Web, UDF, XP_cmdshell):
elif self.webBackdoorUrl and (not isStackingAvailable() or kb.udfFail):
retVal = self.webBackdoorRunCmd(cmd)
elif Backend.isDbms(DBMS.PGSQL) and self.checkPlExec():
retVal = self.plExecCmd(cmd)
elif Backend.getIdentifiedDbms() in (DBMS.MYSQL, DBMS.PGSQL):
retVal = self.udfEvalCmd(cmd, first, last)
@@ -221,7 +227,7 @@ class Abstraction(Web, UDF, XP_cmdshell):
logger.warning(warnMsg)
if any((conf.osCmd, conf.osShell)) and Backend.isDbms(DBMS.PGSQL) and self.checkCopyExec():
if any((conf.osCmd, conf.osShell)) and Backend.isDbms(DBMS.PGSQL) and (self.checkCopyExec() or self.checkPlExec()):
success = True
elif Backend.getIdentifiedDbms() in (DBMS.MYSQL, DBMS.PGSQL):
success = self.udfInjectSys()