Created
June 19, 2020 00:50
-
-
Save mzpqnxow/15b9b4b6bb8ff18a01eb8b189cad6d13 to your computer and use it in GitHub Desktop.
Parse certificate Subject Alternative Name values from masscan ndjson files using `jq`
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
| #!/bin/bash | |
| INFILE="$1" | |
| jq -r 'select(.rec_type == "banner" and .data.service_name == "ssl" and ((.data.banner | contains("ALERT"))|not) ) | .data.banner|split(",")[1:][] | gsub("^\\s+|\\s+%";"")' < "${INFILE}" | sort -u |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment