Skip to content

Instantly share code, notes, and snippets.

@stollcri
Created November 3, 2017 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stollcri/8a370203877e122709ba23bfdf393ea2 to your computer and use it in GitHub Desktop.
Save stollcri/8a370203877e122709ba23bfdf393ea2 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ -z "$1" ]; then
echo "Syntax: $0 [domain_file]"
echo " domain file contians each domain on a single line"
exit
fi
while read line; do
has_ssl=`nmap -p 443 $line | grep 443/tcp | awk '{print $2}'`
if [ "$has_ssl" == "open" ]; then
ssl_cert=`nmap -p 443 --script ssl-cert $line | grep "\|"`
echo "$line"
echo "$ssl_cert"
echo
fi
done <$1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment