SlideShare uma empresa Scribd logo
1 de 21
Divyanshu Shukla (justm0rph3u5)
Information Security Engineer
Browser Hacking
For Fun & Profit
@justm0rph3u5 @justm0rph3u5
Agenda
• Introduction of Browsers
• Working of Browsers
• Basic Features
• Origin and Same Origin Policy
• Same Origin Policy in action
• Content Security Policy
• Common Attacks on Browsers/WebView
• RCE and Cross Scheme Data Exposure
• Demo For UXSS
• Demo For Denial Of Service
• Demo For SOP Same Origin Bypasses
• Demo For Address Bar Spoofing in Android
• Demo For Address Bar Spoofing in Safari
• Demo For Content Spoofing
Working Of Browsers
Basic Features
Features Provided By Browser:
• Multiple tabs
• Address bar
• Autocomplete
• Password manager Downloads
• Support for untrusted SSL certificates
• Safety ratings
• Malware protection
• Cloud integration
• Adware Blocker, etc.
Origin
Origin
Two URLs have the same origin if the protocol, port (if specified), and host are the same for both.
Same Origin Policy
Same Origin
• The same-origin policy is a critical security mechanism that restricts how a document is loaded
from one origin can interact with a resource from another origin.
• In simple words, two webpages are on same origin if they have the same URL scheme, hostname
and port number.
Same Origin Bypass
• SOP bypasses is mostly occurred due to logical confusion between different layers where one
layer parses the input in a different way and another in a different way.
SOP In Action
Code For SOP
<script>
var x = new XMLHttpRequest(); x.open('GET','http://www.gmail.com', true) x.send()
document.write(x.responseText);
</script>
SOP restricts it from accessing contents present at https://www.gmail.com due to scheme and host mismatch.
Content Security Policy
CSP & CSP Bypass
• Content Security Policy (CSP) is an added layer of security that helps to detect and mitigate cert
ain types of attacks, including Cross Site Scripting (XSS) and data injection attacks.
• CSP bypass in not always a security bug.
• Content-Security-Policy: policy
Common Attacks
• Cross Scheme Data Exposure Attacks
• Remote Code Execution
• DOS
• UXSS
• SOP Bypass
• Spoofing
• Fuzzing
Most Common Attacks on WebView/Browsers
SOP bypass / UXSS
RCE and Cross Scheme Data Exposure
Cross Scheme Data Exposure
• In browser modern HTTP and file scheme (file:///etc/passwd) are both treated as a different origin.
If
javascript at HTTP scheme can load and read local files it results in a SOP bypass and causes
directory traversal attacks
• Mozilla provides a component known as “nsILocalFile” and it is possible to navigate to different
path separators used on different platforms, query the state ofany file or directory.
• This component can be refer using the string '@mozilla.org/file/local;1‘ to create an instance whi
ch can alsobe known as Contract.
• This caused code execution.
Remote Code Execution
Demo for Denial Of Service
Denial of Service
• Denial of Service Vulnerability is when application fails to provide service and crashes.
• Here SetInterval function was used to exploit in the browser for this case. This vulnerability makes
the resource unavailable and thus the browser crashes.
• Browser allows javascript to update the address bar while the page is still loading which is causing
browsers to crash or freeze thus causing dos attack.
• Mitigation: For solution browser window should not be allowed to update address page while loadi
ng. The application should be able to handle exceptions instead of freezing.
• Code Url: https://justmorpheus.000webhostapp.com/null/dos.html
• Demo Video
Demo For Universal XSS
CVE-2019-13607* : UXSS via Javascript Protocol
• Attacker controlled domain returns "javascript:code_here" in "location" header then browser
executes the javascript code in the context of target domain instead of attacker domain.
• The value of "location" header is "javascript:alert()" then javascript code "alert()" gets executed by
the browser.
• Mitigation: Browser should not be allowed to execute the javascript code in the context of the
domain from where the navigation was initiated.
• Code Url: http://rakeshmane.com/secret.html
• Demo Video
Thanks to Rakesh Mane for discovering UXSS
UXSS / SOP Bypass
Stealing Credentials
• A server-redirect combined with a data-uri end up bypassing the Same Origin Policy, which leads t
o all kind of vulnerabilities like stealing user passwords in plain-text (thanks to the password mana
ger), grabbing cookies, spoofing the content and referrer, etc.
• The rule of thumb when discussing defending against UXSS is have everything patched and up to
date.
Demo For Same Origin Policy Bypass
CVE-2019-14962: SOP Bypass via URL Spoofing
• A SOP bypass is when a javascript present in the origin like example.com is able to access proper
ties of webpage on another origin http://example2.com such as cookies, location, response, etc.
• It occurs in the browser when window.open() opens a new child tab and rewrites in the innerHTML
to gather credentials using fake pop up alert.
• Mitigation: By keeping a check on creating model regarding SOP and also by decreasing the comp
lexity of JavaScript and DOM.
• Code Url: https://justmorpheus.000webhostapp.com/null/sopbypass.html
• Demo Video
Spoofing Attacks
Introduction to Spoofing Attacks
• Google security team themselves state that "We recognize that the address bar is the only reliable
security indicator in modern browsers" .
• Initialize and Interrupt” technique.
• Load and Overwrite Race Conditions
• Loading Loop
• Spoofing Using RTL Characters
• Content Spoofing via Popup
Demo For Address Bar Spoofing
CVE-2019–12278 : Address Bar Spoofing Using RTL Characters
• Opera android suffers from address bar spoofing vulnerability. Characters from languages are suc
h as Persian, Arabic are displayed in right to left order, usage prescribed is Unicode Bidirectional A
lgorithm. Unicode characters such as U+08FF, U+FB50, etc are rendered from right to left so it ca
n be used to spoof the URL.
• Mitigation: All these URLs must be rendered in similar fashion i.e. left to right. Check the RFC for
more details.
• Malicious URL:
http://3.17.56.213/%EF%B9%B0/https://google.com/links
http:// ‫اردو‬/ google.com/links
• Demo/Writeup: Opera Android Address Bar Spoofing: CVE-2019–12278
Demo: RTL Character Opera
Demo For Content Spoofing
Content Spoofing and Malicious File Download
• This issue occurs when an attacker is able to spoof dialog boxes as well as partial content. This
can lead to phishing attacks. Some browsers also fail to respond.
• The attacker is able to control partial content via jsalert() and thus any innocent victim can enter
their credentials since alert is on the genuine site rather than appearing on parent domain.
• Mitigation: Webview fails to overwrite the WebChromeClient.onJsAlert() responsible for displaying
alert box and this way webview is not able to switch the alert function to the correct tab.
• Demo URL: https://justmorpheus.000webhostapp.com/day3/content2.html
• Demo Video
Demo For URL Bar Spoofing in Safari
CVE-2019-8727 :Spoofing in Safari for iOS 12.3 and iOS 13 Beta
• Due to insecure design principles, safari failed to handle setTimeout and setInterval methods, th
us causing a delay in the loading webpage for the non-existent port.
• Code:
<script>
setTimeout(function(){ function spoof()
{ window.location.assign(“https://www.bankofamerica.com:8090");}
setInterval(spoof(),50000); }, 100);
</script>
• Mitigation: By resetting the document object model like by displaying a white page, or showing a p
rogress bar or completely redirecting to the genuine page.
• Code Url: https://justmorpheus.000webhostapp.com/null/boa.html
• Demo/Writeup: URL Bar Spoofing Flaw in Safari for iOS 12.3 and iOS 13 Beta | CVE-2019-8727
References
• https://www.blackhat.com/docs/asia-16/materials/asia-16-Baloch-Bypassing-Browser-Security-Poli
cies-For-Fun-And-Profit.pdf – By Rafay Baloch
• https://www.bugcrowd.com/resources/webinars/browser-exploitation-for-fun-and-profit/ - By Dhiraj
Mishra
• https://cyberweek.ae/materials/D2%20COMMSEC%20-%20Call%20Of%20Duty-%20Modern%20
Browser%20Warfare%20-%20Dhiraj%20Mishra.pdf
• https://runic.pl/hitb-ios-browsers.pdf
• PPT: https://www.free-powerpoint-templates-design.com
For writeups: https://medium.com/@justm0rph3u5

Mais conteúdo relacionado

Mais procurados

Object Oriented Programming with Laravel - Session 4
Object Oriented Programming with Laravel - Session 4Object Oriented Programming with Laravel - Session 4
Object Oriented Programming with Laravel - Session 4
Shahrzad Peyman
 
Object Oriented Programming with Laravel - Session 5
Object Oriented Programming with Laravel - Session 5Object Oriented Programming with Laravel - Session 5
Object Oriented Programming with Laravel - Session 5
Shahrzad Peyman
 
Object Oriented Programming with Laravel - Session 2
Object Oriented Programming with Laravel - Session 2Object Oriented Programming with Laravel - Session 2
Object Oriented Programming with Laravel - Session 2
Shahrzad Peyman
 
Object Oriented Programming with Laravel - Session 6
Object Oriented Programming with Laravel - Session 6Object Oriented Programming with Laravel - Session 6
Object Oriented Programming with Laravel - Session 6
Shahrzad Peyman
 

Mais procurados (20)

Large-Scale Analysis of Style Injection by Relative Path Overwrite
Large-Scale Analysis of Style Injection by Relative Path OverwriteLarge-Scale Analysis of Style Injection by Relative Path Overwrite
Large-Scale Analysis of Style Injection by Relative Path Overwrite
 
Drupal security
Drupal securityDrupal security
Drupal security
 
Object Oriented Programming with Laravel - Session 4
Object Oriented Programming with Laravel - Session 4Object Oriented Programming with Laravel - Session 4
Object Oriented Programming with Laravel - Session 4
 
Object Oriented Programming with Laravel - Session 5
Object Oriented Programming with Laravel - Session 5Object Oriented Programming with Laravel - Session 5
Object Oriented Programming with Laravel - Session 5
 
Designing REST services with Spring MVC
Designing REST services with Spring MVCDesigning REST services with Spring MVC
Designing REST services with Spring MVC
 
ASP.NET MVC Performance
ASP.NET MVC PerformanceASP.NET MVC Performance
ASP.NET MVC Performance
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
 
Web Crawlers
Web CrawlersWeb Crawlers
Web Crawlers
 
Django Rest Framework - Building a Web API
Django Rest Framework - Building a Web APIDjango Rest Framework - Building a Web API
Django Rest Framework - Building a Web API
 
NullCon 2012 - Ra.2: blackbox DOM-based XSS scanner
NullCon 2012 - Ra.2: blackbox DOM-based XSS scannerNullCon 2012 - Ra.2: blackbox DOM-based XSS scanner
NullCon 2012 - Ra.2: blackbox DOM-based XSS scanner
 
Web Hacking Series Part 4
Web Hacking Series Part 4Web Hacking Series Part 4
Web Hacking Series Part 4
 
Web Crawler
Web CrawlerWeb Crawler
Web Crawler
 
Object Oriented Programming with Laravel - Session 2
Object Oriented Programming with Laravel - Session 2Object Oriented Programming with Laravel - Session 2
Object Oriented Programming with Laravel - Session 2
 
What is an API?
What is an API?What is an API?
What is an API?
 
Web hacking series part 3
Web hacking series part 3Web hacking series part 3
Web hacking series part 3
 
Web Crawling & Crawler
Web Crawling & CrawlerWeb Crawling & Crawler
Web Crawling & Crawler
 
Webcrawler
Webcrawler Webcrawler
Webcrawler
 
CSRF, ClickJacking & Open Redirect
CSRF, ClickJacking & Open RedirectCSRF, ClickJacking & Open Redirect
CSRF, ClickJacking & Open Redirect
 
Rails Concept
Rails ConceptRails Concept
Rails Concept
 
Object Oriented Programming with Laravel - Session 6
Object Oriented Programming with Laravel - Session 6Object Oriented Programming with Laravel - Session 6
Object Oriented Programming with Laravel - Session 6
 

Semelhante a Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu Shukla

Hacking HTML5 offensive course (Zeronights edition)
Hacking HTML5 offensive course (Zeronights edition)Hacking HTML5 offensive course (Zeronights edition)
Hacking HTML5 offensive course (Zeronights edition)
Krzysztof Kotowicz
 
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realities
Brad Hill
 
Krzysztof Kotowicz - Hacking HTML5
Krzysztof Kotowicz - Hacking HTML5Krzysztof Kotowicz - Hacking HTML5
Krzysztof Kotowicz - Hacking HTML5
DefconRussia
 
Secure web messaging in HTML5
Secure web messaging in HTML5Secure web messaging in HTML5
Secure web messaging in HTML5
Krishna T
 

Semelhante a Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu Shukla (20)

Html5 Application Security
Html5 Application SecurityHtml5 Application Security
Html5 Application Security
 
Html5 security
Html5 securityHtml5 security
Html5 security
 
Chrome extensions threat analysis and countermeasures
Chrome extensions threat analysis and countermeasuresChrome extensions threat analysis and countermeasures
Chrome extensions threat analysis and countermeasures
 
Building Client-Side Attacks with HTML5 Features
Building Client-Side Attacks with HTML5 FeaturesBuilding Client-Side Attacks with HTML5 Features
Building Client-Side Attacks with HTML5 Features
 
Hacking HTML5 offensive course (Zeronights edition)
Hacking HTML5 offensive course (Zeronights edition)Hacking HTML5 offensive course (Zeronights edition)
Hacking HTML5 offensive course (Zeronights edition)
 
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realities
 
Krzysztof Kotowicz - Hacking HTML5
Krzysztof Kotowicz - Hacking HTML5Krzysztof Kotowicz - Hacking HTML5
Krzysztof Kotowicz - Hacking HTML5
 
Website hacking and prevention (All Tools,Topics & Technique )
Website hacking and prevention (All Tools,Topics & Technique )Website hacking and prevention (All Tools,Topics & Technique )
Website hacking and prevention (All Tools,Topics & Technique )
 
Secure web messaging in HTML5
Secure web messaging in HTML5Secure web messaging in HTML5
Secure web messaging in HTML5
 
Going Beyond Cross Domain Boundaries (jQuery Bulgaria)
Going Beyond Cross Domain Boundaries (jQuery Bulgaria)Going Beyond Cross Domain Boundaries (jQuery Bulgaria)
Going Beyond Cross Domain Boundaries (jQuery Bulgaria)
 
Everybody loves html5,h4ck3rs too
Everybody loves html5,h4ck3rs tooEverybody loves html5,h4ck3rs too
Everybody loves html5,h4ck3rs too
 
Beef saurabh
Beef saurabhBeef saurabh
Beef saurabh
 
Making Chrome Extension with AngularJS
Making Chrome Extension with AngularJSMaking Chrome Extension with AngularJS
Making Chrome Extension with AngularJS
 
Top Ten Web Hacking Techniques – 2008
Top Ten Web Hacking Techniques – 2008Top Ten Web Hacking Techniques – 2008
Top Ten Web Hacking Techniques – 2008
 
How do JavaScript frameworks impact the security of applications?
How do JavaScript frameworks impact the security of applications?How do JavaScript frameworks impact the security of applications?
How do JavaScript frameworks impact the security of applications?
 
Blackhat11 shreeraj reverse_engineering_browser
Blackhat11 shreeraj reverse_engineering_browserBlackhat11 shreeraj reverse_engineering_browser
Blackhat11 shreeraj reverse_engineering_browser
 
Web security: Securing Untrusted Web Content in Browsers
Web security: Securing Untrusted Web Content in BrowsersWeb security: Securing Untrusted Web Content in Browsers
Web security: Securing Untrusted Web Content in Browsers
 
HTML5 - The Promise & The Peril
HTML5 - The Promise & The PerilHTML5 - The Promise & The Peril
HTML5 - The Promise & The Peril
 
Warning Ahead: SecurityStorms are Brewing in Your JavaScript
Warning Ahead: SecurityStorms are Brewing in Your JavaScriptWarning Ahead: SecurityStorms are Brewing in Your JavaScript
Warning Ahead: SecurityStorms are Brewing in Your JavaScript
 
Html5 hacking
Html5 hackingHtml5 hacking
Html5 hacking
 

Último

在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
ydyuyu
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
ayvbos
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
gajnagarg
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
ydyuyu
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
ayvbos
 
PowerDirector Explination Process...pptx
PowerDirector Explination Process...pptxPowerDirector Explination Process...pptx
PowerDirector Explination Process...pptx
galaxypingy
 
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Monica Sydney
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Monica Sydney
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Monica Sydney
 

Último (20)

在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
PowerDirector Explination Process...pptx
PowerDirector Explination Process...pptxPowerDirector Explination Process...pptx
PowerDirector Explination Process...pptx
 
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
Microsoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftMicrosoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck Microsoft
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 

Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu Shukla

  • 1. Divyanshu Shukla (justm0rph3u5) Information Security Engineer Browser Hacking For Fun & Profit @justm0rph3u5 @justm0rph3u5
  • 2. Agenda • Introduction of Browsers • Working of Browsers • Basic Features • Origin and Same Origin Policy • Same Origin Policy in action • Content Security Policy • Common Attacks on Browsers/WebView • RCE and Cross Scheme Data Exposure • Demo For UXSS • Demo For Denial Of Service • Demo For SOP Same Origin Bypasses • Demo For Address Bar Spoofing in Android • Demo For Address Bar Spoofing in Safari • Demo For Content Spoofing
  • 4. Basic Features Features Provided By Browser: • Multiple tabs • Address bar • Autocomplete • Password manager Downloads • Support for untrusted SSL certificates • Safety ratings • Malware protection • Cloud integration • Adware Blocker, etc.
  • 5. Origin Origin Two URLs have the same origin if the protocol, port (if specified), and host are the same for both.
  • 6. Same Origin Policy Same Origin • The same-origin policy is a critical security mechanism that restricts how a document is loaded from one origin can interact with a resource from another origin. • In simple words, two webpages are on same origin if they have the same URL scheme, hostname and port number. Same Origin Bypass • SOP bypasses is mostly occurred due to logical confusion between different layers where one layer parses the input in a different way and another in a different way.
  • 7. SOP In Action Code For SOP <script> var x = new XMLHttpRequest(); x.open('GET','http://www.gmail.com', true) x.send() document.write(x.responseText); </script> SOP restricts it from accessing contents present at https://www.gmail.com due to scheme and host mismatch.
  • 8. Content Security Policy CSP & CSP Bypass • Content Security Policy (CSP) is an added layer of security that helps to detect and mitigate cert ain types of attacks, including Cross Site Scripting (XSS) and data injection attacks. • CSP bypass in not always a security bug. • Content-Security-Policy: policy
  • 9. Common Attacks • Cross Scheme Data Exposure Attacks • Remote Code Execution • DOS • UXSS • SOP Bypass • Spoofing • Fuzzing Most Common Attacks on WebView/Browsers SOP bypass / UXSS
  • 10. RCE and Cross Scheme Data Exposure Cross Scheme Data Exposure • In browser modern HTTP and file scheme (file:///etc/passwd) are both treated as a different origin. If javascript at HTTP scheme can load and read local files it results in a SOP bypass and causes directory traversal attacks • Mozilla provides a component known as “nsILocalFile” and it is possible to navigate to different path separators used on different platforms, query the state ofany file or directory. • This component can be refer using the string '@mozilla.org/file/local;1‘ to create an instance whi ch can alsobe known as Contract. • This caused code execution. Remote Code Execution
  • 11. Demo for Denial Of Service Denial of Service • Denial of Service Vulnerability is when application fails to provide service and crashes. • Here SetInterval function was used to exploit in the browser for this case. This vulnerability makes the resource unavailable and thus the browser crashes. • Browser allows javascript to update the address bar while the page is still loading which is causing browsers to crash or freeze thus causing dos attack. • Mitigation: For solution browser window should not be allowed to update address page while loadi ng. The application should be able to handle exceptions instead of freezing. • Code Url: https://justmorpheus.000webhostapp.com/null/dos.html • Demo Video
  • 12. Demo For Universal XSS CVE-2019-13607* : UXSS via Javascript Protocol • Attacker controlled domain returns "javascript:code_here" in "location" header then browser executes the javascript code in the context of target domain instead of attacker domain. • The value of "location" header is "javascript:alert()" then javascript code "alert()" gets executed by the browser. • Mitigation: Browser should not be allowed to execute the javascript code in the context of the domain from where the navigation was initiated. • Code Url: http://rakeshmane.com/secret.html • Demo Video Thanks to Rakesh Mane for discovering UXSS
  • 13. UXSS / SOP Bypass Stealing Credentials • A server-redirect combined with a data-uri end up bypassing the Same Origin Policy, which leads t o all kind of vulnerabilities like stealing user passwords in plain-text (thanks to the password mana ger), grabbing cookies, spoofing the content and referrer, etc. • The rule of thumb when discussing defending against UXSS is have everything patched and up to date.
  • 14. Demo For Same Origin Policy Bypass CVE-2019-14962: SOP Bypass via URL Spoofing • A SOP bypass is when a javascript present in the origin like example.com is able to access proper ties of webpage on another origin http://example2.com such as cookies, location, response, etc. • It occurs in the browser when window.open() opens a new child tab and rewrites in the innerHTML to gather credentials using fake pop up alert. • Mitigation: By keeping a check on creating model regarding SOP and also by decreasing the comp lexity of JavaScript and DOM. • Code Url: https://justmorpheus.000webhostapp.com/null/sopbypass.html • Demo Video
  • 15. Spoofing Attacks Introduction to Spoofing Attacks • Google security team themselves state that "We recognize that the address bar is the only reliable security indicator in modern browsers" . • Initialize and Interrupt” technique. • Load and Overwrite Race Conditions • Loading Loop • Spoofing Using RTL Characters • Content Spoofing via Popup
  • 16. Demo For Address Bar Spoofing CVE-2019–12278 : Address Bar Spoofing Using RTL Characters • Opera android suffers from address bar spoofing vulnerability. Characters from languages are suc h as Persian, Arabic are displayed in right to left order, usage prescribed is Unicode Bidirectional A lgorithm. Unicode characters such as U+08FF, U+FB50, etc are rendered from right to left so it ca n be used to spoof the URL. • Mitigation: All these URLs must be rendered in similar fashion i.e. left to right. Check the RFC for more details. • Malicious URL: http://3.17.56.213/%EF%B9%B0/https://google.com/links http:// ‫اردو‬/ google.com/links • Demo/Writeup: Opera Android Address Bar Spoofing: CVE-2019–12278
  • 18. Demo For Content Spoofing Content Spoofing and Malicious File Download • This issue occurs when an attacker is able to spoof dialog boxes as well as partial content. This can lead to phishing attacks. Some browsers also fail to respond. • The attacker is able to control partial content via jsalert() and thus any innocent victim can enter their credentials since alert is on the genuine site rather than appearing on parent domain. • Mitigation: Webview fails to overwrite the WebChromeClient.onJsAlert() responsible for displaying alert box and this way webview is not able to switch the alert function to the correct tab. • Demo URL: https://justmorpheus.000webhostapp.com/day3/content2.html • Demo Video
  • 19. Demo For URL Bar Spoofing in Safari CVE-2019-8727 :Spoofing in Safari for iOS 12.3 and iOS 13 Beta • Due to insecure design principles, safari failed to handle setTimeout and setInterval methods, th us causing a delay in the loading webpage for the non-existent port. • Code: <script> setTimeout(function(){ function spoof() { window.location.assign(“https://www.bankofamerica.com:8090");} setInterval(spoof(),50000); }, 100); </script> • Mitigation: By resetting the document object model like by displaying a white page, or showing a p rogress bar or completely redirecting to the genuine page. • Code Url: https://justmorpheus.000webhostapp.com/null/boa.html • Demo/Writeup: URL Bar Spoofing Flaw in Safari for iOS 12.3 and iOS 13 Beta | CVE-2019-8727
  • 20. References • https://www.blackhat.com/docs/asia-16/materials/asia-16-Baloch-Bypassing-Browser-Security-Poli cies-For-Fun-And-Profit.pdf – By Rafay Baloch • https://www.bugcrowd.com/resources/webinars/browser-exploitation-for-fun-and-profit/ - By Dhiraj Mishra • https://cyberweek.ae/materials/D2%20COMMSEC%20-%20Call%20Of%20Duty-%20Modern%20 Browser%20Warfare%20-%20Dhiraj%20Mishra.pdf • https://runic.pl/hitb-ios-browsers.pdf • PPT: https://www.free-powerpoint-templates-design.com

Notas do Editor

  1. From Dhiraj Mishra’s PPT