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
166 167 168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/tls_map/app/extractor/extractor.rb', line 166 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
156 157 158 159 |
# File 'lib/tls_map/app/extractor/extractor.rb', line 156 def parse(file, online = false) doc = REXML::Document.new(File.new(file)) extract_cipher(doc, online) end |