Skip to content

Instantly share code, notes, and snippets.

@mzpqnxow
Created June 19, 2020 00:50
Show Gist options
  • Select an option

  • Save mzpqnxow/15b9b4b6bb8ff18a01eb8b189cad6d13 to your computer and use it in GitHub Desktop.

Select an option

Save mzpqnxow/15b9b4b6bb8ff18a01eb8b189cad6d13 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