Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save atlassion/66d50bfa55b95ab7aabfb234bade1d39 to your computer and use it in GitHub Desktop.

Select an option

Save atlassion/66d50bfa55b95ab7aabfb234bade1d39 to your computer and use it in GitHub Desktop.
Parse certificate Subject Alternative Name values from masscan ndjson files using `jq`
#!/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