Skip to content

Instantly share code, notes, and snippets.

@abdivasiyev
Created November 6, 2024 05:00
Show Gist options
  • Save abdivasiyev/4fa3080ca320aa86c4ab007c17a15ccc to your computer and use it in GitHub Desktop.
Save abdivasiyev/4fa3080ca320aa86c4ab007c17a15ccc to your computer and use it in GitHub Desktop.
Find subdomains using crt.sh
#!/bin/bash
# check curl exists
if ! command -v curl >/dev/null 2>&1
then
sudo apt install -y curl
fi
# check pup exists
if ! command -v pup >/dev/null 2>&1
then
sudo apt install -y pup
fi
url=$1
out=$2
if [ -z "${out}" ];
then
out="subdomains.txt"
fi
echo "Finding subdomains for $url"
curl -s "https://crt.sh?q=$url" | pup 'table table tbody tr td:nth-child(5) text{}' | sort | uniq > $out
echo "Results saved into $out"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment