24 lines
No EOL
655 B
Ruby
Executable file
24 lines
No EOL
655 B
Ruby
Executable file
#!/usr/bin/env ruby
|
|
require './microsoft_kb_checker.rb'
|
|
require 'optparse'
|
|
|
|
ARGV << '-h' if ARGV.empty?
|
|
|
|
params = {}
|
|
|
|
OptionParser.new do |opts|
|
|
opts.banner = "Usage: microsoft_cve_audit.rb [OPTIONS]"
|
|
|
|
opts.on('-c NAME', '--cve', "The cve id to check.") { |c| params[:cve_id] = c }
|
|
opts.on('-o NAME', '--os', "The operating system to check.") {|o| params[:os_name] = o }
|
|
|
|
opts.on_tail("-h", "--help", "Show this message") do
|
|
puts opts
|
|
exit
|
|
end
|
|
end.parse!(into: params)
|
|
|
|
raise OptionParser::MissingArgument if params[:cve_id].nil?
|
|
raise OptionParser::MissingArgument if params[:os_name].nil?
|
|
|
|
puts MicrosoftKbChecker.new(params).query_cve |