Skip to content

Instantly share code, notes, and snippets.

@hahwul
Last active February 23, 2021 15:55
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 hahwul/2a93156d22ba150c8878ffe661868744 to your computer and use it in GitHub Desktop.
Save hahwul/2a93156d22ba150c8878ffe661868744 to your computer and use it in GitHub Desktop.
Emun cipher suite of website (only use openssl)
SERVER=$1
DELAY=1
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')
echo Enum cipher list from $(openssl version).
echo "========================"
for cipher in ${ciphers[@]}
do
result=$(echo -n | openssl s_client -cipher "$cipher" -connect $SERVER 2>&1)
if [[ "$result" =~ ":error:" ]] ; then
a=1
else
if [[ "$result" =~ "Cipher is ${cipher}" || "$result" =~ "Cipher :" ]] ; then
echo ${cipher}
fi
fi
sleep $DELAY
done
# ./enum-ciphersuite.sh www.hahwul.com:443
# Enum cipher list from LibreSSL 2.8.3.
# ========================
# ECDHE-RSA-AES256-GCM-SHA384
# ECDHE-RSA-AES256-SHA384
# ECDHE-RSA-AES256-SHA
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment