Class: TLSmap::App::Extractor::Sslscan2
- Inherits:
-
Object
- Object
- TLSmap::App::Extractor::Sslscan2
- Defined in:
- lib/tls_map/app/extractor/extractor.rb
Overview
Parsing sslscan2
Class Method Summary collapse
-
.extract_cipher(xml_doc, online = false) ⇒ Array<String>
Extract the ciphers from the sslscan2 output file.
-
.parse(file, online = false) ⇒ Array<String>
Extract the ciphers from the sslscan2 output file.
Class Method Details
.extract_cipher(xml_doc, online = false) ⇒ Array<String>
Extract the ciphers from the sslscan2 output file
199 200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/tls_map/app/extractor/extractor.rb', line 199 def extract_cipher(xml_doc, online = false) # rubocop:disable Metrics/MethodLength raw = { 'SSL2.0' => [], 'SSL3.0' => [], 'TLS1.0' => [], 'TLS1.1' => [], 'TLS1.2' => [], 'TLS1.3' => [] } tm = online ? TLSmap::App.new : TLSmap::CLI.new xml_doc.root.each_element('//cipher') do |node| sslv = node.attributes['sslversion'].gsub('v', '') cipher = tm.search(:codepoint, node.attributes['id'][2..], :iana)[:iana] raw[sslv].push(cipher) end raw end |
.parse(file, online = false) ⇒ Array<String>
Extract the ciphers from the sslscan2 output file
189 190 191 192 |
# File 'lib/tls_map/app/extractor/extractor.rb', line 189 def parse(file, online = false) doc = REXML::Document.new(File.new(file)) extract_cipher(doc, online) end |