Skip to content

Commit

Permalink
- better detection for ssl poodle
Browse files Browse the repository at this point in the history
- change of shorticut from zero to letter o
  • Loading branch information
drwetter committed Feb 27, 2015
1 parent 87f821e commit 29214c7
Showing 1 changed file with 40 additions and 27 deletions.
67 changes: 40 additions & 27 deletions testssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -367,24 +367,6 @@ runs_HTTP() {
return $ret
}

# Padding Oracle On Downgraded Legacy Encryption
poodle() {
pr_bold " POODLE "; out "(CVE-2014-3566), experimental "
# w/o downgrade check as of now https://tools.ietf.org/html/draft-ietf-tls-downgrade-scsv-00 | TLS_FALLBACK_SCSV
$OPENSSL s_client -ssl3 $STARTTLS -connect $NODEIP:$PORT $SNI 2>$TMPFILE >/dev/null </dev/null
ret=$?
[ "$VERBERR" -eq 0 ] && cat $TMPFILE | egrep "error|failure" | egrep -v "unable to get local|verify error"
if [ $ret -eq 0 ]; then
pr_litered "VULNERABLE (NOT ok)"; out ", uses SSLv3 (no TLS_FALLBACK_SCSV mitigation tested)"
else
pr_green "not vulnerable (OK)"
fi
outln

tmpfile_handle $FUNCNAME.txt
return $ret
}

#problems not handled: chunked
http_header() {
[ -z "$1" ] && url="/" || url="$1"
Expand Down Expand Up @@ -907,7 +889,6 @@ runprotocols() {
7) ;; # no local support
esac


testprotohelper "-tls1" " TLSv1 "
case $? in
0) ok 2 0 ;; # no GCM, thus only normal print
Expand Down Expand Up @@ -2176,7 +2157,40 @@ crime() {
return $ret
}

# for appliance which use padding, no fallack needed
tls_poodle() {
pr_bold " POODLE, SSL"; out " CVE-2014-8730), experimental "
#FIXME
echo "#FIXME"
return 7
}


# Padding Oracle On Downgraded Legacy Encryption, in a nutshell: don't use CBC Ciphers in SSLv3
ssl_poodle() {
local ret
local cbc_ciphers

pr_bold " POODLE, SSL"; out " (CVE-2014-3566), experimental "
cbc_ciphers=`$OPENSSL ciphers -v 'ALL:eNULL' | grep CBC | awk '{ print $1 }' | tr '\n' ':'`
debugme echo $cbc_ciphers
$OPENSSL s_client -ssl3 $STARTTLS -cipher $cbc_ciphers -connect $NODEIP:$PORT $SNI &>$TMPFILE </dev/null
ret=$?
[ "$VERBERR" -eq 0 ] && cat $TMPFILE | egrep "error|failure" | egrep -v "unable to get local|verify error"
if [ $ret -eq 0 ]; then
pr_litered "VULNERABLE (NOT ok)"; out ", uses SSLv3+CBC (no TLS_FALLBACK_SCSV mitigation tested)"
else
pr_green "not vulnerable (OK)"
fi
outln

tmpfile_handle $FUNCNAME.txt
return $ret
}



#in a nutshell: don't use CBC Ciphers in SSLv3 TLSv1.0
# Browser Exploit Against SSL/TLS
beast(){
shopt -s lastpipe # otherwise it's more tricky to access variables in a while loop
Expand All @@ -2186,7 +2200,6 @@ beast(){
local higher_proto_supported=""
local -i ret=0
local spaces=" "
#in a nutshell: don't use CBC Ciphers in SSLv3 TLSv1.0

pr_bold " BEAST"; out " (CVE-2011-3389) "

Expand Down Expand Up @@ -2327,7 +2340,7 @@ starttls() {
# ccs_injection ; ret=`expr $? + $ret`
renego ; ret=`expr $? + $ret`
crime ; ret=`expr $? + $ret`
poodle ; ret=`expr $? + $ret`
ssl_poodle ; ret=`expr $? + $ret`
beast ; ret=`expr $? + $ret`

rc4 ; ret=`expr $? + $ret`
Expand Down Expand Up @@ -2374,7 +2387,7 @@ $PRG <options> URI
<-R|--renegotiation> tests only for renegotiation vulnerability
<-C|--compression|--crime> tests only for CRIME vulnerability
<-T|--breach> tests only for BREACH vulnerability
<-0|--poodle> tests only for POODLE vulnerability
<-O|--poodle> tests only for POODLE vulnerability
<-A|--beast> tests only for BEAST vulnerability
<-s|--pfs|--fs|--nsa> checks (perfect) forward secrecy settings
<-4|--rc4|--appelbaum> which RC4 ciphers are being offered?
Expand Down Expand Up @@ -2794,11 +2807,11 @@ case "$1" in
fi
ret=`expr $? + $ret`
exit $ret ;;
-0|--poodle)
-O|--ssl_poodle|poodle)
maketempf
parse_hn_port "$2"
outln; pr_blue "--> Testing for POODLE (Padding Oracle On Downgraded Legacy Encryption) vulnerability"; outln "\n"
poodle
outln; pr_blue "--> Testing for POODLE (Padding Oracle On Downgraded Legacy Encryption) vulnerability, SSLv3"; outln "\n"
ssl_poodle
exit $? ;;
-4|--rc4|--appelbaum)
maketempf
Expand Down Expand Up @@ -2863,14 +2876,14 @@ case "$1" in
renego ; ret=`expr $? + $ret`
crime ; ret=`expr $? + $ret`
[[ $SERVICE == "HTTP" ]] && breach "$URL_PATH" ; ret=`expr $? + $ret`
poodle ; ret=`expr $? + $ret`
ssl_poodle ; ret=`expr $? + $ret`
beast ; ret=`expr $? + $ret`

rc4 ; ret=`expr $? + $ret`
pfs ; ret=`expr $? + $ret`
exit $ret ;;
esac

# $Id: testssl.sh,v 1.195 2015/02/23 09:40:09 dirkw Exp $
# $Id: testssl.sh,v 1.196 2015/02/27 20:21:37 dirkw Exp $
# vim:ts=5:sw=5

0 comments on commit 29214c7

Please sign in to comment.