Skip to content

Instantly share code, notes, and snippets.

@marvin-marvin
Last active July 26, 2019 10:46
Show Gist options
  • Save marvin-marvin/ceb6f9bb1ee9a5b796ca42de63355d5d to your computer and use it in GitHub Desktop.
Save marvin-marvin/ceb6f9bb1ee9a5b796ca42de63355d5d to your computer and use it in GitHub Desktop.
ssl cipher check
###
# please test against the LB endpoint and a node
#syntax: ./cipher_check.sh <s3-endpoint>:443
#syntax: ./cipher_check.sh <node>:443
###
#!/usr/bin/env bash
# OpenSSL requires the port number.
SERVER=$1
DELAY=1
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')
echo Obtaining cipher list from $(openssl version).
for cipher in ${ciphers[@]}
do
result=$(echo -n | openssl s_client -cipher "$cipher" -tls1_2 -connect $SERVER 2>&1)
if [[ "$result" =~ ":error:" ]] ; then
echo -n
else
if [[ "$result" =~ "Cipher is ${cipher}" || "$result" =~ "Cipher :" ]] ; then
echo "YES: "$cipher
fi
fi
done
nmap --script ssl-enum-ciphers -p PORT URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment