Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@wchen-r7
Last active August 29, 2015 14:24
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 wchen-r7/d7cdc70e4e64f1833315 to your computer and use it in GitHub Desktop.
Save wchen-r7/d7cdc70e4e64f1833315 to your computer and use it in GitHub Desktop.
# 1. Start msfconsole
# 2. Type irb to enter irb mode
# 3. Copy and paste the following
# 4. And then you can compare CVEs
# 5. You should get something like this:
# https://gist.github.com/wchen-r7/d79e10fbd26cb1c8d50b
table = Rex::Ui::Text::Table.new(
'Header' => 'Exploits',
'Indent' => 1,
'Columns' => ['CVE', 'Module']
)
puts "This may take a while, please wait..."
framework.modules.entries.each do |item|
fullname = item.first
mod = framework.modules.create(fullname)
next unless mod
cves = mod.references.select {|e| e.ctx_id == 'CVE'}
unless cves.blank?
puts "Found CVE(s) for #{fullname}"
end
cves.each do |cve|
table << ["CVE-#{cve.ctx_val}", fullname]
end
end
csv = table.to_csv
puts csv
fpath = '/tmp/msf_cves.csv'
f = File.new(fpath, 'wb')
f.write(csv)
f.close
puts "Results saved to: #{fpath}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment