Last active
June 9, 2025 08:12
-
-
Save IonBazan/2a65b4886e105bc0d1d2586def53f6eb to your computer and use it in GitHub Desktop.
Enumerate subdomains using Certificate Transparency logs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Enumerate subdomains using HTTPS Certificate Transparency logs. | |
# In most cases it's faster and more reliable than brute-force attack, especially when targeting HTTP(S) services. | |
# Read more at https://certificate.transparency.dev/ | |
# | |
# Usage: ./subdomains.sh x.com | |
# | |
# Prerequisites: curl, jq | |
if [ -z "$1" ]; then | |
echo "Usage: $0 <domain>" | |
exit 1 | |
fi | |
DOMAIN=$1 | |
curl -s "https://crt.sh/?q=%25.$DOMAIN&output=json" | | |
jq -r '.[].name_value' | | |
tr '\n' ',' | | |
tr ',' '\n' | # Flatten multiline name_values | |
sed 's/^\*\.\?//' | # Remove leading "*." if present | |
sort -u # Sort and deduplicate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment