Closed
Description
Service name
GitHub Pages
Proof
GitHub uses virtual hosting identical to other cloud services. The site needs to be specified explicitly in domain settings. Step-by-step process:
- Go to new repository page
- Set Repository name to canonical domain name (i.e., {something}.github.io from CNAME record)
- Click Create repository
- Push content using git to a newly created repo. GitHub itself provides the steps to achieve it
- Switch to Settings tab
- In GitHub Pages section choose master branch as source
- Click Save
- After saving, set Custom domain to source domain name (i.e., the domain name which you want to take over)
- Click Save
For screenshots, please refer to https://0xpatrik.com/takeover-proofs/.
To verify:
http -b GET http://{DOMAIN NAME} | grep -F -q "<strong>There isn't a GitHub Pages site here.</strong>" && echo "Subdomain takeover may be possible" || echo "Subdomain takeover is not possible"
(Note: DOMAIN NAME has to be the affected domain, not the github.io
page itself. This is due to Host header forwarding which affects the HTTP response)
Documentation
There is only one format of GitHub Pages domains:
- *.github.io
please note that having CNAME to github.io
itself can also lead to subdomain takeover.