hacktricks/pentesting-web/domain-subdomain-takeover.md

60 lines
7.9 KiB
Markdown
Raw Normal View History

2022-06-06 22:28:05 +00:00
# Domain/Subdomain takeover
2022-04-28 16:01:33 +00:00
<details>
2023-12-31 01:25:17 +00:00
<summary><strong>Learn AWS hacking from zero to hero with</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
2022-04-28 16:01:33 +00:00
2023-12-31 01:25:17 +00:00
Other ways to support HackTricks:
* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)!
2022-09-30 10:27:15 +00:00
* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com)
2023-12-31 01:25:17 +00:00
* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family)
2024-02-09 07:14:36 +00:00
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks_live)**.**
2023-12-31 01:25:17 +00:00
* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
2022-04-28 16:01:33 +00:00
</details>
<figure><img src="../.gitbook/assets/image (3) (1) (1) (1) (1).png" alt=""><figcaption></figcaption></figure>
2022-06-06 22:28:05 +00:00
2023-01-01 16:19:07 +00:00
\
Use [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) to easily build and **automate workflows** powered by the world's **most advanced** community tools.\
2023-01-01 16:19:07 +00:00
Get Access Today:
2022-06-06 22:28:05 +00:00
2023-01-01 16:19:07 +00:00
{% embed url="https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks" %}
2022-04-28 16:01:33 +00:00
2022-06-06 22:28:05 +00:00
## Domain takeover
2022-06-06 22:28:05 +00:00
If you discover some domain (domain.tld) that is **being used by some service inside the scope** but the **company** has l**o**st the **ownership** of it, you can try to **register** it (if cheap enough) and let know the company. If this domain is receiving some **sensitive information** like a sessions cookie via **GET** parameter or in the **Referer** header, this is for sure a **vulnerability**.
2022-06-06 22:28:05 +00:00
### Subdomain takeover
A subdomain of the company is pointing to a **third-party service with a name not registered**. If you can **create** an **account** in this **third party service** and **register** the **name** being in use, you can perform the subdomain take over.
There are several tools with dictionaries to check for possible takeovers:
* [https://github.com/EdOverflow/can-i-take-over-xyz](https://github.com/EdOverflow/can-i-take-over-xyz)
* [https://github.com/blacklanternsecurity/bbot](https://github.com/blacklanternsecurity/bbot)
2022-08-12 14:25:49 +00:00
* [https://github.com/punk-security/dnsReaper](https://github.com/punk-security/dnsReaper)
* [https://github.com/haccer/subjack](https://github.com/haccer/subjack)
* [https://github.com/anshumanbh/tko-sub](https://github.com/anshumanbh/tko-subs)
* [https://github.com/ArifulProtik/sub-domain-takeover](https://github.com/ArifulProtik/sub-domain-takeover)
* [https://github.com/SaadAhmedx/Subdomain-Takeover](https://github.com/SaadAhmedx/Subdomain-Takeover)
* [https://github.com/Ice3man543/SubOver](https://github.com/Ice3man543/SubOver)
* [https://github.com/m4ll0k/takeover](https://github.com/m4ll0k/takeover)
* [https://github.com/antichown/subdomain-takeover](https://github.com/antichown/subdomain-takeover)
2023-01-13 10:30:46 +00:00
* [https://github.com/musana/mx-takeover](https://github.com/musana/mx-takeover)
#### Scanning for Hijackable Subdomains with [BBOT](https://github.com/blacklanternsecurity/bbot):
Subdomain takeover checks are included in BBOT's default subdomain enumeration. Signatures are pulled directly from [https://github.com/EdOverflow/can-i-take-over-xyz](https://github.com/EdOverflow/can-i-take-over-xyz).
```bash
bbot -t evilcorp.com -f subdomain-enum
```
2024-02-10 17:52:19 +00:00
### DNS Wildcard jImej
2024-02-10 17:52:19 +00:00
DNS Wildcard jImejDaq jImejDaq vItlhutlhlaHbe'chugh, jImejDaq vItlhutlhlaHbe'chughDaq jImejDaqDaq 'e' vItlhutlhlaHbe'chughDaqDaq **ghItlhvam**. vaj 'oH 'ej vaj 'oH...
2022-04-28 16:01:33 +00:00
2024-02-10 17:52:19 +00:00
mung: 'ej 'oH `*.testing.com` vItlhutlhlaHbe'chughDaq `1.1.1.1` vItlhutlhlaHbe'chughDaqDaq. vaj `not-existent.testing.com` vItlhutlhlaHbe'chughDaq `1.1.1.1` vItlhutlhlaHbe'chughDaqDaq.
2023-12-31 01:25:17 +00:00
2024-02-10 17:52:19 +00:00
'ach, 'oH 'ej vaj 'oH, 'ej vaj 'oH **CNAME** vItlhutlhlaHbe'chughDaqDaq **qarDaq** vItlhutlhlaHbe'chughDaqDaq, **github subdomain** (vaj `sohomdatta1.github.io`) vItlhutlhlaHbe'chughDaqDaq. 'ach, **CNAME Wildcard** vItlhutlhlaHbe'chughDaqDaq, **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq 'e' vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq 'e' vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq **ghItlhvam** vItlhutlhlaHbe'chughDaqDaq