Created
March 4, 2024 18:03
-
-
Save ldionmarcil/5e842a550a4c3c5474061dbc3b2087e3 to your computer and use it in GitHub Desktop.
find url common name and alternative name
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
| function cert { | |
| # accepts urls/hostnames as stdin | |
| # returns Common Name + Subject Alternative Name from responding http server | |
| if [ $# -eq 0 ]; then | |
| # human readable | |
| httpx -silent -json -tls-grab | jq -r '"\u001b[34m\(.url)\u001b[0m \(.tls | [.subject_cn] + .subject_an | unique | join(" "))"' | |
| else | |
| # batching | |
| httpx -silent -json -tls-grab | jq -r '(.tls | [.subject_cn] + .subject_an | unique | join("\n"))' | |
| fi | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment