Created
September 13, 2020 03:54
-
-
Save ninoseki/e05ce53f7144f9fb89104efe8d4064f5 to your computer and use it in GitHub Desktop.
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
require "json" | |
require 'certificate-transparency-client' | |
require "parallel" | |
ct = CT::Client.new "https://ct.example.org" | |
list = JSON.parse(File.read("all_logs_list.json")) | |
logs = list.dig("logs") || [] | |
urls = logs.map { |log| "https://" + log.dig("url") }.map { |url| url[0..-2] } | |
Parallel.each(urls) do |url| | |
ct = CT::Client.new(url) | |
entries = ct.get_entries(0, 1023) | |
p [url, entries.length] | |
rescue SocketError, EOFError, Net::OpenTimeout, OpenSSL::SSL::SSLError, Errno::ECONNREFUSED, CertificateTransparency::Client::HTTPError | |
next | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment