Skip to content

Commit c4be85d

Browse files
author
Rocco Nicosia
committed
remove libmagic dependency
1 parent be844c8 commit c4be85d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

xssless.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#!/usr/bin/env python
2+
23
import sys
34
from bs4 import BeautifulSoup
45
import base64
56
import json
67
import os
7-
import magic
8+
import mimetypes
9+
810
# Import burp export and return a list of decoded data
911
def get_burp_list(filename):
1012
if not os.path.exists(filename):
@@ -280,9 +282,7 @@ def xss_gen(requestList, settingsDict):
280282
filecontents = payload_encode_file(settingsDict['fileDict'][item['name']])
281283

282284
# Find content type
283-
m = magic.open(magic.MAGIC_MIME)
284-
m.load()
285-
content_type = m.file(settingsDict['fileDict'][item['name']])
285+
content_type = mimetypes.guess_type(settingsDict['fileDict'][item['name']])[0]
286286

287287
multipart += 'Content-Disposition: form-data; name="' + item['name'] + '"; filename="' + item['filename'] + '"\\r\\n'
288288
multipart += 'Content-Type: ' + content_type + '\\r\\n\\r\\n'

0 commit comments

Comments
 (0)