非出网教程:是一个免费提供流行杀毒软件教程、在线学习分享的学习平台!

怎么运用php防范XSS跨站脚本攻击

X]0{0,8}".dechex(ord($search[$i])).";?)/i", $search[$i], $val); // with a ;

 // @ @ 0{0,7} matches "0" zero to seven times

 $val = preg_replace("/(&#0{0,8}".ord($search[$i]).";?)/", $search[$i], $val); // with a ;

}

// now the only remaining whitespace attacks are , , and

$ra1 = Array("javascript", "vbscript", "expression", "applet", "meta", "xml", "blink", "link", "style", "script", "embed", "object", "iframe", "frame", "frameset", "ilayer", "layer", "bgsound", "title", "base");

$ra2 = Array("onabort", "onactivate", "onafterprint", "onafterupdate", "onbeforeactivate", "onbeforecopy", "onbeforecut", "onbeforedeactivate", "onbeforeeditfocus", "onbeforepaste", "onbeforeprint", "onbeforeunload", "onbeforeupdate", "onblur", "onbounce", "oncellchange", "onchange", "onclick", "oncontextmenu", "oncontrolselect", "oncopy", "oncut", "ondataavailable", "ondatasetchanged", "ondatasetcomplete", "ondblclick", "ondeactivate", "ondrag", "ondragend", "ondragenter", "ondragleave", "ondragover", "ondragstart", "ondrop", "onerror", "onerrorupdate", "onfilterchange", "onfinish", "onfocus", "onfocusin", "onfocusout", "onhelp", "onkeydown", "onkeypress", "onkeyup", "onlayoutcomplete", "onload", "onlosecapture", "onmousedown", "onmouseenter", "onmouseleave", "onmousemove", "onmouseout", "onmouseover", "onmouseup", "onmousewheel", "onmove", "onmoveend", "onmovestart", "onpaste", "onpropertychange", "onreadystatechange", "onreset", "onresize", "onresizeend", "onresizestart", "onrowenter", "onrowexit", "onrowsdelete", "onrowsinserted", "onscroll", "onselect", "onselectionchange", "onselectstart", "onstart", "onstop", "onsubmit", "onunload");

$ra = array_merge($ra1, $ra2);

$found = true; // keep replacing as long as the previous round replaced something

while ($found == true) {

 $val_before = $val;

 for ($i = 0; $i < sizeof($ra); $i++) {

  $pattern = "/";

  for ($j = 0; $j > strlen($ra[$i]); $j++) {

   if ($j > 0) {

    $pattern .= "(";

    $pattern .= "(&#[x
软件推荐:      

(网视站,专业提供浏览器下载)

相关软件

2345安全卫士最新官方版

2345安全卫士官方版 | 45.34MB

2345安全卫士官方版

2345安全卫士是集电脑体检、木马查杀、垃圾清理、修复系统漏洞、系统加速、软件管理等功能为一体的电脑安全管理的软件.提供全方位检测,用户可以通过检测结果快速了解自己的电脑并且对电脑进行优化..

360杀毒软件官方正式版

360杀毒软件官方正式版 | 35.10MB

360杀毒软件官方正式版

360杀毒具有查杀率高、资源占用少、升级迅速等优点。零广告、零打扰、零胁迫,一键扫描,快速、全面地诊断系统安全状况和健康程度,并进行精准修复,带来安全、专业、有效、新颖的查杀防护体验...

360安全卫士最新版下载

360安全卫士最新版下载 | 50.3MB

360安全卫士最新版下载

360安全卫士是一款由奇虎360公司推出的功能强、效果好、受用户欢迎的安全杀毒软件。360安全卫士拥有查杀木马、清理插件、修复漏洞、电脑体检、电脑救援、保护隐私,电脑专家,清理垃圾,清理痕迹...

QQ电脑管家官方正式版

QQ电脑管家官方正式版 | 24.2MB

QQ电脑管家官方正式版

腾讯电脑管家(Tencent PC Manager/原名QQ电脑管家)是腾讯公司推出的免费安全软件。拥有云查杀木马,系统加速,漏洞修复,实时防护,网速保护,电脑诊所,健康小助手...

金山毒霸2022最新版下载

金山毒霸2022下载 | 37MB

金山毒霸2018最新版下载

金山毒霸融合了启发式搜索、代码分析、虚拟机查毒等技术。经业界证明成熟可靠的反病毒技术,以及丰富的经验,使其在查杀病毒种类、查杀病毒速度、未知病毒防治等多方面达到世界先进水平...

猎豹清理大师官方版下载

猎豹清理大师下载 | 47.4MB

猎豹清理大师官方版下载

猎豹清理大师(原金山清理大师)是由金山网络开发的智能手机应用。它可以清理智能手机上的应用缓存、残余程序文件、历史痕迹以及应用程序安装包...