Skip to content

Commit

Permalink
Fixes #5378
Browse files Browse the repository at this point in the history
  • Loading branch information
stamparm committed Mar 30, 2023
1 parent 257c4d1 commit 077d58c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from thirdparty.six import unichr as _unichr

# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.7.3.4"
VERSION = "1.7.3.5"
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)
Expand Down
13 changes: 7 additions & 6 deletions plugins/dbms/hsqldb/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ def readFile(self, remoteFile):

@stackedmethod
def stackedWriteFile(self, localFile, remoteFile, fileType=None, forceCheck=False):
funcName = randomStr()
func_name = randomStr()
max_bytes = 1024 * 1024

debugMsg = "creating JLP procedure '%s'" % funcName
debugMsg = "creating JLP procedure '%s'" % func_name
logger.debug(debugMsg)

addFuncQuery = "CREATE PROCEDURE %s (IN paramString VARCHAR, IN paramArrayOfByte VARBINARY(%s)) " % (funcName, max_bytes)
addFuncQuery = "CREATE PROCEDURE %s (IN paramString VARCHAR, IN paramArrayOfByte VARBINARY(%s)) " % (func_name, max_bytes)
addFuncQuery += "LANGUAGE JAVA DETERMINISTIC NO SQL "
addFuncQuery += "EXTERNAL NAME 'CLASSPATH:com.sun.org.apache.xml.internal.security.utils.JavaUtils.writeBytesToFilename'"
inject.goStacked(addFuncQuery)
Expand All @@ -47,11 +47,12 @@ def stackedWriteFile(self, localFile, remoteFile, fileType=None, forceCheck=Fals
logger.debug(debugMsg)

# Reference: http://hsqldb.org/doc/guide/sqlroutines-chapt.html#src_jrt_procedures
invokeQuery = "CALL %s('%s', CAST('%s' AS VARBINARY(%s)))" % (funcName, remoteFile, fcEncodedStr, max_bytes)
invokeQuery = "CALL %s('%s', CAST('%s' AS VARBINARY(%s)))" % (func_name, remoteFile, fcEncodedStr, max_bytes)
inject.goStacked(invokeQuery)

logger.debug("cleaning up" % funcName)
delQuery = "DELETE PROCEDURE %s" % funcName
logger.debug("cleaning up the database management system")

delQuery = "DELETE PROCEDURE %s" % func_name
inject.goStacked(delQuery)

message = "the local file '%s' has been written on the back-end DBMS" % localFile
Expand Down

0 comments on commit 077d58c

Please sign in to comment.