SlideShare a Scribd company logo
© Digital Security
MITM Attacks on HTTPS:
Another Perspective
Alexey GreenDog Tyurin
@antyurin
© Digital Security 2
MITM Attacks on HTTPS: Another Perspective
About me
• Pentester
• Security researcher
• WEB/Java/Network security fun
• EasyHack for “Xakep”
• Co-organizer ZeroNights
• Co-organizer Defcon Russia 7812
© Digital Security 3
MITM Attacks on HTTPS: Another Perspective
HTTPS
• TLS (SSL)+ HTTP
• Protects against man-in-the-middle attacks
• Authentication, Encryption, Integrity – Silver bullet ?
• Crypto attacks:
- POODLE, BEAST, CRIME… Hard to exploit
© Digital Security 4
MITM Attacks on HTTPS: Another Perspective
TLS specifics
• Knows nothing including protocol:
HTTP/SMTP/POP3/TDS/…+TLS TLS
HTTP
© Digital Security 5
MITM Attacks on HTTPS: Another Perspective
TLS specifics
• Application layer
• Knows nothing about underlying protocol
• Doesn’t protect against destination changing (IP, port)
IP
TCP
TLS
HTTP
© Digital Security 6
MITM Attacks on HTTPS: Another Perspective
TLS specifics
• Authentication using x509 certificates
• Client compares server name and SAN field of certificate
© Digital Security 7
MITM Attacks on HTTPS: Another Perspective
Certificates features and limitations
• Doesn’t care about port (many services – 1 certificate)
• For a wide range of domain names:
• Many names in SAN - Subject Alternative Name (+ CN*)
• Wildcard certificate
• No SNI
• TLS cache **
• HTTP/2 connection sharing**
*Since 58, Chrome doesn’t check CN, only SAN (because of RFC)
** http://antoine.delignat-lavaud.fr/doc/www15.pdf
© Digital Security 8
MITM Attacks on HTTPS: Another Perspective
Wildcard names
© Digital Security 9
MITM Attacks on HTTPS: Another Perspective
A lot of names in SAN
© Digital Security 10
MITM Attacks on HTTPS: Another Perspective
TLS Redirection
• Group of MitM attacks – misuse of authentication limits and features
• Any protocol
• Virtual host confusion (http://antoine.delignat-lavaud.fr/doc/www15.pdf)
© Digital Security 11
MITM Attacks on HTTPS: Another Perspective
Simplest example
• Attacker (A) controls files on HostB
• A. uploads own new_version.exe on HostB
• Autoupdate on Victim (V) requests a new version of software:
https://www.correct.com/new_version.exe
• A. MitMs and redirect to HostB
• Autoupdate downloads and runs A’s exe file
© Digital Security 12
MITM Attacks on HTTPS: Another Perspective
Requirements
• HostA and HostB have different IP (or ports)
• HostB has an x509 certificate
with the domain name of HostA in SAN
© Digital Security 13
MITM Attacks on HTTPS: Another Perspective
Requirements
• Depends on a situation:
• When a request for HostA comes to HostB, there is no such a value in virtual hosts of HostB
webserver, HostB serves default domain.
© Digital Security 14
MITM Attacks on HTTPS: Another Perspective
Requirements
• A. controls something in user’s requests or server’s responses
© Digital Security 15
MITM Attacks on HTTPS: Another Perspective
Level of control
What can A. control with the help of a server’s response (with focus on HTTPS):
• Nothing
• Parts of response (some values in body)
• Full body of a specific URL.
• Full body of any URL.
• Full control (header, body) w/o access to TLS key.
© Digital Security 16
MITM Attacks on HTTPS: Another Perspective
Common example – XSS
XSS on HostB (Part of body)
1. V. request to HostA + xss of HostB
https://www.correct.com/xss_of_hostb_here
2. A. MitMs and changes an IP
3. HostB responses with A’s JS
- V. executes JS (context of HostA)
- A. stops the MitM attack
4. JS can interact with HostA in a usual
way
Browser knows nothing about MitM!
© Digital Security 17
MITM Attacks on HTTPS: Another Perspective
Video. XSS
© Digital Security 18
MITM Attacks on HTTPS: Another Perspective
Tricks
A. can make injections into any http traffic:
• no need to force user to open a link w/ HostB XSS
© Digital Security 19
MITM Attacks on HTTPS: Another Perspective
Tricks
A. can make injections into any http traffic:
• A. can add HostB’s cookies for HostA
and exploit XSS of HostB w/ auth
(cookie forcing)
We can exploit Self-XSS! %P
© Digital Security 20
MITM Attacks on HTTPS: Another Perspective
Flash
• Crossdomain.xml allows cross domain interaction
HostB:
• API server
• No cookie
• Has crossdomain.xml file with * (or similar)
<cross-domain-policy><allow-access-from domain="*" secure=“true"/></cross-domain-policy>
No way to perform an attack?
© Digital Security 21
MITM Attacks on HTTPS: Another Perspective
Flash
Crossdomain.xml w/ * on HostB
(nothing)
1. V . opens A’s swf
- Swf sends request to HostA
2. Flash checks crossdomain.xml
3. A. MitMs and changes an IP
4. HostB responses w/ crossdomain.xml
- Swf is allowed to interact w/ HostA
- A. stops the MitM attack
5. SWF can interact with HostA in a
usual way
© Digital Security 22
MITM Attacks on HTTPS: Another Perspective
Cross protocol - IE
Text-based service that reflects requests on HostB
• SMTP, POP3, IMAP, etc
• Browser - Internet Explorer
• Old school attack
• HTTP/0.9
• Content-Sniffing (.html)
• Port restriction – doesn’t work, It’s MitM
© Digital Security 23
MITM Attacks on HTTPS: Another Perspective
Cross protocol - IE
Text-based service that reflects requests
on HostB
• SMTP, POP3, IMAP, etc
• Browser - Internet Explorer
• Old school attack
• HTTP/0.9
• Content-Sniffing (.html)
• Port restriction – doesn’t work, It’s MitM
© Digital Security 24
MITM Attacks on HTTPS: Another Perspective
Cross protocol - IE
1. V. sends the POST request w/ JS payload to “any_url.html on” to
HostA
2. A. MitMs and changes an IP
3. HostB reflects the request
- IE interprets it as HTTP/0.9
- “.html” forces IE to parse as html
- V. executes JS (in the context of HostA)
- A. stops the MitM attack
4. JS can interact with HostA in a usual way
© Digital Security 25
MITM Attacks on HTTPS: Another Perspective
Video. Cross protocol - IE
© Digital Security 26
MITM Attacks on HTTPS: Another Perspective
Cross protocol – Other browsers (FF, Chrome)
A. wants to steal Basic Auth header or HttpOnly cookie
A. has XSS on HostA (can execute JS in it’s context) (Nothing)
1. JS sends a request to HostA
2. A. MitMs and changes IP
3. HostB reflects the request
-Browser interprets it as HTTP/0.9, text/plain
- JS is allowed to read response (same origin)
© Digital Security 27
MITM Attacks on HTTPS: Another Perspective
JavaScript +DOM
Web app w/ JQuery uses load() to get content
Text-based service that reflects requests on HostB (Nothing) or file uploading is possible
0. A. sets a cookie w/ xss on HostA (cookie forcing)
Set-Cookie: test=<script src=“…”>
1. V. opens HostA. Jquery is loaded.
- For other requests load() is used
2. load sends a request to HostA
3. A. MitMs and changes an IP
4. HostB reflects the request
-Browser interprets it as HTTP/0.9, text/plain
- Jquery.load parses it and execute our XSS payload
5. Our JS can interact with HostA in a usual way
© Digital Security 28
MITM Attacks on HTTPS: Another Perspective
REST API
V. is a web app that checks auth (for 200 OK) using HostA REST API
Text-based service that reflects requests on HostB (Nothing) or it returns 200 OK for any requests
1. A. tries to auth on V
2. V. sends request to HostA to check auth
3. A. MitMs and changes an IP
4. HostB reflects all the request
- Curl interprets it as HTTP/0.9 *
- Curl returns CURLE_OK
5. A. is authenticated
* https://github.com/curl/curl/issues/467
© Digital Security 29
MITM Attacks on HTTPS: Another Perspective
Upload anything
A. can upload files on HostB
Too simple:
• Html w/ xss , SWF, PDF … (SDRF attack)
• Everything is executed in the context of HostA
The same attack as in the example with XSS
© Digital Security 30
MITM Attacks on HTTPS: Another Perspective
Active content substitution
A. can upload files on HostB, but w/ “uninteresting” Content-Type (text/plain, image/png)
or Content-Disposition (any path)
Think out of the box:
• Page consists of html, external files – JavaScript and CSS
• Force downloading JS from another host
• https://hosta/script.js
© Digital Security 31
MITM Attacks on HTTPS: Another Perspective
Active content substitution
• Page consists of html, external files – JavaScript and CSS
• Force downloading JS from another host
• One TLS for all content?
© Digital Security 32
MITM Attacks on HTTPS: Another Perspective
Browsers behavior
<script src=“script.js”> and headers:
- no browser cares about Content-Disposition header
- IE doesn't care about Content-Type header (without nosniff)
- FF, Chrome, Edge dont't execute script only if Content-Type is from
"image" family (without nosniff)
- with X-Content-Type-Options, all the browsers require correct
Content-Type
© Digital Security 33
MITM Attacks on HTTPS: Another Perspective
Active content substitution
Possible Attacks:
• External files is on another web site (https://static.correct.com/script.js)
– easy for MitM (static.correct.com -> HostB)
• Protocol attacks
© Digital Security 34
MITM Attacks on HTTPS: Another Perspective
Active content substitution
Possible Attacks:
• WPAD
• Automatic proxy detection. Windows, by
default
• Pac file w/ rules
• For Chrome, Firefox:
different proxies for different URLs
• Chrome – patched, FF – will be patched;
Windows – partly patched; after BH 2016 
• Now: Useful only for different sites (and tricks)
© Digital Security 35
MITM Attacks on HTTPS: Another Perspective
Active content substitution
Possible Attacks:
• Browser’s cache misuse
• By default, web servers add cache headers to “static” content (javascript, css, etc)
• Browser cache is URL-based
© Digital Security 36
MITM Attacks on HTTPS: Another Perspective
Active content substitution
A. can upload files on HostB, but w/ “uninteresting” Content-Type or Content-Disposition (any path)
1. V. request to HostA + script.js of HostB
2. A. MitMs and changes IP
3. HostB responses with A’s JS
- V. caches JS for url:
https://hosta/script.js
- A. stops mitm attack
4. A. forces V. to open HostA
- V. parses html from HostA
- But takes script.js from its cache, cause it’s there and still fresh
- V. executes JS (in the context of HostA)
- JS can interact with HostA in a usual way
© Digital Security 37
MITM Attacks on HTTPS: Another Perspective
Active content substitution
© Digital Security 38
MITM Attacks on HTTPS: Another Perspective
Active content substitution - Trick
A. can upload files on HostB, but w/ “uninteresting” Content-Type or Content-Disposition
(specific path)
How can we manipulate with a path?
Depends on technologies
• RPO
• Default error page w/ relative scripts
https://hosta/anything_here/lalala/ -> anything_here/lalala/script.js
• IE HostHeader injection
• …
© Digital Security 39
MITM Attacks on HTTPS: Another Perspective
What else?
• HTTPS 2 HTTP redirect
• Reverse Proxy misrouting (CDNs)
• Certificate Pinning
• Client Cert auth "bypass“
• CSP bypass
• Crypto attacks
• Another Protocols
• …
© Digital Security 40
MITM Attacks on HTTPS: Another Perspective
Conclusion
TLS Redirection
• Based on TLS features
• Based on your imagination and circumstances
• For any protocol (but works best for HTTPS)
• Not so hard to exploit
• You can get something from nothing (or misuse safe stuff)
© Digital Security 41
MITM Attacks on HTTPS: Another Perspective
Conclusion
TLS Redirection
• “New” approach of attacking TLS
secured protocols
• The security level of web service equals
to the security level of the weakest
service with common certificate
• Based on the certificate of the weakest
service
© Digital Security 42
MITM Attacks on HTTPS: Another Perspective
Conclusion
• Awareness
• Need more research
• There will be a lot of stuff and tricks - https://github.com/GrrrDog/TLS-Redirection
Read about Virtual Host Confusion - https://bh.ht.vc/ - AWESOME STUFF THERE!
© Digital Security 43
MITM Attacks on HTTPS: Another Perspective
Questions
www.twitter.com/antyurin
a.tyurin@dsec.ru

More Related Content

What's hot

Evolution Of The Web Platform & Browser Security
Evolution Of The Web Platform & Browser SecurityEvolution Of The Web Platform & Browser Security
Evolution Of The Web Platform & Browser Security
Sanjeev Verma, PhD
 
Top Ten Web Hacking Techniques (2008)
Top Ten Web Hacking Techniques (2008)Top Ten Web Hacking Techniques (2008)
Top Ten Web Hacking Techniques (2008)
Jeremiah Grossman
 
Html5 localstorage attack vectors
Html5 localstorage attack vectorsHtml5 localstorage attack vectors
Html5 localstorage attack vectors
Shreeraj Shah
 
OWASP San Diego Training Presentation
OWASP San Diego Training PresentationOWASP San Diego Training Presentation
OWASP San Diego Training Presentation
owaspsd
 
Top Ten Web Hacking Techniques (2010)
Top Ten Web Hacking Techniques (2010)Top Ten Web Hacking Techniques (2010)
Top Ten Web Hacking Techniques (2010)
Jeremiah Grossman
 
Drivesploit: Circumventing Both Automated AND Manual Drive-By-Download Detection
Drivesploit: Circumventing Both Automated AND Manual Drive-By-Download DetectionDrivesploit: Circumventing Both Automated AND Manual Drive-By-Download Detection
Drivesploit: Circumventing Both Automated AND Manual Drive-By-Download Detection
Wayne Huang
 
Hacking Adobe Experience Manager sites
Hacking Adobe Experience Manager sitesHacking Adobe Experience Manager sites
Hacking Adobe Experience Manager sites
Mikhail Egorov
 
Secuirty News Bytes-Bangalore may 2014
Secuirty News Bytes-Bangalore may 2014 Secuirty News Bytes-Bangalore may 2014
Secuirty News Bytes-Bangalore may 2014
n|u - The Open Security Community
 
DEfcon15 XXE XXS
DEfcon15 XXE XXSDEfcon15 XXE XXS
DEfcon15 XXE XXS
pentest pentest
 
When you don't have 0days: client-side exploitation for the masses
When you don't have 0days: client-side exploitation for the massesWhen you don't have 0days: client-side exploitation for the masses
When you don't have 0days: client-side exploitation for the masses
Michele Orru
 
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
Mikhail Egorov
 
Web Application Firewall: Suckseed or Succeed
Web Application Firewall: Suckseed or SucceedWeb Application Firewall: Suckseed or Succeed
Web Application Firewall: Suckseed or Succeed
Prathan Phongthiproek
 
Same Origin Policy Weaknesses
Same Origin Policy WeaknessesSame Origin Policy Weaknesses
Same Origin Policy Weaknesses
kuza55
 
JavaScript Security
JavaScript SecurityJavaScript Security
JavaScript Security
Jason Harwig
 
Javascript Security
Javascript SecurityJavascript Security
Javascript Security
jgrahamc
 
Hacking WebApps for fun and profit : how to approach a target?
Hacking WebApps for fun and profit : how to approach a target?Hacking WebApps for fun and profit : how to approach a target?
Hacking WebApps for fun and profit : how to approach a target?
Yassine Aboukir
 
Defeating xss-and-xsrf-with-my faces-frameworks-steve-wolf
Defeating xss-and-xsrf-with-my faces-frameworks-steve-wolfDefeating xss-and-xsrf-with-my faces-frameworks-steve-wolf
Defeating xss-and-xsrf-with-my faces-frameworks-steve-wolf
drewz lin
 
Introduction to Cross Site Scripting ( XSS )
Introduction to Cross Site Scripting ( XSS )Introduction to Cross Site Scripting ( XSS )
Introduction to Cross Site Scripting ( XSS )
Irfad Imtiaz
 
Sandboxed platform using IFrames, postMessage and localStorage
Sandboxed platform using IFrames, postMessage and localStorageSandboxed platform using IFrames, postMessage and localStorage
Sandboxed platform using IFrames, postMessage and localStorage
tomasperezv
 
Phu appsec13
Phu appsec13Phu appsec13
Phu appsec13
drewz lin
 

What's hot (20)

Evolution Of The Web Platform & Browser Security
Evolution Of The Web Platform & Browser SecurityEvolution Of The Web Platform & Browser Security
Evolution Of The Web Platform & Browser Security
 
Top Ten Web Hacking Techniques (2008)
Top Ten Web Hacking Techniques (2008)Top Ten Web Hacking Techniques (2008)
Top Ten Web Hacking Techniques (2008)
 
Html5 localstorage attack vectors
Html5 localstorage attack vectorsHtml5 localstorage attack vectors
Html5 localstorage attack vectors
 
OWASP San Diego Training Presentation
OWASP San Diego Training PresentationOWASP San Diego Training Presentation
OWASP San Diego Training Presentation
 
Top Ten Web Hacking Techniques (2010)
Top Ten Web Hacking Techniques (2010)Top Ten Web Hacking Techniques (2010)
Top Ten Web Hacking Techniques (2010)
 
Drivesploit: Circumventing Both Automated AND Manual Drive-By-Download Detection
Drivesploit: Circumventing Both Automated AND Manual Drive-By-Download DetectionDrivesploit: Circumventing Both Automated AND Manual Drive-By-Download Detection
Drivesploit: Circumventing Both Automated AND Manual Drive-By-Download Detection
 
Hacking Adobe Experience Manager sites
Hacking Adobe Experience Manager sitesHacking Adobe Experience Manager sites
Hacking Adobe Experience Manager sites
 
Secuirty News Bytes-Bangalore may 2014
Secuirty News Bytes-Bangalore may 2014 Secuirty News Bytes-Bangalore may 2014
Secuirty News Bytes-Bangalore may 2014
 
DEfcon15 XXE XXS
DEfcon15 XXE XXSDEfcon15 XXE XXS
DEfcon15 XXE XXS
 
When you don't have 0days: client-side exploitation for the masses
When you don't have 0days: client-side exploitation for the massesWhen you don't have 0days: client-side exploitation for the masses
When you don't have 0days: client-side exploitation for the masses
 
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
 
Web Application Firewall: Suckseed or Succeed
Web Application Firewall: Suckseed or SucceedWeb Application Firewall: Suckseed or Succeed
Web Application Firewall: Suckseed or Succeed
 
Same Origin Policy Weaknesses
Same Origin Policy WeaknessesSame Origin Policy Weaknesses
Same Origin Policy Weaknesses
 
JavaScript Security
JavaScript SecurityJavaScript Security
JavaScript Security
 
Javascript Security
Javascript SecurityJavascript Security
Javascript Security
 
Hacking WebApps for fun and profit : how to approach a target?
Hacking WebApps for fun and profit : how to approach a target?Hacking WebApps for fun and profit : how to approach a target?
Hacking WebApps for fun and profit : how to approach a target?
 
Defeating xss-and-xsrf-with-my faces-frameworks-steve-wolf
Defeating xss-and-xsrf-with-my faces-frameworks-steve-wolfDefeating xss-and-xsrf-with-my faces-frameworks-steve-wolf
Defeating xss-and-xsrf-with-my faces-frameworks-steve-wolf
 
Introduction to Cross Site Scripting ( XSS )
Introduction to Cross Site Scripting ( XSS )Introduction to Cross Site Scripting ( XSS )
Introduction to Cross Site Scripting ( XSS )
 
Sandboxed platform using IFrames, postMessage and localStorage
Sandboxed platform using IFrames, postMessage and localStorageSandboxed platform using IFrames, postMessage and localStorage
Sandboxed platform using IFrames, postMessage and localStorage
 
Phu appsec13
Phu appsec13Phu appsec13
Phu appsec13
 

Similar to MITM Attacks on HTTPS: Another Perspective

Analysis of HTTP Security Headers in Turkey
Analysis of HTTP Security Headers in TurkeyAnalysis of HTTP Security Headers in Turkey
Analysis of HTTP Security Headers in Turkey
Dr. Emin İslam Tatlı
 
526_topic08.ppt
526_topic08.ppt526_topic08.ppt
526_topic08.ppt
sajeedmalagi
 
Html5 Application Security
Html5 Application SecurityHtml5 Application Security
Html5 Application Security
chuckbt
 
Http requesting smuggling
Http requesting smugglingHttp requesting smuggling
Http requesting smuggling
Apijay Kumar
 
Http requesting smuggling
Http requesting smugglingHttp requesting smuggling
Http requesting smuggling
Apijay Kumar
 
Browser Security
Browser SecurityBrowser Security
Browser Security
Roberto Suggi Liverani
 
The WAF book intro protection elements v1.0 lior rotkovitch
The WAF book intro protection elements v1.0 lior rotkovitchThe WAF book intro protection elements v1.0 lior rotkovitch
The WAF book intro protection elements v1.0 lior rotkovitch
Lior Rotkovitch
 
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)
Ivo Andreev
 
15_526_topic11 for topics for students.ppt
15_526_topic11 for topics for students.ppt15_526_topic11 for topics for students.ppt
15_526_topic11 for topics for students.ppt
shatrutrial44
 
Presentation on Application layer_201.pdf
Presentation on Application layer_201.pdfPresentation on Application layer_201.pdf
Presentation on Application layer_201.pdf
prince2412001
 
HTTP cookie hijacking in the wild: security and privacy implications
HTTP cookie hijacking in the wild: security and privacy implicationsHTTP cookie hijacking in the wild: security and privacy implications
HTTP cookie hijacking in the wild: security and privacy implications
Priyanka Aash
 
Top 10 Web Hacks 2012
Top 10 Web Hacks 2012Top 10 Web Hacks 2012
Top 10 Web Hacks 2012
Matt Johansen
 
ASM 11.6 DDoS profile- lior rotkovitch
ASM 11.6 DDoS profile- lior rotkovitchASM 11.6 DDoS profile- lior rotkovitch
ASM 11.6 DDoS profile- lior rotkovitch
Lior Rotkovitch
 
14_526_topic11.ppt
14_526_topic11.ppt14_526_topic11.ppt
14_526_topic11.ppt
ssuserec53e73
 
14_526_topic11.ppt
14_526_topic11.ppt14_526_topic11.ppt
14_526_topic11.ppt
ssuserec53e73
 
Securing your web application through HTTP headers
Securing your web application through HTTP headersSecuring your web application through HTTP headers
Securing your web application through HTTP headers
Andre N. Klingsheim
 
Eradicate the Bots in the Belfry - Information Security Summit - Eric Vanderburg
Eradicate the Bots in the Belfry - Information Security Summit - Eric VanderburgEradicate the Bots in the Belfry - Information Security Summit - Eric Vanderburg
Eradicate the Bots in the Belfry - Information Security Summit - Eric Vanderburg
Eric Vanderburg
 
Isys20261 lecture 09
Isys20261 lecture 09Isys20261 lecture 09
Isys20261 lecture 09
Wiliam Ferraciolli
 
BeEF_EUSecWest-2012_Michele-Orru
BeEF_EUSecWest-2012_Michele-OrruBeEF_EUSecWest-2012_Michele-Orru
BeEF_EUSecWest-2012_Michele-Orru
Michele Orru
 
Top Ten Web Hacking Techniques – 2008
Top Ten Web Hacking Techniques – 2008Top Ten Web Hacking Techniques – 2008
Top Ten Web Hacking Techniques – 2008
Jeremiah Grossman
 

Similar to MITM Attacks on HTTPS: Another Perspective (20)

Analysis of HTTP Security Headers in Turkey
Analysis of HTTP Security Headers in TurkeyAnalysis of HTTP Security Headers in Turkey
Analysis of HTTP Security Headers in Turkey
 
526_topic08.ppt
526_topic08.ppt526_topic08.ppt
526_topic08.ppt
 
Html5 Application Security
Html5 Application SecurityHtml5 Application Security
Html5 Application Security
 
Http requesting smuggling
Http requesting smugglingHttp requesting smuggling
Http requesting smuggling
 
Http requesting smuggling
Http requesting smugglingHttp requesting smuggling
Http requesting smuggling
 
Browser Security
Browser SecurityBrowser Security
Browser Security
 
The WAF book intro protection elements v1.0 lior rotkovitch
The WAF book intro protection elements v1.0 lior rotkovitchThe WAF book intro protection elements v1.0 lior rotkovitch
The WAF book intro protection elements v1.0 lior rotkovitch
 
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)
 
15_526_topic11 for topics for students.ppt
15_526_topic11 for topics for students.ppt15_526_topic11 for topics for students.ppt
15_526_topic11 for topics for students.ppt
 
Presentation on Application layer_201.pdf
Presentation on Application layer_201.pdfPresentation on Application layer_201.pdf
Presentation on Application layer_201.pdf
 
HTTP cookie hijacking in the wild: security and privacy implications
HTTP cookie hijacking in the wild: security and privacy implicationsHTTP cookie hijacking in the wild: security and privacy implications
HTTP cookie hijacking in the wild: security and privacy implications
 
Top 10 Web Hacks 2012
Top 10 Web Hacks 2012Top 10 Web Hacks 2012
Top 10 Web Hacks 2012
 
ASM 11.6 DDoS profile- lior rotkovitch
ASM 11.6 DDoS profile- lior rotkovitchASM 11.6 DDoS profile- lior rotkovitch
ASM 11.6 DDoS profile- lior rotkovitch
 
14_526_topic11.ppt
14_526_topic11.ppt14_526_topic11.ppt
14_526_topic11.ppt
 
14_526_topic11.ppt
14_526_topic11.ppt14_526_topic11.ppt
14_526_topic11.ppt
 
Securing your web application through HTTP headers
Securing your web application through HTTP headersSecuring your web application through HTTP headers
Securing your web application through HTTP headers
 
Eradicate the Bots in the Belfry - Information Security Summit - Eric Vanderburg
Eradicate the Bots in the Belfry - Information Security Summit - Eric VanderburgEradicate the Bots in the Belfry - Information Security Summit - Eric Vanderburg
Eradicate the Bots in the Belfry - Information Security Summit - Eric Vanderburg
 
Isys20261 lecture 09
Isys20261 lecture 09Isys20261 lecture 09
Isys20261 lecture 09
 
BeEF_EUSecWest-2012_Michele-Orru
BeEF_EUSecWest-2012_Michele-OrruBeEF_EUSecWest-2012_Michele-Orru
BeEF_EUSecWest-2012_Michele-Orru
 
Top Ten Web Hacking Techniques – 2008
Top Ten Web Hacking Techniques – 2008Top Ten Web Hacking Techniques – 2008
Top Ten Web Hacking Techniques – 2008
 

Recently uploaded

存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
fovkoyb
 
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
vmemo1
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
Trish Parr
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
davidjhones387
 
7 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 20247 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 2024
Danica Gill
 
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
bseovas
 
Explore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories SecretlyExplore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories Secretly
Trending Blogers
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
xjq03c34
 
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
ukwwuq
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
Paul Walk
 
Azure EA Sponsorship - Customer Guide.pdf
Azure EA Sponsorship - Customer Guide.pdfAzure EA Sponsorship - Customer Guide.pdf
Azure EA Sponsorship - Customer Guide.pdf
AanSulistiyo
 
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
bseovas
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
ysasp1
 
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
uehowe
 
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfMeet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Florence Consulting
 
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
cuobya
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
uehowe
 
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
zyfovom
 
Understanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdfUnderstanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdf
SEO Article Boost
 
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
cuobya
 

Recently uploaded (20)

存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
 
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
 
7 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 20247 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 2024
 
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
 
Explore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories SecretlyExplore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories Secretly
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
 
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
 
Azure EA Sponsorship - Customer Guide.pdf
Azure EA Sponsorship - Customer Guide.pdfAzure EA Sponsorship - Customer Guide.pdf
Azure EA Sponsorship - Customer Guide.pdf
 
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
 
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
 
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfMeet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
 
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
 
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
 
Understanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdfUnderstanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdf
 
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
 

MITM Attacks on HTTPS: Another Perspective

  • 1. © Digital Security MITM Attacks on HTTPS: Another Perspective Alexey GreenDog Tyurin @antyurin
  • 2. © Digital Security 2 MITM Attacks on HTTPS: Another Perspective About me • Pentester • Security researcher • WEB/Java/Network security fun • EasyHack for “Xakep” • Co-organizer ZeroNights • Co-organizer Defcon Russia 7812
  • 3. © Digital Security 3 MITM Attacks on HTTPS: Another Perspective HTTPS • TLS (SSL)+ HTTP • Protects against man-in-the-middle attacks • Authentication, Encryption, Integrity – Silver bullet ? • Crypto attacks: - POODLE, BEAST, CRIME… Hard to exploit
  • 4. © Digital Security 4 MITM Attacks on HTTPS: Another Perspective TLS specifics • Knows nothing including protocol: HTTP/SMTP/POP3/TDS/…+TLS TLS HTTP
  • 5. © Digital Security 5 MITM Attacks on HTTPS: Another Perspective TLS specifics • Application layer • Knows nothing about underlying protocol • Doesn’t protect against destination changing (IP, port) IP TCP TLS HTTP
  • 6. © Digital Security 6 MITM Attacks on HTTPS: Another Perspective TLS specifics • Authentication using x509 certificates • Client compares server name and SAN field of certificate
  • 7. © Digital Security 7 MITM Attacks on HTTPS: Another Perspective Certificates features and limitations • Doesn’t care about port (many services – 1 certificate) • For a wide range of domain names: • Many names in SAN - Subject Alternative Name (+ CN*) • Wildcard certificate • No SNI • TLS cache ** • HTTP/2 connection sharing** *Since 58, Chrome doesn’t check CN, only SAN (because of RFC) ** http://antoine.delignat-lavaud.fr/doc/www15.pdf
  • 8. © Digital Security 8 MITM Attacks on HTTPS: Another Perspective Wildcard names
  • 9. © Digital Security 9 MITM Attacks on HTTPS: Another Perspective A lot of names in SAN
  • 10. © Digital Security 10 MITM Attacks on HTTPS: Another Perspective TLS Redirection • Group of MitM attacks – misuse of authentication limits and features • Any protocol • Virtual host confusion (http://antoine.delignat-lavaud.fr/doc/www15.pdf)
  • 11. © Digital Security 11 MITM Attacks on HTTPS: Another Perspective Simplest example • Attacker (A) controls files on HostB • A. uploads own new_version.exe on HostB • Autoupdate on Victim (V) requests a new version of software: https://www.correct.com/new_version.exe • A. MitMs and redirect to HostB • Autoupdate downloads and runs A’s exe file
  • 12. © Digital Security 12 MITM Attacks on HTTPS: Another Perspective Requirements • HostA and HostB have different IP (or ports) • HostB has an x509 certificate with the domain name of HostA in SAN
  • 13. © Digital Security 13 MITM Attacks on HTTPS: Another Perspective Requirements • Depends on a situation: • When a request for HostA comes to HostB, there is no such a value in virtual hosts of HostB webserver, HostB serves default domain.
  • 14. © Digital Security 14 MITM Attacks on HTTPS: Another Perspective Requirements • A. controls something in user’s requests or server’s responses
  • 15. © Digital Security 15 MITM Attacks on HTTPS: Another Perspective Level of control What can A. control with the help of a server’s response (with focus on HTTPS): • Nothing • Parts of response (some values in body) • Full body of a specific URL. • Full body of any URL. • Full control (header, body) w/o access to TLS key.
  • 16. © Digital Security 16 MITM Attacks on HTTPS: Another Perspective Common example – XSS XSS on HostB (Part of body) 1. V. request to HostA + xss of HostB https://www.correct.com/xss_of_hostb_here 2. A. MitMs and changes an IP 3. HostB responses with A’s JS - V. executes JS (context of HostA) - A. stops the MitM attack 4. JS can interact with HostA in a usual way Browser knows nothing about MitM!
  • 17. © Digital Security 17 MITM Attacks on HTTPS: Another Perspective Video. XSS
  • 18. © Digital Security 18 MITM Attacks on HTTPS: Another Perspective Tricks A. can make injections into any http traffic: • no need to force user to open a link w/ HostB XSS
  • 19. © Digital Security 19 MITM Attacks on HTTPS: Another Perspective Tricks A. can make injections into any http traffic: • A. can add HostB’s cookies for HostA and exploit XSS of HostB w/ auth (cookie forcing) We can exploit Self-XSS! %P
  • 20. © Digital Security 20 MITM Attacks on HTTPS: Another Perspective Flash • Crossdomain.xml allows cross domain interaction HostB: • API server • No cookie • Has crossdomain.xml file with * (or similar) <cross-domain-policy><allow-access-from domain="*" secure=“true"/></cross-domain-policy> No way to perform an attack?
  • 21. © Digital Security 21 MITM Attacks on HTTPS: Another Perspective Flash Crossdomain.xml w/ * on HostB (nothing) 1. V . opens A’s swf - Swf sends request to HostA 2. Flash checks crossdomain.xml 3. A. MitMs and changes an IP 4. HostB responses w/ crossdomain.xml - Swf is allowed to interact w/ HostA - A. stops the MitM attack 5. SWF can interact with HostA in a usual way
  • 22. © Digital Security 22 MITM Attacks on HTTPS: Another Perspective Cross protocol - IE Text-based service that reflects requests on HostB • SMTP, POP3, IMAP, etc • Browser - Internet Explorer • Old school attack • HTTP/0.9 • Content-Sniffing (.html) • Port restriction – doesn’t work, It’s MitM
  • 23. © Digital Security 23 MITM Attacks on HTTPS: Another Perspective Cross protocol - IE Text-based service that reflects requests on HostB • SMTP, POP3, IMAP, etc • Browser - Internet Explorer • Old school attack • HTTP/0.9 • Content-Sniffing (.html) • Port restriction – doesn’t work, It’s MitM
  • 24. © Digital Security 24 MITM Attacks on HTTPS: Another Perspective Cross protocol - IE 1. V. sends the POST request w/ JS payload to “any_url.html on” to HostA 2. A. MitMs and changes an IP 3. HostB reflects the request - IE interprets it as HTTP/0.9 - “.html” forces IE to parse as html - V. executes JS (in the context of HostA) - A. stops the MitM attack 4. JS can interact with HostA in a usual way
  • 25. © Digital Security 25 MITM Attacks on HTTPS: Another Perspective Video. Cross protocol - IE
  • 26. © Digital Security 26 MITM Attacks on HTTPS: Another Perspective Cross protocol – Other browsers (FF, Chrome) A. wants to steal Basic Auth header or HttpOnly cookie A. has XSS on HostA (can execute JS in it’s context) (Nothing) 1. JS sends a request to HostA 2. A. MitMs and changes IP 3. HostB reflects the request -Browser interprets it as HTTP/0.9, text/plain - JS is allowed to read response (same origin)
  • 27. © Digital Security 27 MITM Attacks on HTTPS: Another Perspective JavaScript +DOM Web app w/ JQuery uses load() to get content Text-based service that reflects requests on HostB (Nothing) or file uploading is possible 0. A. sets a cookie w/ xss on HostA (cookie forcing) Set-Cookie: test=<script src=“…”> 1. V. opens HostA. Jquery is loaded. - For other requests load() is used 2. load sends a request to HostA 3. A. MitMs and changes an IP 4. HostB reflects the request -Browser interprets it as HTTP/0.9, text/plain - Jquery.load parses it and execute our XSS payload 5. Our JS can interact with HostA in a usual way
  • 28. © Digital Security 28 MITM Attacks on HTTPS: Another Perspective REST API V. is a web app that checks auth (for 200 OK) using HostA REST API Text-based service that reflects requests on HostB (Nothing) or it returns 200 OK for any requests 1. A. tries to auth on V 2. V. sends request to HostA to check auth 3. A. MitMs and changes an IP 4. HostB reflects all the request - Curl interprets it as HTTP/0.9 * - Curl returns CURLE_OK 5. A. is authenticated * https://github.com/curl/curl/issues/467
  • 29. © Digital Security 29 MITM Attacks on HTTPS: Another Perspective Upload anything A. can upload files on HostB Too simple: • Html w/ xss , SWF, PDF … (SDRF attack) • Everything is executed in the context of HostA The same attack as in the example with XSS
  • 30. © Digital Security 30 MITM Attacks on HTTPS: Another Perspective Active content substitution A. can upload files on HostB, but w/ “uninteresting” Content-Type (text/plain, image/png) or Content-Disposition (any path) Think out of the box: • Page consists of html, external files – JavaScript and CSS • Force downloading JS from another host • https://hosta/script.js
  • 31. © Digital Security 31 MITM Attacks on HTTPS: Another Perspective Active content substitution • Page consists of html, external files – JavaScript and CSS • Force downloading JS from another host • One TLS for all content?
  • 32. © Digital Security 32 MITM Attacks on HTTPS: Another Perspective Browsers behavior <script src=“script.js”> and headers: - no browser cares about Content-Disposition header - IE doesn't care about Content-Type header (without nosniff) - FF, Chrome, Edge dont't execute script only if Content-Type is from "image" family (without nosniff) - with X-Content-Type-Options, all the browsers require correct Content-Type
  • 33. © Digital Security 33 MITM Attacks on HTTPS: Another Perspective Active content substitution Possible Attacks: • External files is on another web site (https://static.correct.com/script.js) – easy for MitM (static.correct.com -> HostB) • Protocol attacks
  • 34. © Digital Security 34 MITM Attacks on HTTPS: Another Perspective Active content substitution Possible Attacks: • WPAD • Automatic proxy detection. Windows, by default • Pac file w/ rules • For Chrome, Firefox: different proxies for different URLs • Chrome – patched, FF – will be patched; Windows – partly patched; after BH 2016  • Now: Useful only for different sites (and tricks)
  • 35. © Digital Security 35 MITM Attacks on HTTPS: Another Perspective Active content substitution Possible Attacks: • Browser’s cache misuse • By default, web servers add cache headers to “static” content (javascript, css, etc) • Browser cache is URL-based
  • 36. © Digital Security 36 MITM Attacks on HTTPS: Another Perspective Active content substitution A. can upload files on HostB, but w/ “uninteresting” Content-Type or Content-Disposition (any path) 1. V. request to HostA + script.js of HostB 2. A. MitMs and changes IP 3. HostB responses with A’s JS - V. caches JS for url: https://hosta/script.js - A. stops mitm attack 4. A. forces V. to open HostA - V. parses html from HostA - But takes script.js from its cache, cause it’s there and still fresh - V. executes JS (in the context of HostA) - JS can interact with HostA in a usual way
  • 37. © Digital Security 37 MITM Attacks on HTTPS: Another Perspective Active content substitution
  • 38. © Digital Security 38 MITM Attacks on HTTPS: Another Perspective Active content substitution - Trick A. can upload files on HostB, but w/ “uninteresting” Content-Type or Content-Disposition (specific path) How can we manipulate with a path? Depends on technologies • RPO • Default error page w/ relative scripts https://hosta/anything_here/lalala/ -> anything_here/lalala/script.js • IE HostHeader injection • …
  • 39. © Digital Security 39 MITM Attacks on HTTPS: Another Perspective What else? • HTTPS 2 HTTP redirect • Reverse Proxy misrouting (CDNs) • Certificate Pinning • Client Cert auth "bypass“ • CSP bypass • Crypto attacks • Another Protocols • …
  • 40. © Digital Security 40 MITM Attacks on HTTPS: Another Perspective Conclusion TLS Redirection • Based on TLS features • Based on your imagination and circumstances • For any protocol (but works best for HTTPS) • Not so hard to exploit • You can get something from nothing (or misuse safe stuff)
  • 41. © Digital Security 41 MITM Attacks on HTTPS: Another Perspective Conclusion TLS Redirection • “New” approach of attacking TLS secured protocols • The security level of web service equals to the security level of the weakest service with common certificate • Based on the certificate of the weakest service
  • 42. © Digital Security 42 MITM Attacks on HTTPS: Another Perspective Conclusion • Awareness • Need more research • There will be a lot of stuff and tricks - https://github.com/GrrrDog/TLS-Redirection Read about Virtual Host Confusion - https://bh.ht.vc/ - AWESOME STUFF THERE!
  • 43. © Digital Security 43 MITM Attacks on HTTPS: Another Perspective Questions www.twitter.com/antyurin a.tyurin@dsec.ru