Last active
July 11, 2022 06:01
-
-
Save hateshape/a1245dccb03110c4f4827e9647472384 to your computer and use it in GitHub Desktop.
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 | |
curl -s -k -o $1.json "https://api.c99.nl/subdomainfinder?key=XXXXX-XXXXX-XXXXX-XXXXX&domain=$1&json" | |
jq '.subdomains|.[].subdomain' $1.json > subdomain | |
jq '.subdomains|.[].ip' $1.json > ips | |
jq '.subdomains|.[].cloudflare' $1.json > cloudflare | |
subdomains_len=$(wc -l subdomain | awk '{print $1}') | |
ips_len=$(wc -l ips | awk '{print $1}') | |
cloudflare_len=$(wc -l cloudflare | awk '{print $1}') | |
if [ $(echo $subdomains_len) -eq $(echo $ips_len) ] && [ $(echo $ips_len) -eq $(echo $cloudflare_len) ]; then | |
paste -d',' subdomain ips cloudflare | sed 's#"##g' > $1-c99-final.txt.tmp | |
else | |
echo "You gone done borked something." | |
fi | |
sort -k1 -n -t, $1-c99-final.txt.tmp > $1-c99-final.txt | |
rm subdomain ips cloudflare $1-c99-final.txt.tmp | |
sed -i -e '1iSubdomain,IP,Cloudflare\' $1-c99-final.txt | |
cat $1-c99-final.txt | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment