前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >zzcms 8.2 任意用户密码修改

zzcms 8.2 任意用户密码修改

作者头像
Seebug漏洞平台
发布2018-03-30 11:38:49
1.3K0
发布2018-03-30 11:38:49
举报
文章被收录于专栏:Seebug漏洞平台Seebug漏洞平台
作者:Sebao@知道创宇404实验室

漏 洞 描 述

zzcms是一款企业建站程序。zzcms 8.2版本/one/getpassword.php文件存在漏洞,攻击者可利用该漏洞修改任意用户密码。

漏 洞 分 析

/one/getpassword.php 文件第 73行,触发漏洞的关键代码。

}elseif($action=="step3" && @$_SESSION['username']!=''){ $passwordtrue = isset($_POST['password'])?$_POST['password']:""; $password=md5(trim($passwordtrue)); query("update zzcms_user set password='$password',passwordtrue='$passwordtrue' where username='".@$_SESSION['username']."'"); $strout=str_replace("{step4}","",$strout) ; $strout=str_replace("{/step4}","",$strout) ; $strout=str_replace("{step1}".$step1."{/step1}","",$strout) ; $strout=str_replace("{step2}".$step2."{/step2}","",$strout) ; $strout=str_replace("{step3}".$step3."{/step3}","",$strout) ; $strout=str_replace("{#username}",@$_SESSION['username'],$strout) ;

这里仅仅判断了 action 参数为 step3,并且$_SESSION['username']不为空,就进入密码修改的逻辑,直接执行sql语句执行update操作。

那么这里的$_SESSION['username']从哪里来的,我们继续看代码,在/one/getpassword.php 文件第 31行,可以看到 $_SESSION['username']。

if ($action=="step1"){ $username = isset($_POST['username'])?$_POST['username']:""; $_SESSION['username']=$username; checkyzm($_POST["yzm"]); $rs=query("select mobile,email from zzcms_user where username='" . $username . "' "); $row=fetch_array($rs); $regmobile=$row['mobile']; $regmobile_show=str_replace(substr($regmobile,3,4),"****",$regmobile); $regemail=$row['email']; $regemail_show=str_replace(substr($regemail,1,2),"**",$regemail);

这里$_SESSION['username']是从step1中 post传递过来的 username 参数,也就是我们要修改的用户名。那么漏洞就很明显了,在第一步输入要修改的用户名,然后获取session值,直接跳到第三步,修改密码就可以达到任意用户密码修改。

漏 洞 复 现

第一步先在找回密码页面输入要修改的用户名,点击下一步,burp拦截。

抓包获取session值

这里我们获取到了 session 值,然后根据上面的描述,修改数据包,直接进入修改密码操作。

这里session就是上面获取到的,只需要修改 post-data值就可以。这里改成mima888。action值要改成step3 才可以进去 数据库 update语句的操作。然后重放数据包,就可以完成任意密码修改了。 前台登录试试,是否修改成功。

成功修改密码,登录成功。

利用此漏洞,只需要知道用户名即可。

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2018-02-09,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 Seebug漏洞平台 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档