Class: TLSmap::App::Extractor
- Inherits:
-
Object
- Object
- TLSmap::App::Extractor
- Defined in:
- lib/tls_map/app/extractor/extractor.rb
Overview
External tools output data extractor
Output files from SSLyze (JSON), sslscan2 (XML), testssl.sh (JSON), ssllabs-scan (JSON) , tlsx (JSON)
Example of commands:
sslyze --json_out=example.org.json example.org
sslscan2 --show-cipher-ids --xml=example.org.xml example.org
--show-cipher-ids
is mandatory else ciphers are not saved to the output
testssl --jsonfile-pretty example.org.json --mapping no-openssl --cipher-per-proto example.org
- json-pretty is the only supported format, default json or csv, html won't work
ssllabs-scan --quiet example.org > example.org.json
- The default output is the only supported format, using
-json-flat
won't work
- The default output is the only supported format, using
tlsx -u example.org -cipher-enum -o example.org.json -j -sm ctls
Defined Under Namespace
Classes: SsllabsScan, Sslscan2, Sslyze, Testssl, Tlsx
Instance Attribute Summary collapse
-
#ciphers ⇒ Array<String>
readonly
Get the list of ciphers extracted from the tool output file.
Instance Method Summary collapse
-
#initialize ⇒ Extractor
constructor
Initialize Extractor instance.
-
#parse(tool, file) ⇒ Array<String>
Extract the ciphers from the tool output file.
-
#ssl20 ⇒ Array<String>
Return only the SSL 2.0 ciphers.
-
#ssl30 ⇒ Array<String>
Return only the SSL 3.0 ciphers.
-
#tls10 ⇒ Array<String>
Return only the TLS 1.0 ciphers.
-
#tls11 ⇒ Array<String>
Return only the TLS 1.1 ciphers.
-
#tls12 ⇒ Array<String>
Return only the TLS 1.2 ciphers.
-
#tls13 ⇒ Array<String>
Return only the TLS 1.3 ciphers.
Constructor Details
#initialize ⇒ Extractor
Initialize TLSmap::App::Extractor instance
39 40 41 |
# File 'lib/tls_map/app/extractor/extractor.rb', line 39 def initialize @ciphers = [] end |
Instance Attribute Details
#ciphers ⇒ Array<String> (readonly)
Get the list of ciphers extracted from the tool output file
36 37 38 |
# File 'lib/tls_map/app/extractor/extractor.rb', line 36 def ciphers @ciphers end |
Instance Method Details
#parse(tool, file) ⇒ Array<String>
Extract the ciphers from the tool output file
83 84 85 86 87 88 |
# File 'lib/tls_map/app/extractor/extractor.rb', line 83 def parse(tool, file) # Convert string to class @ciphers = Object.const_get("TLSmap::App::Extractor::#{normalize(tool)}").parse(file) rescue StandardError warn helper(tool) end |
#ssl20 ⇒ Array<String>
Return only the SSL 2.0 ciphers
45 46 47 |
# File 'lib/tls_map/app/extractor/extractor.rb', line 45 def ssl20 @ciphers['SSL2.0'] end |
#ssl30 ⇒ Array<String>
Return only the SSL 3.0 ciphers
51 52 53 |
# File 'lib/tls_map/app/extractor/extractor.rb', line 51 def ssl30 @ciphers['SSL3.0'] end |
#tls10 ⇒ Array<String>
Return only the TLS 1.0 ciphers
57 58 59 |
# File 'lib/tls_map/app/extractor/extractor.rb', line 57 def tls10 @ciphers['TLS1.0'] end |
#tls11 ⇒ Array<String>
Return only the TLS 1.1 ciphers
63 64 65 |
# File 'lib/tls_map/app/extractor/extractor.rb', line 63 def tls11 @ciphers['TLS1.1'] end |
#tls12 ⇒ Array<String>
Return only the TLS 1.2 ciphers
69 70 71 |
# File 'lib/tls_map/app/extractor/extractor.rb', line 69 def tls12 @ciphers['TLS1.2'] end |
#tls13 ⇒ Array<String>
Return only the TLS 1.3 ciphers
75 76 77 |
# File 'lib/tls_map/app/extractor/extractor.rb', line 75 def tls13 @ciphers['TLS1.3'] end |