Skip to content

Instantly share code, notes, and snippets.

@michiel
Last active August 29, 2015 13:58
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 michiel/10102208 to your computer and use it in GitHub Desktop.
Save michiel/10102208 to your computer and use it in GitHub Desktop.
#!/bin/bash
# check for heartbleed.com vuln
# quick, dirty, grain of salt, etc
declare -a hosts=('api.example.com' 'www.google.com')
for host in "${hosts[@]}";
do
echo "Testing $host ..."
echo -e "quit\n" | openssl s_client -connect $host:443 -tlsextdebug 2>&1| [ "` grep -c 'TLS server extension \"heartbeat\" (id=15), len=1'`" -gt 0 ] && echo 'Vulnerable' || echo 'Not vulnerable'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment