Last active
July 11, 2024 21:33
-
-
Save maxrodrigo/dec5c1d676e2cfbfcf1935414ed4c7a8 to your computer and use it in GitHub Desktop.
`crt.sh` PostgreSQL interface subdomain query
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
#!/usr/bin/env bash | |
# Usage: ./crtsh-subdomains.sh domain.com | |
query="SELECT ci.NAME_VALUE NAME_VALUE FROM certificate_identity ci WHERE ci.NAME_TYPE = 'dNSName' AND reverse(lower(ci.NAME_VALUE)) LIKE reverse(lower('%.$1'));" | |
(echo $1; echo $query | \ | |
psql -t -h crt.sh -p 5432 -U guest certwatch | \ | |
sed -e 's:^ *::g' -e 's:^*\.::g' -e '/^$/d' | \ | |
sed -e 's:*.::g';) | sort -u |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
More in: https://0xffsec.com/handbook/information-gathering/subdomain-enumeration/#crtsh-postgresql-interface