Created
November 6, 2024 05:00
-
-
Save abdivasiyev/4fa3080ca320aa86c4ab007c17a15ccc to your computer and use it in GitHub Desktop.
Find subdomains using crt.sh
This file contains 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 | |
# 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