Created
July 10, 2015 08:40
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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