Module: Ronin::Support::Network::TLS::Mixin
- Includes:
- SSL::Mixin
- Defined in:
- lib/ronin/support/network/tls/mixin.rb
Overview
Provides helper methods for communicating with TLS-enabled services.
Instance Method Summary collapse
-
#tls_accept(version: 1.2, **kwargs) {|client| ... } ⇒ nil
Creates a new SSL socket listening on a given host and port, accepts only one client and then stops listening.
-
#tls_banner(host, port, version: 1.2, **kwargs) {|banner| ... } ⇒ String
Reads the banner from the service running on the given host and port.
-
#tls_cert(host, port, version: 1.2, **kwargs) {|tls_socket| ... } ⇒ OpenSSL::X509::Certificate
Connects to the host and port and returns the server's certificate.
-
#tls_connect(host, port, version: 1.2, **kwargs) {|tls_socket| ... } ⇒ OpenSSL::SSL::SSLSocket?
Establishes a SSL connection.
-
#tls_connect_and_send(data, host, port, version: 1.2, **kwargs) {|tls_socket| ... } ⇒ Object
Creates a new SSL connection and sends the given data.
-
#tls_context(version: 1.2, **kwargs) ⇒ OpenSSL::SSL::SSLContext
Creates a new TLS Context.
-
#tls_open?(host, port, version: 1.2, **kwargs) ⇒ Boolean?
Tests whether a remote SSLed TCP port is open.
-
#tls_send(data, host, port, version: 1.2, **kwargs) ⇒ true
Connects to a specified host and port, sends the given data and then closes the connection.
-
#tls_server_loop(version: 1.2, **kwargs) {|client| ... } ⇒ nil
Creates a new SSL socket listening on a given host and port, accepting clients in a loop.
-
#tls_server_socket(socket, version: 1.2, **kwargs) ⇒ OpenSSL::SSL::SSLSocket
Accepts an SSL session from an existing TCP socket.
-
#tls_socket(socket, version: 1.2, **kwargs) ⇒ OpenSSL::SSL::SSLSocket
Initiates an SSL session with an existing TCP socket.
Methods included from SSL::Mixin
#ssl_accept, #ssl_banner, #ssl_cert, #ssl_connect, #ssl_connect_and_send, #ssl_context, #ssl_open?, #ssl_send, #ssl_server_loop, #ssl_server_socket, #ssl_socket
Methods included from Ronin::Support::Network::TCP::Mixin
#tcp_accept, #tcp_banner, #tcp_connect, #tcp_connect_and_send, #tcp_open?, #tcp_send, #tcp_server, #tcp_server_loop, #tcp_server_session
Instance Method Details
#tls_accept(version: 1.2, **kwargs) {|client| ... } ⇒ nil
Creates a new SSL socket listening on a given host and port, accepts only one client and then stops listening.
663 664 665 |
# File 'lib/ronin/support/network/tls/mixin.rb', line 663 def tls_accept(version: 1.2, **kwargs, &block) ssl_accept(version: version, **kwargs, &block) end |
#tls_banner(host, port, version: 1.2, **kwargs) {|banner| ... } ⇒ String
Reads the banner from the service running on the given host and port.
433 434 435 |
# File 'lib/ronin/support/network/tls/mixin.rb', line 433 def (host,port, version: 1.2, **kwargs, &block) (host,port, version: version, **kwargs, &block) end |
#tls_cert(host, port, version: 1.2, **kwargs) {|tls_socket| ... } ⇒ OpenSSL::X509::Certificate
Connects to the host and port and returns the server's certificate.
368 369 370 |
# File 'lib/ronin/support/network/tls/mixin.rb', line 368 def tls_cert(host,port, version: 1.2, **kwargs) ssl_cert(host,port, version: version, **kwargs) end |
#tls_connect(host, port, version: 1.2, **kwargs) {|tls_socket| ... } ⇒ OpenSSL::SSL::SSLSocket?
Establishes a SSL connection.
253 254 255 |
# File 'lib/ronin/support/network/tls/mixin.rb', line 253 def tls_connect(host,port, version: 1.2, **kwargs, &block) ssl_connect(host,port, version: version, **kwargs, &block) end |
#tls_connect_and_send(data, host, port, version: 1.2, **kwargs) {|tls_socket| ... } ⇒ Object
Creates a new SSL connection and sends the given data.
313 314 315 |
# File 'lib/ronin/support/network/tls/mixin.rb', line 313 def tls_connect_and_send(data,host,port, version: 1.2, **kwargs, &block) ssl_connect_and_send(data,host,port, version: version, **kwargs, &block) end |
#tls_context(version: 1.2, **kwargs) ⇒ OpenSSL::SSL::SSLContext
Creates a new TLS Context.
69 70 71 |
# File 'lib/ronin/support/network/tls/mixin.rb', line 69 def tls_context(version: 1.2, **kwargs) ssl_context(version: version, **kwargs) end |
#tls_open?(host, port, version: 1.2, **kwargs) ⇒ Boolean?
Tests whether a remote SSLed TCP port is open.
179 180 181 |
# File 'lib/ronin/support/network/tls/mixin.rb', line 179 def tls_open?(host,port, version: 1.2, **kwargs) ssl_open?(host,port, version: version, **kwargs) end |
#tls_send(data, host, port, version: 1.2, **kwargs) ⇒ true
Connects to a specified host and port, sends the given data and then closes the connection.
496 497 498 |
# File 'lib/ronin/support/network/tls/mixin.rb', line 496 def tls_send(data,host,port, version: 1.2, **kwargs) ssl_send(data,host,port, version: version, **kwargs) end |
#tls_server_loop(version: 1.2, **kwargs) {|client| ... } ⇒ nil
Creates a new SSL socket listening on a given host and port, accepting clients in a loop.
593 594 595 |
# File 'lib/ronin/support/network/tls/mixin.rb', line 593 def tls_server_loop(version: 1.2, **kwargs, &block) ssl_server_loop(version: 1.2, **kwargs, &block) end |
#tls_server_socket(socket, version: 1.2, **kwargs) ⇒ OpenSSL::SSL::SSLSocket
Accepts an SSL session from an existing TCP socket.
526 527 528 |
# File 'lib/ronin/support/network/tls/mixin.rb', line 526 def tls_server_socket(socket, version: 1.2, **kwargs) ssl_server_socket(socket, version: version, **kwargs) end |
#tls_socket(socket, version: 1.2, **kwargs) ⇒ OpenSSL::SSL::SSLSocket
Initiates an SSL session with an existing TCP socket.
114 115 116 |
# File 'lib/ronin/support/network/tls/mixin.rb', line 114 def tls_socket(socket, version: 1.2, **kwargs) ssl_socket(socket,version: version, **kwargs) end |