Skip to content

Instantly share code, notes, and snippets.

@voker2311
Created September 4, 2021 07:50
Show Gist options
  • Save voker2311/62aff7a6a052a4f588c5750249358159 to your computer and use it in GitHub Desktop.
Save voker2311/62aff7a6a052a4f588c5750249358159 to your computer and use it in GitHub Desktop.
One liner to scrape subdomains from SSL certificates
curl -s -X POST https://search.censys.io/api/v1/search/certificates -u $API_KEY:$SECRET -d "{\"query\":\"$TARGET\"}" | jq .results[] | grep subject_dn | grep -oE "CN=.*" | awk -F\" '
{print $1}' | awk -F\= '{print $2}' | grep -v "*" | sort -u | grep -i "$TARGET" > subs.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment