diff --git a/doc/THANKS b/doc/THANKS index 50662eb9c..583204813 100644 --- a/doc/THANKS +++ b/doc/THANKS @@ -74,6 +74,9 @@ Will Holcomb for his MultipartPostHandler class to handle multipart POST forms and permission to include it within sqlmap source code +Mounir Idrassi + for his compiled version of UPX for Mac OS X + Luke Jahnke for reporting a bug when running against MySQL < 5.0 diff --git a/lib/contrib/magic.py b/lib/contrib/magic.py index b69b65a09..bd0380173 100644 --- a/lib/contrib/magic.py +++ b/lib/contrib/magic.py @@ -63,8 +63,8 @@ class Magic: def __del__(self): try: magic_close(self.cookie) - except Exception, e: - print "got this:", e + except Exception, _: + pass _magic_mime = None diff --git a/lib/contrib/upx/macosx/upx b/lib/contrib/upx/macosx/upx new file mode 100755 index 000000000..7704e16c8 Binary files /dev/null and b/lib/contrib/upx/macosx/upx differ diff --git a/lib/core/option.py b/lib/core/option.py index 5419c74ff..8626be0ce 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -258,6 +258,12 @@ def __setMetasploit(): if conf.osSmb: isAdmin = False + # TODO: add support for Mac OS X + #if "darwin" in PLATFORM: + # pass + # + #elif "win" in PLATFORM: + if "win" in PLATFORM: isAdmin = ctypes.windll.shell32.IsUserAnAdmin() @@ -270,10 +276,6 @@ def __setMetasploit(): if isinstance(isAdmin, (int, float, long)) and isAdmin == 0: isAdmin = True - # TODO: add support for Mac OS X - #elif "darwin" in PLATFORM: - # pass - else: warnMsg = "sqlmap is not able to check if you are running it " warnMsg += "as an Administrator accout on this platform. " diff --git a/lib/takeover/upx.py b/lib/takeover/upx.py index a8730bfb6..b2547179b 100644 --- a/lib/takeover/upx.py +++ b/lib/takeover/upx.py @@ -48,11 +48,22 @@ class UPX: """ def __initialize(self, srcFile, dstFile=None): - if "win" in PLATFORM: + if "darwin" in PLATFORM: + self.__upxPath = "%s/upx/macosx/upx" % paths.SQLMAP_CONTRIB_PATH + + elif "win" in PLATFORM: self.__upxPath = "%s/upx/windows/upx.exe" % paths.SQLMAP_CONTRIB_PATH + elif "linux" in PLATFORM: self.__upxPath = "%s/upx/linux/upx" % paths.SQLMAP_CONTRIB_PATH + else: + warnMsg = "unsupported platform for the compression tool " + warnMsg += "(upx), sqlmap will continue anyway" + logger.warn(warnMsg) + + self.__upxPath = "%s/upx/linux/upx" % paths.SQLMAP_CONTRIB_PATH + self.__upxCmd = "%s -9 -qq %s" % (self.__upxPath, srcFile) if dstFile: