Advertisement
Guest User

Untitled

a guest
Oct 25th, 2014
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. # Copyright (C) 2014 by Red Hat
  4. #
  5. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 3 of the License, or
  8. # (at your option) any later version.
  9.  
  10. host=${1:-127.0.0.1}
  11. port=${2:-443}
  12. timeout_bin=`which timeout 2>/dev/null`
  13.  
  14. echo -n "$host:$port - "
  15.  
  16. out="`echo 'Q' | ${timeout_bin:+$timeout_bin 5} openssl s_client -ssl3 -connect "${host}:${port}" 2>/dev/null`"
  17.  
  18. if [ $? -eq 124 ]; then
  19. echo "error: Timeout connecting to host!"
  20. exit 1
  21. fi
  22.  
  23. if ! echo "$out" | grep -q 'Cipher is' ; then
  24. echo 'Not vulnerable. Failed to establish SSL connection.'
  25. exit 0
  26. fi
  27.  
  28. proto=`echo "$out" | grep '^ *Protocol *:' | awk '{ print $3 }'`
  29. cipher=`echo "$out" | grep '^ *Cipher *:' | awk '{ print $3 }'`
  30.  
  31. if [ "$cipher" = '0000' -o "$cipher" = '(NONE)' ]; then
  32. echo 'Not vulnerable. Failed to establish SSLv3 connection.'
  33. exit 0
  34. else
  35. echo "Vulnerable! (You can hack) SSLv3 connection established using $proto/$cipher"
  36. exit 1
  37. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement