Module: Ronin::Support::Network::TLS
- Includes:
- SSL
- Defined in:
- lib/ronin/support/network/tls.rb,
lib/ronin/support/network/tls/mixin.rb,
lib/ronin/support/network/tls/proxy.rb
Overview
Defined Under Namespace
Constant Summary
Constants included from SSL
Class Method Summary collapse
-
.accept(min_version: 1, **kwargs) {|client| ... } ⇒ nil
Creates a new SSL socket listening on a given host and port, accepts only one client and then stops listening.
-
.banner(host, port, min_version: 1, **kwargs) {|banner| ... } ⇒ String
Reads the banner from the service running on the given host and port.
-
.connect(host, port, min_version: 1, **kwargs) {|tls_socket| ... } ⇒ OpenSSL::SSL::SSLSocket?
Establishes a SSL connection.
-
.connect_and_send(data, host, port, min_version: 1, **kwargs) {|tls_socket| ... } ⇒ Object
Creates a new SSL connection and sends the given data.
-
.context(min_version: 1, **kwargs) ⇒ OpenSSL::SSL::SSLContext
Creates a new TLS context.
-
.get_cert(host, port, min_version: 1, **kwargs) {|tls_socket| ... } ⇒ OpenSSL::X509::Certificate
Connects to the host and port and returns the server's certificate.
-
.open?(host, port, min_version: 1, **kwargs) ⇒ Boolean?
Tests whether a remote SSLed TCP port is open.
-
.send(data, host, port, min_version: 1, **kwargs) ⇒ true
Connects to a specified host and port, sends the given data and then closes the connection.
-
.server(min_version: 1, **kwargs) {|server| ... } ⇒ OpenSSL::SSL::SSLServer
Creates a new TLS server listening on a given host and port.
-
.server_loop(min_version: 1, **kwargs) {|client| ... } ⇒ nil
Creates a new SSL socket listening on a given host and port, accepting clients in a loop.
-
.server_session(min_version: 1, **kwargs) {|server| ... } ⇒ OpenSSL::SSL::SSLServer
Creates a new temporary TLS server listening on a given host and port.
-
.server_socket(socket, min_version: 1, **kwargs) ⇒ OpenSSL::SSL::SSLSocket
Accepts an TLS session from an existing TCP socket.
-
.socket(socket, min_version: 1, **kwargs) ⇒ OpenSSL::SSL::SSLSocket
Initiates an SSL session with an existing TCP socket.
Methods included from SSL
Class Method Details
.accept(min_version: 1, **kwargs) {|client| ... } ⇒ nil
Creates a new SSL socket listening on a given host and port, accepts only one client and then stops listening.
531 532 533 |
# File 'lib/ronin/support/network/tls.rb', line 531 def self.accept(min_version: 1, **kwargs, &block) SSL.accept(min_version: min_version, **kwargs, &block) end |
.banner(host, port, min_version: 1, **kwargs) {|banner| ... } ⇒ String
Reads the banner from the service running on the given host and port.
305 306 307 |
# File 'lib/ronin/support/network/tls.rb', line 305 def self.(host,port, min_version: 1, **kwargs, &block) SSL.(host,port, min_version: min_version, **kwargs, &block) end |
.connect(host, port, min_version: 1, **kwargs) {|tls_socket| ... } ⇒ OpenSSL::SSL::SSLSocket?
Establishes a SSL connection.
203 204 205 |
# File 'lib/ronin/support/network/tls.rb', line 203 def self.connect(host,port, min_version: 1, **kwargs, &block) SSL.connect(host,port, min_version: min_version, **kwargs, &block) end |
.connect_and_send(data, host, port, min_version: 1, **kwargs) {|tls_socket| ... } ⇒ Object
Creates a new SSL connection and sends the given data.
237 238 239 |
# File 'lib/ronin/support/network/tls.rb', line 237 def self.connect_and_send(data,host,port, min_version: 1, **kwargs, &block) SSL.connect_and_send(data,host,port, min_version: min_version, **kwargs, &block) end |
.context(min_version: 1, **kwargs) ⇒ OpenSSL::SSL::SSLContext
Creates a new TLS context.
83 84 85 |
# File 'lib/ronin/support/network/tls.rb', line 83 def self.context(min_version: 1, **kwargs) SSL.context(min_version: min_version, **kwargs) end |
.get_cert(host, port, min_version: 1, **kwargs) {|tls_socket| ... } ⇒ OpenSSL::X509::Certificate
Connects to the host and port and returns the server's certificate.
266 267 268 |
# File 'lib/ronin/support/network/tls.rb', line 266 def self.get_cert(host,port, min_version: 1, **kwargs) SSL.get_cert(host,port, min_version: min_version, **kwargs) end |
.open?(host, port, min_version: 1, **kwargs) ⇒ Boolean?
Tests whether a remote SSLed TCP port is open.
155 156 157 |
# File 'lib/ronin/support/network/tls.rb', line 155 def self.open?(host,port, min_version: 1, **kwargs) SSL.open?(host,port, min_version: min_version, **kwargs) end |
.send(data, host, port, min_version: 1, **kwargs) ⇒ true
Connects to a specified host and port, sends the given data and then closes the connection.
342 343 344 |
# File 'lib/ronin/support/network/tls.rb', line 342 def self.send(data,host,port, min_version: 1, **kwargs) SSL.send(data,host,port, min_version: min_version, **kwargs) end |
.server(min_version: 1, **kwargs) {|server| ... } ⇒ OpenSSL::SSL::SSLServer
Creates a new TLS server listening on a given host and port.
420 421 422 |
# File 'lib/ronin/support/network/tls.rb', line 420 def self.server(min_version: 1, **kwargs, &block) SSL.server(min_version: min_version, **kwargs, &block) end |
.server_loop(min_version: 1, **kwargs) {|client| ... } ⇒ nil
Creates a new SSL socket listening on a given host and port, accepting clients in a loop.
487 488 489 |
# File 'lib/ronin/support/network/tls.rb', line 487 def self.server_loop(min_version: 1, **kwargs, &block) SSL.server_loop(min_version: min_version, **kwargs, &block) end |
.server_session(min_version: 1, **kwargs) {|server| ... } ⇒ OpenSSL::SSL::SSLServer
Creates a new temporary TLS server listening on a given host and port.
449 450 451 |
# File 'lib/ronin/support/network/tls.rb', line 449 def self.server_session(min_version: 1, **kwargs, &block) SSL.server_session(min_version: min_version, **kwargs, &block) end |
.server_socket(socket, min_version: 1, **kwargs) ⇒ OpenSSL::SSL::SSLSocket
Accepts an TLS session from an existing TCP socket.
378 379 380 |
# File 'lib/ronin/support/network/tls.rb', line 378 def self.server_socket(socket, min_version: 1, **kwargs) SSL.server_socket(socket, min_version: min_version, **kwargs) end |