Created
October 25, 2016 14:58
-
-
Save jorgeuriarte/6add2ee4bcd97745e0a8732aaa4cdaf0 to your computer and use it in GitHub Desktop.
Check SSL Ciphers available in a given URL
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
#!/usr/bin/env bash | |
#OpenSSL requires the port number. | |
#ws.seur.com | |
#SERVER=80.65.15.72:443 | |
SERVER=54.187.119.242:443 | |
DELAY=1 | |
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g') | |
echo Obtaining cipher list from $(openssl version). | |
for cipher in ${ciphers[@]} | |
do | |
echo -n "Testing $cipher..." | |
result=$(echo -n | openssl s_client -cipher "$cipher" -connect $SERVER 2>&1) | |
if [[ "$result" =~ ":error:" ]] ; then | |
error=$(echo $result | cut -d':' -f6) | |
echo "NO ($error)" | |
else | |
if [[ "$result" =~ "Cipher is ${cipher}" || "$result" =~ "Cipher :" ]] ; then | |
echo "${cipher}: YES" | |
else | |
echo UNKNOWN RESPONSE | |
echo $result | |
fi | |
fi | |
sleep $DELAY | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment