mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-10-12 02:22:55 +00:00
Implementing PostgreSQL PL-extension RCE
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user