Created
November 3, 2017 20:18
-
-
Save stollcri/8a370203877e122709ba23bfdf393ea2 to your computer and use it in GitHub Desktop.
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 | |
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