[英]Regular expressions to match javascript code\Html Code
I have testing for XSS-injection. 我正在测试XSS注入。
The code contains eval function of javascript. 该代码包含javascript的eval函数。
when if takes some javascript code evaluates the script . 如果需要一些JavaScript代码评估脚本。
I have very basic idea of regular expressions. 我对正则表达式有非常基本的了解。
I have been searching for regular expression which might filter the contents and might not allow the javascript code inside eval function . 我一直在寻找可能过滤内容并且可能不允许eval函数内的javascript代码的正则表达式。
I need to validate the input in short before passing the parameter to eval function. 在将参数传递给eval函数之前,我需要简短地验证输入。 Any help regarding this will be valuable .
任何对此的帮助将是有价值的。
Thanks in advance, Tazim. 在此先感谢,塔齐姆。
You're gonna lose that battle, because no regexp can protect from things like hasegawa's XSS vector 您将输掉这场战斗,因为没有正则表达式可以保护免受hasegawa的XSS vector之类的攻击
(É=[Å=[],µ=!Å+Å][µ[È=-~-~++Å]+({}+Å) [Ç=!!Å+µ,ª=Ç[Å]+Ç[+!Å],Å]+ª])() [µ[Å]+µ[Å+Å]+Ç[È]+ª](Å)
($=[$=[]][(__=!$+$)[_=-~-~-~$]+({}+$)[_/_]+($$=($_=!''+$)[_/_]+$_[+$])])()[__[_/_]+__[_+~$]+$_[_]+$$](_/_)
which is just an alert 这只是一个警报
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.