Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.63 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. # OpenSSL requires the port number.
  4. SERVER=192.168.1.11:443
  5. DELAY=1
  6. ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')
  7.  
  8. echo Obtaining cipher list from $(openssl version).
  9.  
  10. for cipher in ${ciphers[@]}
  11. do
  12. echo -n Testing $cipher...
  13. result=$(echo -n | openssl s_client -cipher "$cipher" -connect $SERVER 2>&1)
  14. if [[ "$result" =~ ":error:" ]] ; then
  15.   error=$(echo -n $result | cut -d':' -f6)
  16.   echo NO \($error\)
  17. else
  18.   if [[ "$result" =~ "Cipher is ${cipher}" || "$result" =~ "Cipher    :" ]] ; then
  19.     echo YES
  20.   else
  21.     echo UNKNOWN RESPONSE
  22.     echo $result
  23.   fi
  24. fi
  25. sleep $DELAY
  26. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement