SlideShare una empresa de Scribd logo
1 de 15
By Sharath Unni 
@haxorhead
 Involved parties 
 Root problem 
 Example 
 Web cache poisoning 
 XSS 
 Other derived attacks 
 Recommendations
 There are always 3 parties (atleast) involved 
 Web server: hosts the application, with the 
vulnerability. (Tomcat, Apache, IIS etc.) 
 Target: An entity that interacts with the web 
server on behalf of the client. Eg: squid proxy 
 Attacker: initiates the attack
 Failure to reject illegal user input 
 Specifically input containing CR and LF 
characters 
 Carriage Return and Line Feed - %0d%0a 
(rn) 
 The data (user input) is included in an HTTP 
response header without any validation. 
 HTTP connection sharing 
 Caching – less control over the site content, 
improve performance, speed etc.
 Normal request: 
http://www.the.site/new_page.asp?lang=german 
 Normal response: 
HTTP/1.0 302 Redirect 
Location: 
http://www.the.site/new_page.asp?lang=german 
Connection: Keep-Alive 
Content-Length: 0
 Request (attacker): 
http://www.the.site/welcome.asp?lang=Foo%0d%0aConnection:%20Keep- 
Alive%0d%0aContent- 
Length:%200%0d%0a%0d%0aHTTP/1.0%20200%20OK%0d%0aContent- 
Type:%20text/html%0a%0aContent- 
Length:%2020%0d%0a%0d%0a<html>Pwned!</html> 
 Response: 
HTTP/1.0 302 Redirect 
Location: http://www.the.site/new_page.asp?lang=Foo 
Connection: Keep-Alive 
Content-Length: 0 
HTTP/1.0 200 OK 
Content-Type: text/html 
Content-Length: 20 
<html>Pwned!</html>Connection: Keep-Alive 
Content-Length: 0
 Attack overview: 
 Attacker sends 2 requests: 
 1. HTTP response splitter (with %0d%0a) 
 2. An innocent request 
 Proxy will match 1st request -> 1st reponse 
 2nd request (innocent) -> 2nd response in 
cache (Pwned!)
9 
1st attacker request 
(response splitter) 1st attacker request 
302 
302 
200 
(Pwned!) 
(response splitter) 
2nd attacker request 
(innocent /index.html) 
2nd attacker request 
(innocent /index.html) 
200 
(Pwned!) 200 
(Welcome)
 XSS: The second response is controlled by the 
attacker and JavaScript or HTML code can be 
inserted.
 Evade CSP – Content Security Policy – instructs 
the client browser from which location and/or 
which type of resources are allowed to be loaded 
 Certain browsers will interpret the first 
occurrence of HTTP header 
 HTTP Response header 
Content-Security-Policy: 
X-Content-Security-Policy 
Lang=en_US%0d%0aX-Content-Security-Policy: allow *
 For developers: 
◦ Validate user input and remove CRLF characters 
(particularly when setting cookie and redirecting) 
 For proxy vendors: 
◦ Avoid sharing server TCP connections among 
different virtual hosts. 
◦ Maintain request host header correctly from the URL 
and not from the Host header.
Thank you 
@haxorhead

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

HTTP/2 for Developers
HTTP/2 for DevelopersHTTP/2 for Developers
HTTP/2 for Developers
 
Live Hacking like a MVH – A walkthrough on methodology and strategies to win big
Live Hacking like a MVH – A walkthrough on methodology and strategies to win bigLive Hacking like a MVH – A walkthrough on methodology and strategies to win big
Live Hacking like a MVH – A walkthrough on methodology and strategies to win big
 
File inclusion
File inclusionFile inclusion
File inclusion
 
SSL/TLS Introduction with Practical Examples Including Wireshark Captures
SSL/TLS Introduction with Practical Examples Including Wireshark CapturesSSL/TLS Introduction with Practical Examples Including Wireshark Captures
SSL/TLS Introduction with Practical Examples Including Wireshark Captures
 
Understanding Cross-site Request Forgery
Understanding Cross-site Request ForgeryUnderstanding Cross-site Request Forgery
Understanding Cross-site Request Forgery
 
Pentesting Modern Web Apps: A Primer
Pentesting Modern Web Apps: A PrimerPentesting Modern Web Apps: A Primer
Pentesting Modern Web Apps: A Primer
 
Frans Rosén Keynote at BSides Ahmedabad
Frans Rosén Keynote at BSides AhmedabadFrans Rosén Keynote at BSides Ahmedabad
Frans Rosén Keynote at BSides Ahmedabad
 
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...
 
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ BehaviourWAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
 
HTTP/2 Changes Everything
HTTP/2 Changes EverythingHTTP/2 Changes Everything
HTTP/2 Changes Everything
 
Security for oauth 2.0 - @topavankumarj
Security for oauth 2.0 - @topavankumarjSecurity for oauth 2.0 - @topavankumarj
Security for oauth 2.0 - @topavankumarj
 
Secrets of Google VRP by: Krzysztof Kotowicz, Google Security Team
Secrets of Google VRP by: Krzysztof Kotowicz, Google Security TeamSecrets of Google VRP by: Krzysztof Kotowicz, Google Security Team
Secrets of Google VRP by: Krzysztof Kotowicz, Google Security Team
 
Offensive Python for Pentesting
Offensive Python for PentestingOffensive Python for Pentesting
Offensive Python for Pentesting
 
SSRF workshop
SSRF workshop SSRF workshop
SSRF workshop
 
Type of DDoS attacks with hping3 example
Type of DDoS attacks with hping3 exampleType of DDoS attacks with hping3 example
Type of DDoS attacks with hping3 example
 
Advanced phishing for red team assessments
Advanced phishing for red team assessmentsAdvanced phishing for red team assessments
Advanced phishing for red team assessments
 
SSL basics and SSL packet analysis using wireshark
SSL basics and SSL packet analysis using wiresharkSSL basics and SSL packet analysis using wireshark
SSL basics and SSL packet analysis using wireshark
 
LFI to RCE
LFI to RCELFI to RCE
LFI to RCE
 
Bug Bounty Hunter Methodology - Nullcon 2016
Bug Bounty Hunter Methodology - Nullcon 2016Bug Bounty Hunter Methodology - Nullcon 2016
Bug Bounty Hunter Methodology - Nullcon 2016
 
A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...
 

Similar a Http response splitting

logout.php Session Data after Logout Username Email . $_.docx
logout.php Session Data after Logout  Username  Email  . $_.docxlogout.php Session Data after Logout  Username  Email  . $_.docx
logout.php Session Data after Logout Username Email . $_.docx
smile790243
 
Pentesting web applications
Pentesting web applicationsPentesting web applications
Pentesting web applications
Satish b
 
Presentation (PowerPoint File)
Presentation (PowerPoint File)Presentation (PowerPoint File)
Presentation (PowerPoint File)
webhostingguy
 
Presentation (PowerPoint File)
Presentation (PowerPoint File)Presentation (PowerPoint File)
Presentation (PowerPoint File)
webhostingguy
 

Similar a Http response splitting (20)

Cyber Security-Ethical Hacking
Cyber Security-Ethical HackingCyber Security-Ethical Hacking
Cyber Security-Ethical Hacking
 
Browser Security
Browser SecurityBrowser Security
Browser Security
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application Security
 
Owasp Top 10 - Owasp Pune Chapter - January 2008
Owasp Top 10 - Owasp Pune Chapter - January 2008Owasp Top 10 - Owasp Pune Chapter - January 2008
Owasp Top 10 - Owasp Pune Chapter - January 2008
 
Xssandcsrf
XssandcsrfXssandcsrf
Xssandcsrf
 
logout.php Session Data after Logout Username Email . $_.docx
logout.php Session Data after Logout  Username  Email  . $_.docxlogout.php Session Data after Logout  Username  Email  . $_.docx
logout.php Session Data after Logout Username Email . $_.docx
 
Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation
 
Webbasics
WebbasicsWebbasics
Webbasics
 
Top 10 Security Vulnerabilities (2006)
Top 10 Security Vulnerabilities (2006)Top 10 Security Vulnerabilities (2006)
Top 10 Security Vulnerabilities (2006)
 
Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Cross Site Scripting (XSS)
Cross Site Scripting (XSS)
 
Intro to Web Application Security
Intro to Web Application SecurityIntro to Web Application Security
Intro to Web Application Security
 
Module 11 (hacking web servers)
Module 11 (hacking web servers)Module 11 (hacking web servers)
Module 11 (hacking web servers)
 
Cache poisoning
Cache poisoningCache poisoning
Cache poisoning
 
Pentesting web applications
Pentesting web applicationsPentesting web applications
Pentesting web applications
 
Appl layer
Appl layerAppl layer
Appl layer
 
Reflective and Stored XSS- Cross Site Scripting
Reflective and Stored XSS- Cross Site ScriptingReflective and Stored XSS- Cross Site Scripting
Reflective and Stored XSS- Cross Site Scripting
 
04. xss and encoding
04.  xss and encoding04.  xss and encoding
04. xss and encoding
 
Presentation (PowerPoint File)
Presentation (PowerPoint File)Presentation (PowerPoint File)
Presentation (PowerPoint File)
 
Presentation (PowerPoint File)
Presentation (PowerPoint File)Presentation (PowerPoint File)
Presentation (PowerPoint File)
 
Проксирование HTTP-запросов web-акселератором / Александр Крижановский (Tempe...
Проксирование HTTP-запросов web-акселератором / Александр Крижановский (Tempe...Проксирование HTTP-запросов web-акселератором / Александр Крижановский (Tempe...
Проксирование HTTP-запросов web-акселератором / Александр Крижановский (Tempe...
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Http response splitting

  • 1. By Sharath Unni @haxorhead
  • 2.  Involved parties  Root problem  Example  Web cache poisoning  XSS  Other derived attacks  Recommendations
  • 3.  There are always 3 parties (atleast) involved  Web server: hosts the application, with the vulnerability. (Tomcat, Apache, IIS etc.)  Target: An entity that interacts with the web server on behalf of the client. Eg: squid proxy  Attacker: initiates the attack
  • 4.  Failure to reject illegal user input  Specifically input containing CR and LF characters  Carriage Return and Line Feed - %0d%0a (rn)  The data (user input) is included in an HTTP response header without any validation.  HTTP connection sharing  Caching – less control over the site content, improve performance, speed etc.
  • 5.  Normal request: http://www.the.site/new_page.asp?lang=german  Normal response: HTTP/1.0 302 Redirect Location: http://www.the.site/new_page.asp?lang=german Connection: Keep-Alive Content-Length: 0
  • 6.  Request (attacker): http://www.the.site/welcome.asp?lang=Foo%0d%0aConnection:%20Keep- Alive%0d%0aContent- Length:%200%0d%0a%0d%0aHTTP/1.0%20200%20OK%0d%0aContent- Type:%20text/html%0a%0aContent- Length:%2020%0d%0a%0d%0a<html>Pwned!</html>  Response: HTTP/1.0 302 Redirect Location: http://www.the.site/new_page.asp?lang=Foo Connection: Keep-Alive Content-Length: 0 HTTP/1.0 200 OK Content-Type: text/html Content-Length: 20 <html>Pwned!</html>Connection: Keep-Alive Content-Length: 0
  • 7.  Attack overview:  Attacker sends 2 requests:  1. HTTP response splitter (with %0d%0a)  2. An innocent request  Proxy will match 1st request -> 1st reponse  2nd request (innocent) -> 2nd response in cache (Pwned!)
  • 8.
  • 9. 9 1st attacker request (response splitter) 1st attacker request 302 302 200 (Pwned!) (response splitter) 2nd attacker request (innocent /index.html) 2nd attacker request (innocent /index.html) 200 (Pwned!) 200 (Welcome)
  • 10.  XSS: The second response is controlled by the attacker and JavaScript or HTML code can be inserted.
  • 11.  Evade CSP – Content Security Policy – instructs the client browser from which location and/or which type of resources are allowed to be loaded  Certain browsers will interpret the first occurrence of HTTP header  HTTP Response header Content-Security-Policy: X-Content-Security-Policy Lang=en_US%0d%0aX-Content-Security-Policy: allow *
  • 12.
  • 13.
  • 14.  For developers: ◦ Validate user input and remove CRLF characters (particularly when setting cookie and redirecting)  For proxy vendors: ◦ Avoid sharing server TCP connections among different virtual hosts. ◦ Maintain request host header correctly from the URL and not from the Host header.

Notas del editor

  1. Source: OWASPAppsecEU2006
  2. http://www.securityfocus.com/archive/1/411585