mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-10-17 05:07:28 +08:00
Minor patches
This commit is contained in:
@@ -55,7 +55,10 @@ class Connector(GenericConnector):
|
||||
try:
|
||||
self.cursor.execute(query)
|
||||
retVal = True
|
||||
except (psycopg2.OperationalError, psycopg2.ProgrammingError) as ex:
|
||||
# Note: also catch DataError/IntegrityError (e.g. division-by-zero, bad cast, unique violation from a
|
||||
# user '--sql-query') so the commit() below still runs and clears the aborted transaction; otherwise
|
||||
# PostgreSQL poisons every later query with 'InFailedSqlTransaction' and silently returns None
|
||||
except (psycopg2.OperationalError, psycopg2.ProgrammingError, psycopg2.DataError, psycopg2.IntegrityError) as ex:
|
||||
logger.warning(("(remote) '%s'" % getSafeExString(ex)).strip())
|
||||
except psycopg2.InternalError as ex:
|
||||
raise SqlmapConnectionException(getSafeExString(ex))
|
||||
|
||||
@@ -17,6 +17,7 @@ from lib.core.common import isNoneValue
|
||||
from lib.core.common import isStackingAvailable
|
||||
from lib.core.common import randomStr
|
||||
from lib.core.compat import LooseVersion
|
||||
from lib.core.data import conf
|
||||
from lib.core.data import kb
|
||||
from lib.core.data import logger
|
||||
from lib.core.data import paths
|
||||
@@ -100,7 +101,7 @@ class Takeover(GenericTakeover):
|
||||
def copyExecCmd(self, cmd):
|
||||
output = None
|
||||
|
||||
if isStackingAvailable():
|
||||
if isStackingAvailable() or conf.direct:
|
||||
# Reference: https://medium.com/greenwolf-security/authenticated-arbitrary-command-execution-on-postgresql-9-3-latest-cd18945914d5
|
||||
self._forgedCmd = "DROP TABLE IF EXISTS %s;" % self.cmdTblName
|
||||
self._forgedCmd += "CREATE TABLE %s(%s text);" % (self.cmdTblName, self.tblField)
|
||||
|
||||
Reference in New Issue
Block a user