1. DNS/hijacking/detectify
/Guide https://labs.detectify.com/2014/10/21/hostile-subdomain-takeover-using-herokugithubdesk-more/
Hostile Subdomain Takeover using Heroku/Github/Desk + more October 21, 2014
1.1. slide
DNS hijacking using cloud providers – No verification needed
- DNS hijacking using cloud providers - no verification needed
Frans Rosen 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"
Rundown o Background o History o Tools & Techniques o Deeper levels of hijacking o Evolution o Mitigations o Monitoring
- Subdomain Takeover v1.0 campaign.site.com Campaign!
- Subdomain Takeover v1.0 campaign.site.com Campaign! Fake site!
- Ever seen one of these?
First instance, 12th Oct '14 http://esevece.tumblr.com/post/99786512849/onavo-cname-records-pointing-to-heroku-but-no
https://labs.detectify.com/2014/10/21/hostile-subdomain-takeover-using-herokugithubdesk-more/ 9 days later, 21st Oct '14
- Response from services Heroku:
臓�e're aware of this issue臓�GitHub:
- 臓�y apologies for the delayed response. We are aware of this issue臓�Shopify: 臓� had already identified that this is a security issue臓� 10. What have we seen?
What have we seen? https://hackerone.com/reports/172137
- What have we seen?
What have we seen? https://hackerone.com/reports/32825
- What have we seen?
What have we seen? https://crt.sh/?q=%25.uber.com
What have we seen? https://blog.rubidus.com/2017/02/03/deep-thoughts-on-subdomain-takeovers/
What have we seen? https://labs.detectify.com/2016/10/05/the-story-of-ev-ssl-aws-and-trailing-dot-domains/
- What have we seen?
- What have we seen?
- What have we seen?
- Tools
subbrute Not active dev. https://github.com/TheRook/subbrute
Sublist3r https://github.com/aboul3la/Sublist3r Active dev! Took over subbrute! Fetching from multiple sources
massdns https://github.com/blechschmidt/massdns Fast as hell! Needs lists to resolve
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
tko-subs https://github.com/anshumanbh/tko-subs Interesting idea, auto takeover when finding issues Might be a liiittle bit too aggressive
- We could look here?
- WRONG! WRONG! WRONG! WRONG! WRONG! WRONG! WRONG!WRONG!
- WRONG! Resolve and not resolve is what matters.
- Dead DNS records
- A dead record?
- A dead record?
- dig is your friend
- 9 year old bug
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
- Also works on subdomain delegations!
- NOERROR Resolves. All OK. DNS status codes
- DNS status codes NXDOMAIN Doesn臓� exist. Could still have a DNS RR. Query NS to find out more.
- DNS status codes REFUSED NS does not like this domain.
- DNS status codes SERVFAIL Not even responding. Very interesting!
- The tools find what? SERVFAIL REFUSED NOERROR NXDOMAIN ????
- Subdomain delegation
- Subdomain delegation
- Subdomain delegation
- Brute add/delete R53 DNS
- We now control the domain!
Orphaned EC2 IPs https://www.bishopfox.com/blog/2015/10/fishing-the-aws-ip-pool-for-dangling-domains/
- Orphaned EC2 IPs
dev.on.site.com http://integrouschoice.com/
- dev.on.site.com
- dev.on.site.com
- Flow Brute * Collect NOERROR * Collect SERVFAIL / REFUSED +trace the NS * Collect NXDOMAIN if CNAME, +trace
- 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
Flow Improve * Collect all subdomain names * Sort them by popularity * Sort www below all names with p>2
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
- Flow Repeat * Do it every day * Push notification changes
- Jan 2017
- Jan 2017
- Jan 2017
- Jan 2017
- Jan 2017
- Jan 2017
- Jan 2017
- Monitoring is really preventing this. Psst, this is exactly what we do! Shameless plug
The competition @avlidienbrunn @arneswinnen @TheBoredEng
- My takeovers since 2014-10
- detectify
- Email snooping!
September 2016 http://blog.pentestnepal.tech/post/149985438982/reading-ubers-internal-emails-uber-bug-bounty
- 2 of the 3 in action
- MX-records Inbound mail. This is important.
- MX-records
- Conflict check + Validation
- Oh, add this!
CNAME -> MX
- Whitelisted aliases for verification
- Back to this
- Tadaa!
- We now get postmaster!
- Response the day after
- Response the day after
- Response the day after
On a final note https://twitter.com/realdonaldtrump/status/190093504939163648
On a final note https://twitter.com/realdonaldtrump/status/190093504939163648
- On a final note
- On a final note
- On a final note
- Recap o Know your DNS Zone file
- MX, CNAME, A, AAAA, ALIAS. Everything. o AUTOMATION, probably the only proper solution o will.i.am loves this
- Go hack yourself! Questions? Frans Rosen (@fransrosen) - www.detectify.com
- Recommended