Last active
August 29, 2015 14:24
-
-
Save wchen-r7/d7cdc70e4e64f1833315 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# 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