mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-05-15 05:03:49 +03:00
cleaning a mess with UPX and virus scanners
This commit is contained in:
parent
44bbef42f8
commit
9a9838f1e6
Binary file not shown.
BIN
lib/contrib/upx/linux/upx_
Normal file
BIN
lib/contrib/upx/linux/upx_
Normal file
Binary file not shown.
Binary file not shown.
BIN
lib/contrib/upx/macosx/upx_
Normal file
BIN
lib/contrib/upx/macosx/upx_
Normal file
Binary file not shown.
|
@ -33,22 +33,23 @@ class UPX:
|
||||||
|
|
||||||
def __initialize(self, srcFile, dstFile=None):
|
def __initialize(self, srcFile, dstFile=None):
|
||||||
if PLATFORM == "mac":
|
if PLATFORM == "mac":
|
||||||
self.__upxPath = "%s/upx/macosx/upx" % paths.SQLMAP_CONTRIB_PATH
|
self.__upxTemp = decloakToMkstemp("%s/upx/macosx/upx_" % paths.SQLMAP_CONTRIB_PATH)
|
||||||
|
|
||||||
elif PLATFORM in ( "ce", "nt" ):
|
elif PLATFORM in ( "ce", "nt" ):
|
||||||
self.__upxTempExe = decloakToMkstemp("%s\upx\windows\upx.exe_" % paths.SQLMAP_CONTRIB_PATH, suffix=".exe")
|
self.__upxTemp = decloakToMkstemp("%s\upx\windows\upx.exe_" % paths.SQLMAP_CONTRIB_PATH, suffix=".exe")
|
||||||
self.__upxPath = self.__upxTempExe.name
|
|
||||||
self.__upxTempExe.close() #needed for execution rights
|
|
||||||
|
|
||||||
elif PLATFORM == "posix":
|
elif PLATFORM == "posix":
|
||||||
self.__upxPath = "%s/upx/linux/upx" % paths.SQLMAP_CONTRIB_PATH
|
self.__upxTemp = decloakToMkstemp("%s/upx/linux/upx_" % paths.SQLMAP_CONTRIB_PATH)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
warnMsg = "unsupported platform for the compression tool "
|
warnMsg = "unsupported platform for the compression tool "
|
||||||
warnMsg += "(upx), sqlmap will continue anyway"
|
warnMsg += "(upx), sqlmap will continue anyway"
|
||||||
logger.warn(warnMsg)
|
logger.warn(warnMsg)
|
||||||
|
|
||||||
self.__upxPath = "%s/upx/linux/upx" % paths.SQLMAP_CONTRIB_PATH
|
self.__upxTemp = decloakToMkstemp("%s/upx/linux/upx_" % paths.SQLMAP_CONTRIB_PATH)
|
||||||
|
|
||||||
|
self.__upxPath = self.__upxTemp.name
|
||||||
|
self.__upxTemp.close() #needed for execution rights
|
||||||
|
|
||||||
self.__upxCmd = "%s -9 -qq %s" % (self.__upxPath, srcFile)
|
self.__upxCmd = "%s -9 -qq %s" % (self.__upxPath, srcFile)
|
||||||
|
|
||||||
|
@ -65,8 +66,8 @@ class UPX:
|
||||||
pollProcess(process)
|
pollProcess(process)
|
||||||
upxStdout, upxStderr = process.communicate()
|
upxStdout, upxStderr = process.communicate()
|
||||||
|
|
||||||
if hasattr(self, '__upxTempExe'):
|
if hasattr(self, '__upxTemp'):
|
||||||
os.remove(self.__upxTempExe.name)
|
os.remove(self.__upxTemp.name)
|
||||||
|
|
||||||
msg = "failed to compress the file"
|
msg = "failed to compress the file"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user