
Ce script est utilisé pour identifier les services MongoDB exposés sur le réseau et qui autorisent des handshakes de protocole non authentifiés.
mongo_exposure_scanner.py
Vérifier Python :
python3 --version
| Fichier | Rôle |
|---|---|
mongo_scanner.py | Script d'analyse |
targets.txt | Hôtes et ports cibles |
mongo_exposed_targets.txt | Résultats d'analyse (auto-créé) |
targets.txt)Formats pris en charge :
# Hôte seul (ports par défaut utilisés)
10.99.1.52
# Hôte avec port spécifique
mongo.example.com:3717
# Plusieurs ports
192.168.1.10:27017,28017
# Plage de ports
172.16.0.20:27017-27030
Notes :
# sont ignoréesLancer l'analyse :
python3 mongo_scanner.py
Le script demandera :
Enter target file name (default: targets.txt):
Options :
targets.txtprod_mongo.txtpython3 mongo_scanner.py
Enter target file name (default: targets.txt): prod_mongo.txt
[*] Using target file: prod_mongo.txt
[*] Total host:port pairs: 4
[*] Concurrency: 50 | Timeout: 5s
------------------------------------------------------------
[+] MongoDB OPEN: 10.99.1.52:3717
[-] 192.168.1.10:27017 - Not exposed
------------------------------------------------------------
[*] Done. Results saved to mongo_exposed_targets.txt
mongo_exposed_targets.txt
[2026-01-20 12:34:07] 10.99.1.52:3717 - Unauthenticated MongoDB exposed
[2026-01-20 12:34:07] dds-d9j6c3a7096ded641.mongodb.ap-southeast-5.rds.aliyuncs.com:3717 - Unauthenticated MongoDB exposed
| Statut | Signification |
|---|---|
MongoDB OPENLe service MongoDB a répondu à hello |
Unauthenticated MongoDB exposed | La négociation a été acceptée sans authentification |
Not exposed | Pas de MongoDB ou authentification/connexion bloquée |
Connection refused / timeout | Service injoignable |