-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathnodesec_severity.rb
More file actions
28 lines (21 loc) · 829 Bytes
/
nodesec_severity.rb
File metadata and controls
28 lines (21 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env ruby
require 'typhoeus'
require 'uri'
require 'nokogiri'
url = 'https://nodesecurity.io/advisories/'
ids = ARGV[0].split(',')
cvsses = {}
ids.each do |id|
new_url = URI.parse(url).merge(id)
response = Typhoeus.get( new_url.to_s,
:ssl_verifyhost => 0,
:ssl_verifypeer => false,
:followlocation => true,
:headers => {'User-Agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36'},
:timeout => 1000 )
cvsses[new_url] = Nokogiri::HTML(response.body).css('.cvss-score').text
end
cvsses.sort_by {|_key, value| value}.reverse.each do |key, value|
p "#{key} CVSS:#{value}"
end
exit