Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e8c1155

Browse files
committed
Now it works also on Mac OS X
1 parent 722ca8b commit e8c1155

5 files changed

Lines changed: 23 additions & 7 deletions

File tree

doc/THANKS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ Will Holcomb <[email protected]>
7474
for his MultipartPostHandler class to handle multipart POST forms and
7575
permission to include it within sqlmap source code
7676

77+
Mounir Idrassi <[email protected]>
78+
for his compiled version of UPX for Mac OS X
79+
7780
Luke Jahnke <[email protected]>
7881
for reporting a bug when running against MySQL < 5.0
7982

lib/contrib/magic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ def from_file(self, filename):
6363
def __del__(self):
6464
try:
6565
magic_close(self.cookie)
66-
except Exception, e:
67-
print "got this:", e
66+
except Exception, _:
67+
pass
6868

6969

7070
_magic_mime = None

lib/contrib/upx/macosx/upx

2.59 MB
Binary file not shown.

lib/core/option.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,12 @@ def __setMetasploit():
258258
if conf.osSmb:
259259
isAdmin = False
260260

261+
# TODO: add support for Mac OS X
262+
#if "darwin" in PLATFORM:
263+
# pass
264+
#
265+
#elif "win" in PLATFORM:
266+
261267
if "win" in PLATFORM:
262268
isAdmin = ctypes.windll.shell32.IsUserAnAdmin()
263269

@@ -270,10 +276,6 @@ def __setMetasploit():
270276
if isinstance(isAdmin, (int, float, long)) and isAdmin == 0:
271277
isAdmin = True
272278

273-
# TODO: add support for Mac OS X
274-
#elif "darwin" in PLATFORM:
275-
# pass
276-
277279
else:
278280
warnMsg = "sqlmap is not able to check if you are running it "
279281
warnMsg += "as an Administrator accout on this platform. "

lib/takeover/upx.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,22 @@ class UPX:
4848
"""
4949

5050
def __initialize(self, srcFile, dstFile=None):
51-
if "win" in PLATFORM:
51+
if "darwin" in PLATFORM:
52+
self.__upxPath = "%s/upx/macosx/upx" % paths.SQLMAP_CONTRIB_PATH
53+
54+
elif "win" in PLATFORM:
5255
self.__upxPath = "%s/upx/windows/upx.exe" % paths.SQLMAP_CONTRIB_PATH
56+
5357
elif "linux" in PLATFORM:
5458
self.__upxPath = "%s/upx/linux/upx" % paths.SQLMAP_CONTRIB_PATH
5559

60+
else:
61+
warnMsg = "unsupported platform for the compression tool "
62+
warnMsg += "(upx), sqlmap will continue anyway"
63+
logger.warn(warnMsg)
64+
65+
self.__upxPath = "%s/upx/linux/upx" % paths.SQLMAP_CONTRIB_PATH
66+
5667
self.__upxCmd = "%s -9 -qq %s" % (self.__upxPath, srcFile)
5768

5869
if dstFile:

0 commit comments

Comments
 (0)