SlideShare a Scribd company logo
detectify
DNS hijacking using cloud providers
– no verification needed
detectify
Frans Rosén
Security Advisor @detectify ( twitter: @fransrosen )
HackerOne #5 @ hackerone.com/leaderboard/all-time
Blog at labs.detectify.com
Talked here last year!
"The Secret life of a Bug Bounty Hunter"
detectify
Rundown
• Background
• History
• Tools & Techniques
• Deeper levels of hijacking
• Evolution
• Mitigations
• Monitoring
detectify
Subdomain Takeover v1.0
campaign.site.com
Campaign!
detectify
Subdomain Takeover v1.0
campaign.site.com
Campaign! Fake site!
detectify
Ever seen one of these?
detectify
First instance, 12th Oct '14
http://esevece.tumblr.com/post/99786512849/onavo-cname-records-pointing-to-heroku-but-no
detectify https://labs.detectify.com/2014/10/21/hostile-subdomain-takeover-using-herokugithubdesk-more/
9 days later, 21st Oct '14
detectify
Response from services
Heroku: 

“We're aware of this issue”
GitHub: 

“My apologies for the delayed response.
We are aware of this issue”
Shopify: 

“I had already identified that this is
a security issue”
detectify
What have we seen?
detectify
What have we seen?
https://hackerone.com/reports/172137
detectify
What have we seen?
detectify
What have we seen?
https://hackerone.com/reports/32825
detectify
What have we seen?
detectify
What have we seen?
https://crt.sh/?q=%25.uber.com
detectify
What have we seen?
https://blog.rubidus.com/2017/02/03/deep-thoughts-on-subdomain-takeovers/
detectify
What have we seen?
https://labs.detectify.com/2016/10/05/the-story-of-ev-ssl-aws-and-trailing-dot-domains/
detectify
What have we seen?
detectify
What have we seen?
detectify
What have we seen?
detectify
Tools
detectify
subbrute
Not active dev.
https://github.com/TheRook/subbrute
detectify
Sublist3r
https://github.com/aboul3la/Sublist3r
Active dev! Took over subbrute!
Fetching from multiple sources
detectify
massdns
https://github.com/blechschmidt/massdns
Fast as hell!
Needs lists to resolve
detectify
altdns
https://github.com/infosec-au/altdns
Soo soo powerful if you have good mutations
Combine with massdns == success
Can resolve, but better for just creating the lists
detectify
tko-subs
https://github.com/anshumanbh/tko-subs
Interesting idea, auto takeover when finding issues
Might be a liiittle bit too aggressive
detectify
We could look here?
detectify
WRONG!
WRONG!
WRONG!
WRONG!
WRONG!
WRONG!
WRONG!WRONG!
detectify
WRONG!
Resolve and not resolve is what matters.
detectify
Dead DNS records
detectify
A dead record?
detectify
A dead record?
detectify
dig is your friend
detectify
9 year old bug
detectify https://thehackerblog.com/the-orphaned-internet-taking-over-120k-domains-via-
a-dns-vulnerability-in-aws-google-cloud-rackspace-and-digital-ocean/index.html
SERVFAIL/REFUSED
detectify
Also works on subdomain delegations!
detectify
NOERROR
Resolves. All OK.
DNS status codes
detectify
DNS status codes
NXDOMAIN
Doesn’t exist. Could still have a DNS RR.
Query NS to find out more.
detectify
DNS status codes
REFUSED
NS does not like this domain.
detectify
DNS status codes
SERVFAIL
Not even responding. Very interesting!
detectify
The tools find what?
SERVFAIL
REFUSED
NOERROR
NXDOMAIN
????
detectify
Subdomain delegation
detectify
Subdomain delegation
detectify
Subdomain delegation
detectify
Brute add/delete R53 DNS
detectify
We now control the domain!
detectify
Orphaned EC2 IPs
https://www.bishopfox.com/blog/2015/10/fishing-the-aws-ip-pool-for-dangling-domains/
detectify
Orphaned EC2 IPs
detectify
dev.on.site.com
http://integrouschoice.com/
detectify
dev.on.site.com
detectify
dev.on.site.com
detectify
Flow
Brute
* Collect NOERROR
* Collect SERVFAIL / REFUSED +trace the NS
* Collect NXDOMAIN if CNAME, +trace
detectify
Flow
Resolve
* Check NOERROR for patterns
* SERVFAIL/REFUSED, Check NS for patterns
* NXDOMAIN, traverse up to apex, check:
NXDOMAIN|SERVFAIL|REFUSED|no servers could be reached
detectify
Flow
Improve
* Collect all subdomain names
* Sort them by popularity
* Sort www below all names with p>2
detectify
Flow
Analyze unknowns
* Collect titles of all sites (or EyeWitness!)
* Filter out common titles + name of company
* Generate screenshots, create a image map
https://github.com/ChrisTruncer/EyeWitness
detectify
Flow
Repeat
* Do it every day
* Push notification changes
detectify
Jan 2017
detectify
Jan 2017
detectify
Jan 2017
detectify
Jan 2017
detectify
Jan 2017
detectify
Jan 2017
detectify
Jan 2017
detectify
Monitoring is really preventing this.
Psst, this is exactly what we do!
Shameless plug
detectify
The competition
@avlidienbrunn @arneswinnen @TheBoredEng
detectify
My takeovers since 2014-10
detectify
detectify
Email snooping!
detectify
September 2016
http://blog.pentestnepal.tech/post/149985438982/reading-ubers-internal-emails-uber-bug-bounty
detectify
2 of the 3 in action
detectify
MX-records
Inbound mail. This is important.
detectify
MX-records
detectify
Conflict check + Validation
detectify
Oh, add this!
detectify
CNAME -> MX
detectify
Whitelisted aliases for verification
detectify
Back to this
detectify
Tadaa!
detectify
We now get postmaster!
detectify
Response the day after
detectify
Response the day after
detectify
Response the day after
detectify
On a final note
https://twitter.com/realdonaldtrump/status/190093504939163648
detectify
On a final note
https://twitter.com/realdonaldtrump/status/190093504939163648
detectify
On a final note
detectify
On a final note
detectify
On a final note
detectify
Recap
• Know your DNS Zone file

MX, CNAME, A, AAAA, ALIAS. Everything.

• AUTOMATION, probably the only proper solution
• will.i.am loves this
detectify
Go hack yourself!
Questions?
Frans Rosén (@fransrosen) – www.detectify.com

More Related Content

PDF
OWASP AppSecEU 2018 – Attacking "Modern" Web Technologies
PDF
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
PDF
A story of the passive aggressive sysadmin of AEM
PDF
Frans Rosén Keynote at BSides Ahmedabad
PDF
XSS Magic tricks
PDF
Securing AEM webapps by hacking them
PDF
HTTP Request Smuggling via higher HTTP versions
PDF
Hunting for security bugs in AEM webapps
OWASP AppSecEU 2018 – Attacking "Modern" Web Technologies
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
A story of the passive aggressive sysadmin of AEM
Frans Rosén Keynote at BSides Ahmedabad
XSS Magic tricks
Securing AEM webapps by hacking them
HTTP Request Smuggling via higher HTTP versions
Hunting for security bugs in AEM webapps

What's hot (20)

PDF
How to steal and modify data using Business Logic flaws - Insecure Direct Obj...
PPTX
Reverse proxies & Inconsistency
PPTX
Dangling DNS records takeover at scale
PPTX
Attacking thru HTTP Host header
PDF
Broken access controls
PDF
Live Hacking like a MVH – A walkthrough on methodology and strategies to win big
PDF
Offzone | Another waf bypass
PPTX
Xss attack
PDF
XXE Exposed: SQLi, XSS, XXE and XEE against Web Services
PPT
Top 10 Web Security Vulnerabilities (OWASP Top 10)
PPTX
ASP.NET Web API
PDF
ColdFusion for Penetration Testers
PDF
A Hacker's perspective on AEM applications security
PDF
Local File Inclusion to Remote Code Execution
PDF
Ekoparty 2017 - The Bug Hunter's Methodology
PPTX
Command injection
PDF
Bug Bounty Hunter Methodology - Nullcon 2016
PPTX
Waf bypassing Techniques
PPTX
Presentation on "An Introduction to ReactJS"
PPTX
Deep understanding on Cross-Site Scripting and SQL Injection
How to steal and modify data using Business Logic flaws - Insecure Direct Obj...
Reverse proxies & Inconsistency
Dangling DNS records takeover at scale
Attacking thru HTTP Host header
Broken access controls
Live Hacking like a MVH – A walkthrough on methodology and strategies to win big
Offzone | Another waf bypass
Xss attack
XXE Exposed: SQLi, XSS, XXE and XEE against Web Services
Top 10 Web Security Vulnerabilities (OWASP Top 10)
ASP.NET Web API
ColdFusion for Penetration Testers
A Hacker's perspective on AEM applications security
Local File Inclusion to Remote Code Execution
Ekoparty 2017 - The Bug Hunter's Methodology
Command injection
Bug Bounty Hunter Methodology - Nullcon 2016
Waf bypassing Techniques
Presentation on "An Introduction to ReactJS"
Deep understanding on Cross-Site Scripting and SQL Injection
Ad

Similar to DNS hijacking using cloud providers – No verification needed (20)

PDF
DNS in IR: Collection, Analysis and Response
DOCX
project_docs
PDF
OSINT Basics for Threat Hunters and Practitioners
PDF
Honeypots and Security
PDF
An EyeWitness View into your Network
PPTX
Infrastructure Tracking with Passive Monitoring and Active Probing: ShmooCon ...
PDF
End-to-End Security Analytics with the Elastic Stack
PPTX
Tcpdump hunter
PPTX
Distributed Sensor Data Contextualization for Threat Intelligence Analysis
ODP
BSides Rochester 2018: Chris Partridge: Turning Domain Data Into Domain Intel...
PDF
Partner Welcome Kit
PDF
2023 NCIT: Introduction to Intrusion Detection
PDF
SFMap (TMA 2015)
PPTX
Reconnaissance - For pentesting and user awareness
PDF
New DNS Traffic Analysis Techniques to Identify Global Internet Threats
PDF
AVTOKYO2018 - Revealing hidden data behind cloud front
PDF
OSINT for Attack and Defense
PPTX
Threat hunting for Beginners
PPTX
Hunting for APT in network logs workshop presentation
PPTX
06- 1 Active Information Gathering part 1.pptx
DNS in IR: Collection, Analysis and Response
project_docs
OSINT Basics for Threat Hunters and Practitioners
Honeypots and Security
An EyeWitness View into your Network
Infrastructure Tracking with Passive Monitoring and Active Probing: ShmooCon ...
End-to-End Security Analytics with the Elastic Stack
Tcpdump hunter
Distributed Sensor Data Contextualization for Threat Intelligence Analysis
BSides Rochester 2018: Chris Partridge: Turning Domain Data Into Domain Intel...
Partner Welcome Kit
2023 NCIT: Introduction to Intrusion Detection
SFMap (TMA 2015)
Reconnaissance - For pentesting and user awareness
New DNS Traffic Analysis Techniques to Identify Global Internet Threats
AVTOKYO2018 - Revealing hidden data behind cloud front
OSINT for Attack and Defense
Threat hunting for Beginners
Hunting for APT in network logs workshop presentation
06- 1 Active Information Gathering part 1.pptx
Ad

Recently uploaded (20)

PDF
Empathic Computing: Creating Shared Understanding
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
KodekX | Application Modernization Development
PPTX
A Presentation on Artificial Intelligence
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Big Data Technologies - Introduction.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Machine learning based COVID-19 study performance prediction
Empathic Computing: Creating Shared Understanding
Chapter 3 Spatial Domain Image Processing.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
KodekX | Application Modernization Development
A Presentation on Artificial Intelligence
20250228 LYD VKU AI Blended-Learning.pptx
Electronic commerce courselecture one. Pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Big Data Technologies - Introduction.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Mobile App Security Testing_ A Comprehensive Guide.pdf
Understanding_Digital_Forensics_Presentation.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
NewMind AI Monthly Chronicles - July 2025
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Machine learning based COVID-19 study performance prediction

DNS hijacking using cloud providers – No verification needed