
⚡ Effectuer l'énumération des sous-domaines à l'aide des logs de transparence des certificats de Censys.
Note importante : Depuis fin 2024, Censys ne fournit plus d'accès API aux comptes gratuits.
Cet outil permet d'énumérer les sous-domaines en utilisant les logs de Certificate Transparency stockés dans Censys Search. Il devrait retourner tout sous-domaine ayant jamais reçu un certificat SSL d'une autorité de certification publique.
Voyez-le en action :
$ python censys-subdomain-finder.py github.com
[*] Searching Censys for subdomains of github.com
[*] Found 42 unique subdomains of github.com in ~1.7 seconds
- hq.github.com
- talks.github.com
- cla.github.com
- github.com
- cloud.github.com
- enterprise.github.com
- help.github.com
- collector-cdn.github.com
- central.github.com
- smtp.github.com
- cas.octodemo.github.com
- schrauger.github.com
- jobs.github.com
- classroom.github.com
- dodgeball.github.com
- visualstudio.github.com
- branch.github.com
- www.github.com
- edu.github.com
- education.github.com
- import.github.com
- styleguide.github.com
- community.github.com
- server.github.com
- mac-installer.github.com
- registry.github.com
- f.cloud.github.com
- offer.github.com
- helpnext.github.com
- foo.github.com
- porter.github.com
- id.github.com
- atom-installer.github.com
- review-lab.github.com
- vpn-ca.iad.github.com
- maintainers.github.com
- raw.github.com
- status.github.com
- camo.github.com
- support.enterprise.github.com
- stg.github.com
- rs.github.com
Créez un compte (gratuit) sur https://search.censys.io/register
Accédez à https://search.censys.io/account, et définissez deux variables d'environnement avec votre ID API et votre secret API :
export CENSYS_API_ID=...
export CENSYS_API_SECRET=...
Alternativement, vous pouvez utiliser un fichier .env pour stocker ces valeurs de manière persistante :
cp .env.template .env
Ensuite, éditez le fichier .env et définissez les valeurs pour CENSYS_API_ID et CENSYS_API_SECRET.
Clonez le dépôt :
git clone https://github.com/christophetd/censys-subdomain-finder.git
Installez les dépendances dans un environnement virtuel :
cd censys-subdomain-finder
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Exemple d'utilisation :
python censys-subdomain-finder.py example.com
Exporter la liste des sous-domaines dans un fichier texte :
python censys-subdomain-finder.py example.com -o subdomains.txt
usage: censys-subdomain-finder.py [-h] [-o OUTPUT_FILE]
[--censys-api-id CENSYS_API_ID]
[--censys-api-secret CENSYS_API_SECRET]
domain
positional arguments:
domain The domain to scan
optional arguments:
-h, --help show this help message and exit
-o OUTPUT_FILE, --output OUTPUT_FILE
A file to output the list of subdomains to (default:
None)
--censys-api-id CENSYS_API_ID
Censys API ID. Can also be defined using the
CENSYS_API_ID environment variable (default: None)
--censys-api-secret CENSYS_API_SECRET
Censys API secret. Can also be defined using the
CENSYS_API_SECRET environment variable (default: None)
Devrait fonctionner sur Python 3.7 et supérieur.
L'API Censys a une limite de 120 requêtes par fenêtre de 5 minutes. Chaque appel de cet outil effectue exactement une requête API à Censys.
N'hésitez pas à ouvrir un ticket ou à tweeter à @christophetd pour des suggestions ou remarques.