php - Detecting XSS using url validation -
What is a good URL verification function in php to find xss?
I used the FILTER_URL function Php, but it's still like URL:
http://example.com?<script></script> You can try these four tests with: // We will test against $ pattern = array set pattern (// "on" or xmlns '# (& lt; [^ & gt;] + [\ x00- \ x20 \ "\' Match any attributes that begin]]] (^ Xmlns) [^> gt; *] # iUu ', // match Javascript:, transliteration:, vbscript: and motcha: protocol'! (( Java | live | VB) script | MOCHA: (\ W * * IUu ',' # -mose-binding [\ x00- \ x20] *: # U ', // match style attributes' # (& l T ^ [^ & gt;] + [\ x00- \ X20 \ "\ 'style = [^ & gt;] * & gt; # iUu', // match unnecessary tag '# & lt; / * (Applet | meta | xml | blink | link | style | script | embed | object | isifame | frames | frameset | iiler | layer | bjsound | title | base] [^> gt;] * gt; # # ' ;
And instead of trying to detect XSS attacks, make sure to use just the proper cleaning.
Comments
Post a Comment