做爰高潮a片〈毛片〉,尤物av天堂一区二区在线观看,一本久久A久久精品VR综合,添女人荫蒂全部过程av

最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
當前位置: 首頁 - 科技 - 知識百科 - 正文

javascript過濾危險腳本方法_javascript技巧

來源:懂視網 責編:小采 時間:2020-11-27 20:39:40
文檔

javascript過濾危險腳本方法_javascript技巧

javascript過濾危險腳本方法_javascript技巧:腳本藏身之處不過有四: 1、<script>標簽、<link>標簽、<style>標簽、iframe標簽 2、on開頭的標簽屬性 3、javascript(vbscript)偽協議 4、css的epression下面是他們的字符串規則: 1、<(script|link|style
推薦度:
導讀javascript過濾危險腳本方法_javascript技巧:腳本藏身之處不過有四: 1、<script>標簽、<link>標簽、<style>標簽、iframe標簽 2、on開頭的標簽屬性 3、javascript(vbscript)偽協議 4、css的epression下面是他們的字符串規則: 1、<(script|link|style

腳本藏身之處不過有四: 1、<script>標簽、<link>標簽、<style>標簽、iframe標簽 2、on開頭的標簽屬性 3、javascript(vbscript)偽協議 4、css的epression

下面是他們的字符串規則:
1、<(script|link|style|iframe)(.|\n)*<\/\1>\s*
2、\s*on[a-z]+\s*=\s*("[^"]+"|'[^']+'|[^\s]+)\s*(?=>)
3、\s*(href|src)\s*=\s*("\s*(javascript|vbscript):[^"]+"|'\s*(javascript|vbscript):[^']+'|(javascript|vbscript):[^\s]+)\s*(?=>)
4、epression\((.|\n)*\);?
了解他們的規則后,抓蟲行動就水到渠成。

<textarea id="bug" cols="80" rows="16"> 
<button id="kick">抓蟲1</button> 
<script> 
function kickBug(str) { 
return str.replace(/<(script|link|style|iframe)(.|\n)*\/\1>\s*/ig,""); 
} 
</script> 
<iframe></iframe> 
<link href='test.css'></link> 
<style> 
a { 
height:expression(alert('hei')); 
} 
</style> 
</textarea> 
<button id="kick">抓蟲1</button> 
<script> 
function kickBug(str) { 
return str.replace(/<(script|link|style|iframe)(.|\n)*\/\1>\s*/ig,""); 
} 
if(!/msie/i.test(navigator.userAgent)){ 
HTMLElement.prototype.__defineGetter__("innerText",function(){ 
return this.textContent; 
}); 
HTMLElement.prototype.__defineSetter__("innerText",function(text){ 
this.textContent = text; 
}); 
} 
document.getElementById("kick").onclick = function() { 
var bug = document.getElementById("bug"); 
bug.innerText = kickBug(bug.innerText); 
} 
</script>
<textarea id="bug" cols="80" rows="5"> 
<a onclick="test(); 
test1()" onblur= 
"test3()">test</a> 
</textarea> 
<button id="kick">抓蟲2</button> 
<script> 
function kickBug(str) { 
return str.replace(/<[a-z][^>]*\s*on[a-z]+\s*=[^>]+/ig,function($0,$1){ 
return $0.replace(/\s*on[a-z]+\s*=\s*("[^"]+"|'[^']+'|[^\s]+)\s*/ig,""); 
}); 
} 
if(!/msie/i.test(navigator.userAgent)){ 
HTMLElement.prototype.__defineGetter__("innerText",function(){ 
return this.textContent; 
}); 
HTMLElement.prototype.__defineSetter__("innerText",function(text){ 
this.textContent = text; 
}); 
} 
document.getElementById("kick").onclick = function() { 
var bug = document.getElementById("bug"); 
bug.innerText = kickBug(bug.innerText); 
} 
</script>
<textarea id="bug" cols="80" rows="5"> 
<a onclick="test();" href=" 
jAvascript:alert('a')" href="jAvascript:" 
href="vbscript:alert()" 
>test</a> 
</textarea> 
<button id="kick">抓蟲3</button> 
<script> 
function kickBug(str) { 
return str.replace(/<[a-z][^>]*\s*(href|src)\s*=[^>]+/ig,function($0,$1){ 
$0 = $0.replace(/&#(6[5-9]|[78][0-9]|9[0789]|1[01][0-9]|12[012]);?/g,function($0,$1){return String.fromCharCode($1);}); 
return $0.replace(/\s*(href|src)\s*=\s*("\s*(javascript|vbscript):[^"]+"|'\s*(javascript|vbscript):[^']+'|(javascript|vbscript):[^\s]+)/ig,""); 
}); 
} 
if(!/msie/i.test(navigator.userAgent)){ 
HTMLElement.prototype.__defineGetter__("innerText",function(){ 
return this.textContent; 
}); 
HTMLElement.prototype.__defineSetter__("innerText",function(text){ 
this.textContent = text; 
}); 
} 
document.getElementById("kick").onclick = function() { 
var bug = document.getElementById("bug"); 
bug.innerText = kickBug(bug.innerText); 
} 
</script>
<textarea id="bug" cols="80" rows="5"> 
expression() 
<a style="color:expression( 
'red' 
)">test</a> 
</textarea> 
<button id="kick">抓蟲4</button> 
<script> 
function kickBug(str) { 
return str.replace(/<[a-z][^>]*\s*style\s*=[^>]+/ig,function($0,$1){ 
$0 = $0.replace(/&#(6[5-9]|[78][0-9]|9[0789]|1[01][0-9]|12[012]);?/g,function($0,$1){return String.fromCharCode($1);}); 
return $0.replace(/\s*style\s*=\s*("[^"]+(expression)[^"]+"|'[^']+\2[^']+'|[^\s]+\2[^\s]+)\s*/ig,""); 
}); 
} 
if(!/msie/i.test(navigator.userAgent)){ 
HTMLElement.prototype.__defineGetter__("innerText",function(){ 
return this.textContent; 
}); 
HTMLElement.prototype.__defineSetter__("innerText",function(text){ 
this.textContent = text; 
}); 
} 
document.getElementById("kick").onclick = function() { 
var bug = document.getElementById("bug"); 
bug.innerText = kickBug(bug.innerText); 
} 
</script>

這樣調用就可以
k1(k2(k3(k4(str))))

這樣就是單純地過濾腳本而已,所謂過濾“危險腳本”應該是能夠判斷哪些屬于“危險"腳本,不危險的就不過濾才對……那可就難辦了,相當于防火墻了。

聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

文檔

javascript過濾危險腳本方法_javascript技巧

javascript過濾危險腳本方法_javascript技巧:腳本藏身之處不過有四: 1、<script>標簽、<link>標簽、<style>標簽、iframe標簽 2、on開頭的標簽屬性 3、javascript(vbscript)偽協議 4、css的epression下面是他們的字符串規則: 1、<(script|link|style
推薦度:
標簽: 過濾 方法 js
  • 熱門焦點

最新推薦

猜你喜歡

熱門推薦

專題
Top
主站蜘蛛池模板: 乾安县| 蓝山县| 南靖县| 南和县| 田东县| 常熟市| 海门市| 酒泉市| 拜泉县| 高尔夫| 景宁| 司法| 饶阳县| 舟曲县| 吉林市| 墨脱县| 龙陵县| 商城县| 东阿县| 深州市| 永平县| 澄江县| 聊城市| 元氏县| 凤翔县| 湖北省| 大荔县| 青州市| 鲜城| 重庆市| 鄱阳县| 沿河| 平邑县| 印江| 南涧| 西畴县| 周宁县| 乌什县| 图们市| 深州市| 洪泽县|