Skip to content

Instantly share code, notes, and snippets.

@zdk
Created July 10, 2015 08:40
Show Gist options
  • Save zdk/a7a76ed5e58121292d31 to your computer and use it in GitHub Desktop.
Save zdk/a7a76ed5e58121292d31 to your computer and use it in GitHub Desktop.
Check affected openssl versions for [CVE-2015-1793] http://openssl.org/news/secadv_20150709.txt
#!/usr/bin/env ruby
# Usage: cat server_list.txt | ./check.rb
AFFECTED_VERSIONS = %r{
1\.0\.2c|
1\.0\.2b|
1\.0\.1n|
1\.0\.1o
}x
hosts = ARGF.read
hosts.each_line do |host|
print "#{host.chomp!} "
result = `ssh #{host} 'openssl version'`
if result.match AFFECTED_VERSIONS
puts "[ \033[31mAffected\033[0m ]"
else
puts "[ \033[32mSafe\033[0m ]"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment