Avoid libmagic traceback on Windows.

WARNING: this release is a candidate, it only works on Linux/Unices for the moment!
This commit is contained in:
Bernardo Damele 2009-04-22 12:44:16 +00:00
parent 8c0ac767f4
commit aefa7ef988
3 changed files with 52 additions and 62 deletions

View File

@ -98,7 +98,7 @@ def from_buffer(buffer, mime=False):
try:
libmagic = ctypes.CDLL(ctypes.util.find_library('magic'))
magic_t = ctypes.c_void_p
@ -159,7 +159,8 @@ magic_check.argtypes = [magic_t, c_char_p]
magic_compile = libmagic.magic_compile
magic_compile.restype = c_int
magic_compile.argtypes = [magic_t, c_char_p]
except:
pass
MAGIC_NONE = 0x000000 # No flags

View File

@ -742,7 +742,10 @@ def getRemoteIP():
def getFileType(filePath):
try:
magicFileType = magic.from_file(filePath)
except:
return "unknown"
if "ASCII" in magicFileType or "text" in magicFileType:
return "text"

View File

@ -2,21 +2,7 @@
# Target URL.
# Example: http://192.168.1.121/sqlmap/mysql/get_int.php?id=1&cat=2
# Windows Server 2003 Service Pack 2 virtual machine
#url = http://192.168.62.154/sqlmap/mysql/iis/get_int.asp?id=1
#url = http://192.168.62.154/sqlmap/mysql/iis/get_int.aspx?id=1
#url = http://192.168.62.154/sqlmap/mysql/iis/get_int_51.aspx?id=1
#url = http://192.168.62.154/sqlmap/pgsql/iis/get_int.asp?id=1
#url = http://192.168.62.154/sqlmap/pgsql/iis/get_int.aspx?id=1
#url = http://192.168.62.154/sqlmap/mssql/iis/get_str.asp?name=luther
url = http://192.168.62.154/sqlmap/mssql/iis/get_str2.asp?name=luther
#url = http://192.168.62.154/sqlmap/mssql/iis/get_str2_user.asp?name=luther
# Ubuntu 8.10 (Intrepid Ibex) virtual machine
#url = http://192.168.62.146/sqlmap/mysql/get_int.php?id=1
#url = http://192.168.62.146/sqlmap/mssql/get_int.php?id=1
#url = http://192.168.62.146/sqlmap/oracle/get_int.php?id=1
#url = http://10.0.0.58/sqlmap/pgsql/get_int.php?id=1
#url = http://192.168.62.146/sqlmap/pgsql/get_int_partialunion.php?id=1
url =
# Parse targets from Burp or WebScarab logs
# Valid: Burp proxy (http://portswigger.net/suite/) requests log file path