ronin-support 1.0.6 → 1.1.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +28 -0
- data/ChangeLog.md +111 -0
- data/README.md +5 -1
- data/lib/ronin/support/archive/core_ext/file.rb +1 -1
- data/lib/ronin/support/archive/core_ext.rb +1 -1
- data/lib/ronin/support/archive/mixin.rb +1 -1
- data/lib/ronin/support/archive/tar/reader.rb +1 -1
- data/lib/ronin/support/archive/tar/writer.rb +1 -1
- data/lib/ronin/support/archive/tar.rb +1 -1
- data/lib/ronin/support/archive/zip/reader/entry.rb +1 -1
- data/lib/ronin/support/archive/zip/reader/statistics.rb +1 -1
- data/lib/ronin/support/archive/zip/reader.rb +1 -1
- data/lib/ronin/support/archive/zip/writer.rb +1 -1
- data/lib/ronin/support/archive/zip.rb +1 -1
- data/lib/ronin/support/archive.rb +1 -1
- data/lib/ronin/support/binary/array.rb +1 -1
- data/lib/ronin/support/binary/bit_flip/core_ext/integer.rb +1 -1
- data/lib/ronin/support/binary/bit_flip/core_ext/string.rb +1 -1
- data/lib/ronin/support/binary/bit_flip/core_ext.rb +1 -1
- data/lib/ronin/support/binary/bit_flip.rb +1 -1
- data/lib/ronin/support/binary/buffer.rb +1 -1
- data/lib/ronin/support/binary/byte_slice.rb +1 -1
- data/lib/ronin/support/binary/core_ext/array.rb +1 -1
- data/lib/ronin/support/binary/core_ext/float.rb +3 -2
- data/lib/ronin/support/binary/core_ext/integer.rb +3 -2
- data/lib/ronin/support/binary/core_ext/io.rb +1 -1
- data/lib/ronin/support/binary/core_ext/string.rb +1 -1
- data/lib/ronin/support/binary/core_ext.rb +1 -1
- data/lib/ronin/support/binary/cstring.rb +1 -1
- data/lib/ronin/support/binary/ctypes/aggregate_type.rb +1 -1
- data/lib/ronin/support/binary/ctypes/arch/arm/big_endian.rb +1 -1
- data/lib/ronin/support/binary/ctypes/arch/arm.rb +1 -1
- data/lib/ronin/support/binary/ctypes/arch/arm64/big_endian.rb +1 -1
- data/lib/ronin/support/binary/ctypes/arch/arm64.rb +1 -1
- data/lib/ronin/support/binary/ctypes/arch/mips/little_endian.rb +1 -1
- data/lib/ronin/support/binary/ctypes/arch/mips.rb +1 -1
- data/lib/ronin/support/binary/ctypes/arch/mips64/little_endian.rb +1 -1
- data/lib/ronin/support/binary/ctypes/arch/mips64.rb +1 -1
- data/lib/ronin/support/binary/ctypes/arch/ppc.rb +1 -1
- data/lib/ronin/support/binary/ctypes/arch/ppc64.rb +1 -1
- data/lib/ronin/support/binary/ctypes/arch/x86.rb +1 -1
- data/lib/ronin/support/binary/ctypes/arch/x86_64.rb +1 -1
- data/lib/ronin/support/binary/ctypes/arch.rb +1 -1
- data/lib/ronin/support/binary/ctypes/array_object_type.rb +1 -1
- data/lib/ronin/support/binary/ctypes/array_type.rb +1 -1
- data/lib/ronin/support/binary/ctypes/big_endian.rb +1 -1
- data/lib/ronin/support/binary/ctypes/char_type.rb +1 -1
- data/lib/ronin/support/binary/ctypes/char_types.rb +1 -1
- data/lib/ronin/support/binary/ctypes/enum_type.rb +1 -1
- data/lib/ronin/support/binary/ctypes/float32_type.rb +1 -1
- data/lib/ronin/support/binary/ctypes/float64_type.rb +1 -1
- data/lib/ronin/support/binary/ctypes/float_type.rb +1 -1
- data/lib/ronin/support/binary/ctypes/int16_type.rb +1 -1
- data/lib/ronin/support/binary/ctypes/int32_type.rb +1 -1
- data/lib/ronin/support/binary/ctypes/int64_type.rb +1 -1
- data/lib/ronin/support/binary/ctypes/int8_type.rb +1 -1
- data/lib/ronin/support/binary/ctypes/int_type.rb +1 -1
- data/lib/ronin/support/binary/ctypes/little_endian.rb +1 -1
- data/lib/ronin/support/binary/ctypes/mixin.rb +11 -5
- data/lib/ronin/support/binary/ctypes/native.rb +1 -1
- data/lib/ronin/support/binary/ctypes/network.rb +1 -1
- data/lib/ronin/support/binary/ctypes/object_type.rb +1 -1
- data/lib/ronin/support/binary/ctypes/os/android.rb +39 -0
- data/lib/ronin/support/binary/ctypes/os/apple_ios.rb +39 -0
- data/lib/ronin/support/binary/ctypes/os/bsd.rb +1 -1
- data/lib/ronin/support/binary/ctypes/os/freebsd.rb +1 -1
- data/lib/ronin/support/binary/ctypes/os/linux.rb +1 -1
- data/lib/ronin/support/binary/ctypes/os/macos.rb +1 -1
- data/lib/ronin/support/binary/ctypes/os/netbsd.rb +1 -1
- data/lib/ronin/support/binary/ctypes/os/openbsd.rb +1 -1
- data/lib/ronin/support/binary/ctypes/os/unix.rb +1 -1
- data/lib/ronin/support/binary/ctypes/os/windows.rb +1 -1
- data/lib/ronin/support/binary/ctypes/os.rb +8 -3
- data/lib/ronin/support/binary/ctypes/scalar_type.rb +1 -1
- data/lib/ronin/support/binary/ctypes/string_type.rb +1 -1
- data/lib/ronin/support/binary/ctypes/struct_object_type.rb +1 -1
- data/lib/ronin/support/binary/ctypes/struct_type.rb +1 -1
- data/lib/ronin/support/binary/ctypes/type.rb +1 -1
- data/lib/ronin/support/binary/ctypes/type_resolver.rb +7 -3
- data/lib/ronin/support/binary/ctypes/uint16_type.rb +1 -1
- data/lib/ronin/support/binary/ctypes/uint32_type.rb +1 -1
- data/lib/ronin/support/binary/ctypes/uint64_type.rb +1 -1
- data/lib/ronin/support/binary/ctypes/uint8_type.rb +1 -1
- data/lib/ronin/support/binary/ctypes/uint_type.rb +1 -1
- data/lib/ronin/support/binary/ctypes/unbounded_array_type.rb +1 -1
- data/lib/ronin/support/binary/ctypes/union_object_type.rb +1 -1
- data/lib/ronin/support/binary/ctypes/union_type.rb +1 -1
- data/lib/ronin/support/binary/ctypes.rb +16 -10
- data/lib/ronin/support/binary/memory.rb +1 -1
- data/lib/ronin/support/binary/packet.rb +1 -1
- data/lib/ronin/support/binary/stack.rb +1 -1
- data/lib/ronin/support/binary/stream/methods.rb +1 -1
- data/lib/ronin/support/binary/stream.rb +1 -1
- data/lib/ronin/support/binary/struct/member.rb +1 -1
- data/lib/ronin/support/binary/struct.rb +3 -2
- data/lib/ronin/support/binary/template.rb +1 -1
- data/lib/ronin/support/binary/unhexdump/core_ext/file.rb +1 -1
- data/lib/ronin/support/binary/unhexdump/core_ext/string.rb +1 -1
- data/lib/ronin/support/binary/unhexdump/core_ext.rb +1 -1
- data/lib/ronin/support/binary/unhexdump/parser.rb +1 -1
- data/lib/ronin/support/binary/unhexdump.rb +1 -1
- data/lib/ronin/support/binary/union.rb +1 -1
- data/lib/ronin/support/binary.rb +1 -1
- data/lib/ronin/support/cli/ansi.rb +1 -1
- data/lib/ronin/support/cli/io_shell/core_ext/io.rb +1 -1
- data/lib/ronin/support/cli/io_shell/core_ext.rb +1 -1
- data/lib/ronin/support/cli/io_shell.rb +1 -1
- data/lib/ronin/support/cli/printing.rb +1 -1
- data/lib/ronin/support/cli.rb +1 -1
- data/lib/ronin/support/compression/core_ext/file.rb +1 -1
- data/lib/ronin/support/compression/core_ext/string.rb +1 -1
- data/lib/ronin/support/compression/core_ext.rb +1 -1
- data/lib/ronin/support/compression/gzip/reader.rb +1 -1
- data/lib/ronin/support/compression/gzip/writer.rb +1 -1
- data/lib/ronin/support/compression/gzip.rb +1 -1
- data/lib/ronin/support/compression/mixin.rb +1 -1
- data/lib/ronin/support/compression/zlib.rb +1 -1
- data/lib/ronin/support/compression.rb +1 -1
- data/lib/ronin/support/core_ext/enumerable.rb +1 -1
- data/lib/ronin/support/core_ext/file.rb +1 -1
- data/lib/ronin/support/core_ext/integer.rb +1 -1
- data/lib/ronin/support/core_ext/ipaddr.rb +1 -1
- data/lib/ronin/support/core_ext/kernel.rb +1 -1
- data/lib/ronin/support/core_ext/string.rb +1 -1
- data/lib/ronin/support/core_ext.rb +1 -1
- data/lib/ronin/support/crypto/cert.rb +50 -8
- data/lib/ronin/support/crypto/cert_chain.rb +1 -1
- data/lib/ronin/support/crypto/cipher/aes.rb +1 -1
- data/lib/ronin/support/crypto/cipher/aes128.rb +1 -1
- data/lib/ronin/support/crypto/cipher/aes256.rb +1 -1
- data/lib/ronin/support/crypto/cipher.rb +1 -1
- data/lib/ronin/support/crypto/core_ext/file.rb +1 -1
- data/lib/ronin/support/crypto/core_ext/string.rb +1 -1
- data/lib/ronin/support/crypto/core_ext.rb +1 -1
- data/lib/ronin/support/crypto/hmac.rb +1 -1
- data/lib/ronin/support/crypto/key/dh.rb +1 -1
- data/lib/ronin/support/crypto/key/dsa.rb +1 -1
- data/lib/ronin/support/crypto/key/ec.rb +25 -1
- data/lib/ronin/support/crypto/key/methods.rb +1 -1
- data/lib/ronin/support/crypto/key/rsa.rb +1 -1
- data/lib/ronin/support/crypto/key.rb +48 -4
- data/lib/ronin/support/crypto/mixin.rb +1 -1
- data/lib/ronin/support/crypto/openssl.rb +1 -1
- data/lib/ronin/support/crypto.rb +1 -1
- data/lib/ronin/support/encoding/base16/core_ext/string.rb +1 -1
- data/lib/ronin/support/encoding/base16/core_ext.rb +1 -1
- data/lib/ronin/support/encoding/base16.rb +1 -1
- data/lib/ronin/support/encoding/base32/core_ext/string.rb +1 -1
- data/lib/ronin/support/encoding/base32/core_ext.rb +1 -1
- data/lib/ronin/support/encoding/base32.rb +1 -1
- data/lib/ronin/support/encoding/base36/core_ext/integer.rb +43 -0
- data/lib/ronin/support/encoding/base36/core_ext/string.rb +43 -0
- data/lib/ronin/support/encoding/base36/core_ext.rb +20 -0
- data/lib/ronin/support/encoding/base36.rb +67 -0
- data/lib/ronin/support/encoding/base62/core_ext/integer.rb +43 -0
- data/lib/ronin/support/encoding/base62/core_ext/string.rb +43 -0
- data/lib/ronin/support/encoding/base62/core_ext.rb +20 -0
- data/lib/ronin/support/encoding/base62.rb +93 -0
- data/lib/ronin/support/encoding/base64/core_ext/string.rb +1 -1
- data/lib/ronin/support/encoding/base64/core_ext.rb +1 -1
- data/lib/ronin/support/encoding/base64.rb +1 -1
- data/lib/ronin/support/encoding/c/core_ext/integer.rb +1 -1
- data/lib/ronin/support/encoding/c/core_ext/string.rb +1 -1
- data/lib/ronin/support/encoding/c/core_ext.rb +1 -1
- data/lib/ronin/support/encoding/c.rb +1 -1
- data/lib/ronin/support/encoding/core_ext/string.rb +1 -1
- data/lib/ronin/support/encoding/core_ext.rb +1 -1
- data/lib/ronin/support/encoding/hex/core_ext/integer.rb +1 -1
- data/lib/ronin/support/encoding/hex/core_ext/string.rb +1 -1
- data/lib/ronin/support/encoding/hex/core_ext.rb +1 -1
- data/lib/ronin/support/encoding/hex.rb +1 -1
- data/lib/ronin/support/encoding/html/core_ext/integer.rb +1 -1
- data/lib/ronin/support/encoding/html/core_ext/string.rb +1 -1
- data/lib/ronin/support/encoding/html/core_ext.rb +1 -1
- data/lib/ronin/support/encoding/html.rb +1 -1
- data/lib/ronin/support/encoding/http/core_ext/integer.rb +1 -1
- data/lib/ronin/support/encoding/http/core_ext/string.rb +1 -1
- data/lib/ronin/support/encoding/http/core_ext.rb +1 -1
- data/lib/ronin/support/encoding/http.rb +1 -1
- data/lib/ronin/support/encoding/js/core_ext/integer.rb +1 -1
- data/lib/ronin/support/encoding/js/core_ext/string.rb +1 -1
- data/lib/ronin/support/encoding/js/core_ext.rb +1 -1
- data/lib/ronin/support/encoding/js.rb +1 -1
- data/lib/ronin/support/encoding/powershell/core_ext/integer.rb +1 -1
- data/lib/ronin/support/encoding/powershell/core_ext/string.rb +1 -1
- data/lib/ronin/support/encoding/powershell/core_ext.rb +1 -1
- data/lib/ronin/support/encoding/powershell.rb +1 -1
- data/lib/ronin/support/encoding/punycode/core_ext/string.rb +1 -1
- data/lib/ronin/support/encoding/punycode/core_ext.rb +1 -1
- data/lib/ronin/support/encoding/punycode.rb +1 -1
- data/lib/ronin/support/encoding/quoted_printable/core_ext/string.rb +1 -1
- data/lib/ronin/support/encoding/quoted_printable/core_ext.rb +1 -1
- data/lib/ronin/support/encoding/quoted_printable.rb +1 -1
- data/lib/ronin/support/encoding/ruby/core_ext/string.rb +1 -1
- data/lib/ronin/support/encoding/ruby/core_ext.rb +1 -1
- data/lib/ronin/support/encoding/ruby.rb +1 -1
- data/lib/ronin/support/encoding/shell/core_ext/integer.rb +1 -1
- data/lib/ronin/support/encoding/shell/core_ext/string.rb +1 -1
- data/lib/ronin/support/encoding/shell/core_ext.rb +1 -1
- data/lib/ronin/support/encoding/shell.rb +1 -1
- data/lib/ronin/support/encoding/smtp.rb +1 -1
- data/lib/ronin/support/encoding/sql/core_ext/string.rb +1 -1
- data/lib/ronin/support/encoding/sql/core_ext.rb +1 -1
- data/lib/ronin/support/encoding/sql.rb +1 -1
- data/lib/ronin/support/encoding/uri/core_ext/integer.rb +1 -1
- data/lib/ronin/support/encoding/uri/core_ext/string.rb +1 -1
- data/lib/ronin/support/encoding/uri/core_ext.rb +1 -1
- data/lib/ronin/support/encoding/uri.rb +1 -1
- data/lib/ronin/support/encoding/uuencoding/core_ext/string.rb +1 -1
- data/lib/ronin/support/encoding/uuencoding/core_ext.rb +1 -1
- data/lib/ronin/support/encoding/uuencoding.rb +1 -1
- data/lib/ronin/support/encoding/xml/core_ext/integer.rb +1 -1
- data/lib/ronin/support/encoding/xml/core_ext/string.rb +1 -1
- data/lib/ronin/support/encoding/xml/core_ext.rb +1 -1
- data/lib/ronin/support/encoding/xml.rb +1 -1
- data/lib/ronin/support/encoding.rb +7 -1
- data/lib/ronin/support/home.rb +1 -1
- data/lib/ronin/support/mixin.rb +1 -1
- data/lib/ronin/support/network/asn/dns_record.rb +1 -1
- data/lib/ronin/support/network/asn/list.rb +1 -1
- data/lib/ronin/support/network/asn/record.rb +1 -1
- data/lib/ronin/support/network/asn/record_set.rb +1 -1
- data/lib/ronin/support/network/asn.rb +1 -1
- data/lib/ronin/support/network/core_ext.rb +1 -1
- data/lib/ronin/support/network/dns/idn.rb +1 -1
- data/lib/ronin/support/network/dns/mixin.rb +1 -1
- data/lib/ronin/support/network/dns/resolver.rb +1 -1
- data/lib/ronin/support/network/dns.rb +1 -1
- data/lib/ronin/support/network/domain.rb +1 -1
- data/lib/ronin/support/network/email_address.rb +1 -1
- data/lib/ronin/support/network/esmtp/mixin.rb +1 -1
- data/lib/ronin/support/network/exceptions.rb +1 -1
- data/lib/ronin/support/network/ftp/mixin.rb +1 -1
- data/lib/ronin/support/network/host.rb +1 -1
- data/lib/ronin/support/network/http/cookie.rb +1 -1
- data/lib/ronin/support/network/http/core_ext/uri/http.rb +1 -1
- data/lib/ronin/support/network/http/core_ext.rb +1 -1
- data/lib/ronin/support/network/http/mixin.rb +42 -1
- data/lib/ronin/support/network/http/request.rb +86 -9
- data/lib/ronin/support/network/http/set_cookie.rb +1 -1
- data/lib/ronin/support/network/http/user_agents.rb +1 -1
- data/lib/ronin/support/network/http.rb +138 -6
- data/lib/ronin/support/network/imap/mixin.rb +1 -1
- data/lib/ronin/support/network/ip/mixin.rb +1 -1
- data/lib/ronin/support/network/ip.rb +42 -1
- data/lib/ronin/support/network/ip_range/cidr.rb +123 -1
- data/lib/ronin/support/network/ip_range/glob.rb +150 -10
- data/lib/ronin/support/network/ip_range/range.rb +34 -2
- data/lib/ronin/support/network/ip_range.rb +120 -5
- data/lib/ronin/support/network/mixin.rb +1 -11
- data/lib/ronin/support/network/packet.rb +1 -1
- data/lib/ronin/support/network/pop3/mixin.rb +1 -1
- data/lib/ronin/support/network/proxy.rb +1 -1
- data/lib/ronin/support/network/public_suffix/list.rb +1 -1
- data/lib/ronin/support/network/public_suffix/suffix.rb +1 -1
- data/lib/ronin/support/network/public_suffix/suffix_set.rb +1 -1
- data/lib/ronin/support/network/public_suffix.rb +1 -1
- data/lib/ronin/support/network/smtp/email.rb +1 -1
- data/lib/ronin/support/network/smtp/mixin.rb +1 -1
- data/lib/ronin/support/network/smtp.rb +1 -1
- data/lib/ronin/support/network/ssl/local_cert.rb +1 -1
- data/lib/ronin/support/network/ssl/local_key.rb +1 -1
- data/lib/ronin/support/network/ssl/mixin.rb +169 -400
- data/lib/ronin/support/network/ssl/openssl.rb +1 -1
- data/lib/ronin/support/network/ssl/proxy.rb +1 -1
- data/lib/ronin/support/network/ssl.rb +592 -13
- data/lib/ronin/support/network/tcp/mixin.rb +1 -1
- data/lib/ronin/support/network/tcp/proxy.rb +1 -1
- data/lib/ronin/support/network/tcp.rb +1 -1
- data/lib/ronin/support/network/telnet/mixin.rb +1 -1
- data/lib/ronin/support/network/telnet.rb +1 -1
- data/lib/ronin/support/network/tld/list.rb +1 -1
- data/lib/ronin/support/network/tld.rb +1 -1
- data/lib/ronin/support/network/tls/mixin.rb +174 -348
- data/lib/ronin/support/network/tls/proxy.rb +1 -1
- data/lib/ronin/support/network/tls.rb +492 -6
- data/lib/ronin/support/network/udp/mixin.rb +1 -1
- data/lib/ronin/support/network/udp/proxy.rb +1 -1
- data/lib/ronin/support/network/udp.rb +1 -1
- data/lib/ronin/support/network/unix/mixin.rb +1 -1
- data/lib/ronin/support/network/wildcard.rb +88 -0
- data/lib/ronin/support/network.rb +1 -1
- data/lib/ronin/support/path.rb +1 -1
- data/lib/ronin/support/text/core_ext/regexp.rb +1 -1
- data/lib/ronin/support/text/core_ext/string.rb +1 -1
- data/lib/ronin/support/text/core_ext.rb +1 -1
- data/lib/ronin/support/text/entropy/core_ext/string.rb +1 -1
- data/lib/ronin/support/text/entropy/core_ext.rb +1 -1
- data/lib/ronin/support/text/entropy.rb +1 -1
- data/lib/ronin/support/text/erb/mixin.rb +1 -1
- data/lib/ronin/support/text/erb.rb +1 -1
- data/lib/ronin/support/text/homoglyph/core_ext/string.rb +1 -1
- data/lib/ronin/support/text/homoglyph/core_ext.rb +1 -1
- data/lib/ronin/support/text/homoglyph/exceptions.rb +1 -1
- data/lib/ronin/support/text/homoglyph/table.rb +1 -1
- data/lib/ronin/support/text/homoglyph.rb +1 -1
- data/lib/ronin/support/text/mixin.rb +1 -1
- data/lib/ronin/support/text/patterns/credentials.rb +1 -1
- data/lib/ronin/support/text/patterns/crypto.rb +1 -1
- data/lib/ronin/support/text/patterns/file_system.rb +1 -1
- data/lib/ronin/support/text/patterns/language.rb +1 -1
- data/lib/ronin/support/text/patterns/network/public_suffix.rb +1 -1
- data/lib/ronin/support/text/patterns/network.rb +1 -1
- data/lib/ronin/support/text/patterns/numeric.rb +1 -1
- data/lib/ronin/support/text/patterns/pii.rb +1 -1
- data/lib/ronin/support/text/patterns/source_code.rb +1 -1
- data/lib/ronin/support/text/patterns.rb +1 -1
- data/lib/ronin/support/text/random/mixin.rb +1 -1
- data/lib/ronin/support/text/random.rb +1 -1
- data/lib/ronin/support/text/typo/core_ext/string.rb +1 -1
- data/lib/ronin/support/text/typo/core_ext.rb +1 -1
- data/lib/ronin/support/text/typo/exceptions.rb +1 -1
- data/lib/ronin/support/text/typo/generator.rb +1 -1
- data/lib/ronin/support/text/typo.rb +1 -1
- data/lib/ronin/support/text.rb +1 -1
- data/lib/ronin/support/version.rb +2 -2
- data/lib/ronin/support.rb +1 -1
- metadata +13 -2
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
#
|
3
|
-
# Copyright (c) 2006-
|
3
|
+
# Copyright (c) 2006-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
|
4
4
|
#
|
5
5
|
# Ronin Support is free software: you can redistribute it and/or modify
|
6
6
|
# it under the terms of the GNU Lesser General Public License as published
|
@@ -16,6 +16,7 @@
|
|
16
16
|
# along with Ronin Support. If not, see <http://www.gnu.org/licenses/>.
|
17
17
|
#
|
18
18
|
|
19
|
+
require 'ronin/support/network/tls'
|
19
20
|
require 'ronin/support/network/ssl/mixin'
|
20
21
|
|
21
22
|
module Ronin
|
@@ -29,45 +30,56 @@ module Ronin
|
|
29
30
|
include SSL::Mixin
|
30
31
|
|
31
32
|
#
|
32
|
-
#
|
33
|
+
# @!macro context_kwargs
|
34
|
+
# @option kwargs [1, 1.1, 1.2, 1.3, Symbol, nil] :version
|
35
|
+
# The TLS version to use.
|
33
36
|
#
|
34
|
-
#
|
35
|
-
#
|
37
|
+
# @option kwargs [1, 1.1, 1.2, 1.3, Symbol, nil] :min_version
|
38
|
+
# The minimum TLS version to use.
|
36
39
|
#
|
37
|
-
#
|
38
|
-
#
|
40
|
+
# @option kwargs [1, 1.1, 1.2, 1.3, Symbol, nil] :max_version
|
41
|
+
# The maximum TLS version to use.
|
42
|
+
#
|
43
|
+
# @option kwargs [Symbol, Boolean] :verify
|
44
|
+
# Specifies whether to verify the SSL certificate.
|
45
|
+
# May be one of the following:
|
39
46
|
#
|
40
|
-
#
|
41
|
-
#
|
42
|
-
#
|
47
|
+
# * `:none`
|
48
|
+
# * `:peer`
|
49
|
+
# * `:fail_if_no_peer_cert`
|
50
|
+
# * `:client_once`
|
43
51
|
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
# * `:fail_if_no_peer_cert`
|
47
|
-
# * `:client_once`
|
52
|
+
# @option kwargs [Crypto::Key::RSA, OpenSSL::PKey::RSA, nil] :key
|
53
|
+
# The RSA key to use for the TLS context.
|
48
54
|
#
|
49
|
-
#
|
50
|
-
#
|
55
|
+
# @option kwargs [String] :key_file
|
56
|
+
# The path to the TLS `.key` file.
|
51
57
|
#
|
52
|
-
#
|
53
|
-
#
|
58
|
+
# @option kwargs [Crypto::Cert, OpenSSL::X509::Certificate, nil] :cert
|
59
|
+
# The X509 certificate to use for the TLS context.
|
54
60
|
#
|
55
|
-
#
|
56
|
-
#
|
61
|
+
# @option kwargs [String] :cert_file
|
62
|
+
# The path to the TLS `.crt` file.
|
57
63
|
#
|
58
|
-
#
|
59
|
-
#
|
64
|
+
# @option kwargs [String] :ca_bundle
|
65
|
+
# Path to the CA certificate file or directory.
|
66
|
+
#
|
67
|
+
|
68
|
+
#
|
69
|
+
# Creates a new TLS Context.
|
70
|
+
#
|
71
|
+
# @param [Hash{Symbol => Object}] kwargs
|
72
|
+
# Additional keyword arguments for {TLS.context}.
|
60
73
|
#
|
61
|
-
#
|
62
|
-
# Path to the CA certificate file or directory.
|
74
|
+
# @!macro context_kwargs
|
63
75
|
#
|
64
76
|
# @return [OpenSSL::SSL::SSLContext]
|
65
77
|
# The newly created SSL Context.
|
66
78
|
#
|
67
79
|
# @api semipublic
|
68
80
|
#
|
69
|
-
def tls_context(
|
70
|
-
|
81
|
+
def tls_context(**kwargs)
|
82
|
+
TLS.context(**kwargs)
|
71
83
|
end
|
72
84
|
|
73
85
|
#
|
@@ -76,45 +88,31 @@ module Ronin
|
|
76
88
|
# @param [TCPSocket] socket
|
77
89
|
# The existing TCP socket.
|
78
90
|
#
|
79
|
-
# @param [1, 1.1, 1.2, String, Symbol, nil] version
|
80
|
-
# The TLS version to use.
|
81
|
-
#
|
82
91
|
# @param [Hash{Symbol => Object}] kwargs
|
83
|
-
# Additional keyword arguments for {
|
84
|
-
#
|
85
|
-
# @option kwargs [Symbol, Boolean] :verify
|
86
|
-
# Specifies whether to verify the SSL certificate.
|
87
|
-
# May be one of the following:
|
88
|
-
#
|
89
|
-
# * `:none`
|
90
|
-
# * `:peer`
|
91
|
-
# * `:fail_if_no_peer_cert`
|
92
|
-
# * `:client_once`
|
93
|
-
#
|
94
|
-
# @option kwargs [Crypto::Key::RSA, OpenSSL::PKey::RSA, nil] :key
|
95
|
-
# The RSA key to use for the SSL context.
|
96
|
-
#
|
97
|
-
# @option kwargs [String] :key_file
|
98
|
-
# The path to the SSL `.key` file.
|
92
|
+
# Additional keyword arguments for {TLS.socket}.
|
99
93
|
#
|
100
|
-
#
|
101
|
-
# The X509 certificate to use for the SSL context.
|
102
|
-
#
|
103
|
-
# @option kwargs [String] :cert_file
|
104
|
-
# The path to the SSL `.crt` file.
|
105
|
-
#
|
106
|
-
# @option kwargs [String] :ca_bundle
|
107
|
-
# Path to the CA certificate file or directory.
|
94
|
+
# @!macro context_kwargs
|
108
95
|
#
|
109
96
|
# @return [OpenSSL::SSL::SSLSocket]
|
110
97
|
# The new SSL Socket.
|
111
98
|
#
|
112
99
|
# @api public
|
113
100
|
#
|
114
|
-
def tls_socket(socket
|
115
|
-
|
101
|
+
def tls_socket(socket,**kwargs)
|
102
|
+
TLS.socket(socket,**kwargs)
|
116
103
|
end
|
117
104
|
|
105
|
+
#
|
106
|
+
# @!macro connect_kwargs
|
107
|
+
# @option kwargs [String] :bind_host
|
108
|
+
# The local host to bind to.
|
109
|
+
#
|
110
|
+
# @option kwargs [Integer] :bind_port
|
111
|
+
# The local port to bind to.
|
112
|
+
#
|
113
|
+
# @!macro context_kwargs
|
114
|
+
#
|
115
|
+
|
118
116
|
#
|
119
117
|
# Tests whether a remote SSLed TCP port is open.
|
120
118
|
#
|
@@ -124,44 +122,10 @@ module Ronin
|
|
124
122
|
# @param [Integer] port
|
125
123
|
# The port to connect to.
|
126
124
|
#
|
127
|
-
# @param [1, 1.1, 1.2, String, Symbol, nil] version
|
128
|
-
# The TLS version to use.
|
129
|
-
#
|
130
125
|
# @param [Hash{Symbol => Object}] kwargs
|
131
|
-
# Additional keyword arguments for {#
|
132
|
-
#
|
133
|
-
# @option kwargs [String] :bind_host
|
134
|
-
# The local host to bind to.
|
135
|
-
#
|
136
|
-
# @option kwargs [Integer] :bind_port
|
137
|
-
# The local port to bind to.
|
138
|
-
#
|
139
|
-
# @option kwargs [Integer] :timeout (5)
|
140
|
-
# The maximum time to attempt connecting.
|
141
|
-
#
|
142
|
-
# @option options [Symbol, Boolean] :verify
|
143
|
-
# Specifies whether to verify the SSL certificate.
|
144
|
-
# May be one of the following:
|
145
|
-
#
|
146
|
-
# * `:none`
|
147
|
-
# * `:peer`
|
148
|
-
# * `:fail_if_no_peer_cert`
|
149
|
-
# * `:client_once`
|
150
|
-
#
|
151
|
-
# @option kwargs [Crypto::Key::RSA, OpenSSL::PKey::RSA, nil] :key
|
152
|
-
# The RSA key to use for the SSL context.
|
153
|
-
#
|
154
|
-
# @option kwargs [String] :key_file
|
155
|
-
# The path to the SSL `.key` file.
|
156
|
-
#
|
157
|
-
# @option kwargs [Crypto::Cert, OpenSSL::X509::Certificate, nil] :cert
|
158
|
-
# The X509 certificate to use for the SSL context.
|
159
|
-
#
|
160
|
-
# @option kwargs [String] :cert_file
|
161
|
-
# The path to the SSL `.crt` file.
|
126
|
+
# Additional keyword arguments for {#tls_connect}.
|
162
127
|
#
|
163
|
-
#
|
164
|
-
# Path to the CA certificate file or directory.
|
128
|
+
# @!macro connect_kwargs
|
165
129
|
#
|
166
130
|
# @return [Boolean, nil]
|
167
131
|
# Specifies whether the remote SSLed TCP port is open.
|
@@ -176,8 +140,10 @@ module Ronin
|
|
176
140
|
#
|
177
141
|
# @api public
|
178
142
|
#
|
179
|
-
|
180
|
-
|
143
|
+
# @see TLS.open?
|
144
|
+
#
|
145
|
+
def tls_open?(host,port,**kwargs)
|
146
|
+
TLS.open?(host,port,**kwargs)
|
181
147
|
end
|
182
148
|
|
183
149
|
#
|
@@ -189,41 +155,10 @@ module Ronin
|
|
189
155
|
# @param [Integer] port
|
190
156
|
# The port to connect to.
|
191
157
|
#
|
192
|
-
# @param [1, 1.1, 1.2, String, Symbol, nil] version
|
193
|
-
# The TLS version to use.
|
194
|
-
#
|
195
158
|
# @param [Hash{Symbol => Object}] kwargs
|
196
159
|
# Additional keyword arguments for {#tls_socket}.
|
197
160
|
#
|
198
|
-
#
|
199
|
-
# The local host to bind to.
|
200
|
-
#
|
201
|
-
# @option kwargs [Integer] :bind_port
|
202
|
-
# The local port to bind to.
|
203
|
-
#
|
204
|
-
# @option kwargs [Symbol, Boolean] :verify
|
205
|
-
# Specifies whether to verify the SSL certificate.
|
206
|
-
# May be one of the following:
|
207
|
-
#
|
208
|
-
# * `:none`
|
209
|
-
# * `:peer`
|
210
|
-
# * `:fail_if_no_peer_cert`
|
211
|
-
# * `:client_once`
|
212
|
-
#
|
213
|
-
# @option kwargs [Crypto::Key::RSA, OpenSSL::PKey::RSA, nil] :key
|
214
|
-
# The RSA key to use for the SSL context.
|
215
|
-
#
|
216
|
-
# @option kwargs [String] :key_file
|
217
|
-
# The path to the SSL `.key` file.
|
218
|
-
#
|
219
|
-
# @option kwargs [Crypto::Cert, OpenSSL::X509::Certificate, nil] :cert
|
220
|
-
# The X509 certificate to use for the SSL context.
|
221
|
-
#
|
222
|
-
# @option kwargs [String] :cert_file
|
223
|
-
# The path to the SSL `.crt` file.
|
224
|
-
#
|
225
|
-
# @option kwargs [String] :ca_bundle
|
226
|
-
# Path to the CA certificate file or directory.
|
161
|
+
# @!macro connect_kwargs
|
227
162
|
#
|
228
163
|
# @yield [tls_socket]
|
229
164
|
# The given block will be passed the new SSL socket. Once the block
|
@@ -250,8 +185,10 @@ module Ronin
|
|
250
185
|
#
|
251
186
|
# @api public
|
252
187
|
#
|
253
|
-
|
254
|
-
|
188
|
+
# @see TLS.connect
|
189
|
+
#
|
190
|
+
def tls_connect(host,port,**kwargs, &block)
|
191
|
+
TLS.connect(host,port,**kwargs, &block)
|
255
192
|
end
|
256
193
|
|
257
194
|
#
|
@@ -266,52 +203,23 @@ module Ronin
|
|
266
203
|
# @param [Integer] port
|
267
204
|
# The port to connect to.
|
268
205
|
#
|
269
|
-
# @param [1, 1.1, 1.2, String, Symbol, nil] version
|
270
|
-
# The TLS version to use.
|
271
|
-
#
|
272
206
|
# @param [Hash{Symbol => Object}] kwargs
|
273
207
|
# Additional keyword arguments for {#tls_connect}.
|
274
208
|
#
|
275
|
-
#
|
276
|
-
# The local host to bind to.
|
277
|
-
#
|
278
|
-
# @option kwargs [Integer] :bind_port
|
279
|
-
# The local port to bind to.
|
280
|
-
#
|
281
|
-
# @option kwargs [Symbol, Boolean] :verify
|
282
|
-
# Specifies whether to verify the SSL certificate.
|
283
|
-
# May be one of the following:
|
284
|
-
#
|
285
|
-
# * `:none`
|
286
|
-
# * `:peer`
|
287
|
-
# * `:fail_if_no_peer_cert`
|
288
|
-
# * `:client_once`
|
209
|
+
# @!macro connect_kwargs
|
289
210
|
#
|
290
211
|
# @yield [tls_socket]
|
291
|
-
# The given block will be passed the newly created
|
292
|
-
#
|
293
|
-
# @option kwargs [Crypto::Key::RSA, OpenSSL::PKey::RSA, nil] :key
|
294
|
-
# The RSA key to use for the SSL context.
|
295
|
-
#
|
296
|
-
# @option kwargs [String] :key_file
|
297
|
-
# The path to the SSL `.key` file.
|
298
|
-
#
|
299
|
-
# @option kwargs [Crypto::Cert, OpenSSL::X509::Certificate, nil] :cert
|
300
|
-
# The X509 certificate to use for the SSL context.
|
301
|
-
#
|
302
|
-
# @option kwargs [String] :cert_file
|
303
|
-
# The path to the SSL `.crt` file.
|
304
|
-
#
|
305
|
-
# @option kwargs [String] :ca_bundle
|
306
|
-
# Path to the CA certificate file or directory.
|
212
|
+
# The given block will be passed the newly created TLS Socket.
|
307
213
|
#
|
308
214
|
# @yieldparam [OpenSSL::SSL::SSLSocket] tls_socket
|
309
215
|
# The newly created SSL Socket.
|
310
216
|
#
|
311
217
|
# @api public
|
312
218
|
#
|
313
|
-
|
314
|
-
|
219
|
+
# @see TLS.connect_and_send
|
220
|
+
#
|
221
|
+
def tls_connect_and_send(data,host,port,**kwargs, &block)
|
222
|
+
TLS.connect_and_send(data,host,port,**kwargs, &block)
|
315
223
|
end
|
316
224
|
|
317
225
|
#
|
@@ -323,50 +231,18 @@ module Ronin
|
|
323
231
|
# @param [Integer] port
|
324
232
|
# The port to connect to.
|
325
233
|
#
|
326
|
-
# @param [1, 1.1, 1.2, String, Symbol, nil] version
|
327
|
-
# The TLS version to use.
|
328
|
-
#
|
329
234
|
# @param [Hash{Symbol => Object}] kwargs
|
330
235
|
# Additional keyword arguments for {#tls_connect}.
|
331
236
|
#
|
332
|
-
#
|
333
|
-
# The local host to bind to.
|
334
|
-
#
|
335
|
-
# @option kwargs [Integer] :bind_port
|
336
|
-
# The local port to bind to.
|
337
|
-
#
|
338
|
-
# @option kwargs [Symbol, Boolean] :verify
|
339
|
-
# Specifies whether to verify the SSL certificate.
|
340
|
-
# May be one of the following:
|
341
|
-
#
|
342
|
-
# * `:none`
|
343
|
-
# * `:peer`
|
344
|
-
# * `:fail_if_no_peer_cert`
|
345
|
-
# * `:client_once`
|
346
|
-
#
|
347
|
-
# @yield [tls_socket]
|
348
|
-
# The given block will be passed the newly created SSL Socket.
|
349
|
-
#
|
350
|
-
# @option kwargs [Crypto::Key::RSA, OpenSSL::PKey::RSA, nil] :key
|
351
|
-
# The RSA key to use for the SSL context.
|
352
|
-
#
|
353
|
-
# @option kwargs [String] :key_file
|
354
|
-
# The path to the SSL `.key` file.
|
355
|
-
#
|
356
|
-
# @option kwargs [Crypto::Cert, OpenSSL::X509::Certificate, nil] :cert
|
357
|
-
# The X509 certificate to use for the SSL context.
|
358
|
-
#
|
359
|
-
# @option kwargs [String] :cert_file
|
360
|
-
# The path to the SSL `.crt` file.
|
361
|
-
#
|
362
|
-
# @option kwargs [String] :ca_bundle
|
363
|
-
# Path to the CA certificate file or directory.
|
237
|
+
# @!macro connect_kwargs
|
364
238
|
#
|
365
239
|
# @return [OpenSSL::X509::Certificate]
|
366
240
|
# The server's certificate.
|
367
241
|
#
|
368
|
-
|
369
|
-
|
242
|
+
# @see TLS.get_cert
|
243
|
+
#
|
244
|
+
def tls_cert(host,port,**kwargs)
|
245
|
+
TLS.get_cert(host,port,**kwargs)
|
370
246
|
end
|
371
247
|
|
372
248
|
#
|
@@ -379,41 +255,10 @@ module Ronin
|
|
379
255
|
# @param [Integer] port
|
380
256
|
# The port to connect to.
|
381
257
|
#
|
382
|
-
# @param [1, 1.1, 1.2, String, Symbol, nil] version
|
383
|
-
# The TLS version to use.
|
384
|
-
#
|
385
258
|
# @param [Hash{Symbol => Object}] kwargs
|
386
259
|
# Additional keyword arguments for {#tls_connect}.
|
387
260
|
#
|
388
|
-
#
|
389
|
-
# The local host to bind to.
|
390
|
-
#
|
391
|
-
# @option kwargs [Integer] :bind_port
|
392
|
-
# The local port to bind to.
|
393
|
-
#
|
394
|
-
# @option kwargs [Symbol, Boolean] :verify
|
395
|
-
# Specifies whether to verify the SSL certificate.
|
396
|
-
# May be one of the following:
|
397
|
-
#
|
398
|
-
# * `:none`
|
399
|
-
# * `:peer`
|
400
|
-
# * `:fail_if_no_peer_cert`
|
401
|
-
# * `:client_once`
|
402
|
-
#
|
403
|
-
# @option kwargs [Crypto::Key::RSA, OpenSSL::PKey::RSA, nil] :key
|
404
|
-
# The RSA key to use for the SSL context.
|
405
|
-
#
|
406
|
-
# @option kwargs [String] :key_file
|
407
|
-
# The path to the SSL `.key` file.
|
408
|
-
#
|
409
|
-
# @option kwargs [Crypto::Cert, OpenSSL::X509::Certificate, nil] :cert
|
410
|
-
# The X509 certificate to use for the SSL context.
|
411
|
-
#
|
412
|
-
# @option kwargs [String] :cert_file
|
413
|
-
# The path to the SSL `.crt` file.
|
414
|
-
#
|
415
|
-
# @option kwargs [String] :ca_bundle
|
416
|
-
# Path to the CA certificate file or directory.
|
261
|
+
# @!macro connect_kwargs
|
417
262
|
#
|
418
263
|
# @yield [banner]
|
419
264
|
# If a block is given, it will be passed the grabbed banner.
|
@@ -430,8 +275,10 @@ module Ronin
|
|
430
275
|
#
|
431
276
|
# @api public
|
432
277
|
#
|
433
|
-
|
434
|
-
|
278
|
+
# @see TLS.banner
|
279
|
+
#
|
280
|
+
def tls_banner(host,port,**kwargs, &block)
|
281
|
+
TLS.banner(host,port,**kwargs, &block)
|
435
282
|
end
|
436
283
|
|
437
284
|
#
|
@@ -447,41 +294,10 @@ module Ronin
|
|
447
294
|
# @param [Integer] port
|
448
295
|
# The port to connect to.
|
449
296
|
#
|
450
|
-
# @param [1, 1.1, 1.2, String, Symbol, nil] version
|
451
|
-
# The TLS version to use.
|
452
|
-
#
|
453
297
|
# @param [Hash{Symbol => Object}] kwargs
|
454
298
|
# Additional keyword arguments for {#tls_connect}.
|
455
299
|
#
|
456
|
-
#
|
457
|
-
# The local host to bind to.
|
458
|
-
#
|
459
|
-
# @option kwargs [Integer] :bind_port
|
460
|
-
# The local port to bind to.
|
461
|
-
#
|
462
|
-
# @option kwargs [Symbol, Boolean] :verify
|
463
|
-
# Specifies whether to verify the SSL certificate.
|
464
|
-
# May be one of the following:
|
465
|
-
#
|
466
|
-
# * `:none`
|
467
|
-
# * `:peer`
|
468
|
-
# * `:fail_if_no_peer_cert`
|
469
|
-
# * `:client_once`
|
470
|
-
#
|
471
|
-
# @option kwargs [Crypto::Key::RSA, OpenSSL::PKey::RSA, nil] :key
|
472
|
-
# The RSA key to use for the SSL context.
|
473
|
-
#
|
474
|
-
# @option kwargs [String] :key_file
|
475
|
-
# The path to the SSL `.key` file.
|
476
|
-
#
|
477
|
-
# @option kwargs [Crypto::Cert, OpenSSL::X509::Certificate, nil] :cert
|
478
|
-
# The X509 certificate to use for the SSL context.
|
479
|
-
#
|
480
|
-
# @option kwargs [String] :cert_file
|
481
|
-
# The path to the SSL `.crt` file.
|
482
|
-
#
|
483
|
-
# @option kwargs [String] :ca_bundle
|
484
|
-
# Path to the CA certificate file or directory.
|
300
|
+
# @!macro connect_kwargs
|
485
301
|
#
|
486
302
|
# @return [true]
|
487
303
|
# The data was successfully sent.
|
@@ -493,82 +309,119 @@ module Ronin
|
|
493
309
|
#
|
494
310
|
# @api public
|
495
311
|
#
|
496
|
-
|
497
|
-
|
312
|
+
# @see TLS.send
|
313
|
+
#
|
314
|
+
def tls_send(data,host,port,**kwargs)
|
315
|
+
TLS.send(data,host,port,**kwargs)
|
498
316
|
end
|
499
317
|
|
318
|
+
#
|
319
|
+
# @!macro server_context_kwargs
|
320
|
+
# @option kwargs [Crypto::Key::RSA, OpenSSL::PKey::RSA, nil] :key (SSL.key)
|
321
|
+
# The RSA key to use for the TLS context.
|
322
|
+
#
|
323
|
+
# @option kwargs [Crypto::Cert, OpenSSL::X509::Certificate, nil] :cert (SSL.cert)
|
324
|
+
# The X509 certificate to use for the TLS context.
|
325
|
+
#
|
326
|
+
# @!macro context_kwargs
|
327
|
+
#
|
328
|
+
|
500
329
|
#
|
501
330
|
# Accepts an SSL session from an existing TCP socket.
|
502
331
|
#
|
503
332
|
# @param [TCPSocket] socket
|
504
333
|
# The existing TCP socket.
|
505
334
|
#
|
506
|
-
# @param [1, 1.1, 1.2, String, Symbol, nil] version
|
507
|
-
# The TLS version to use.
|
508
|
-
#
|
509
335
|
# @param [Hash{Symbol => Object}] kwargs
|
510
336
|
# Additional keyword arguments for {#tls_socket}.
|
511
337
|
#
|
512
|
-
#
|
513
|
-
# Specifies whether to verify the SSL certificate.
|
514
|
-
# May be one of the following:
|
515
|
-
#
|
516
|
-
# * `:none`
|
517
|
-
# * `:peer`
|
518
|
-
# * `:fail_if_no_peer_cert`
|
519
|
-
# * `:client_once`
|
338
|
+
# @!macro server_context_kwargs
|
520
339
|
#
|
521
340
|
# @return [OpenSSL::SSL::SSLSocket]
|
522
341
|
# The new SSL Socket.
|
523
342
|
#
|
524
343
|
# @api public
|
525
344
|
#
|
526
|
-
|
527
|
-
|
345
|
+
# @see TLS.server_socket
|
346
|
+
#
|
347
|
+
def tls_server_socket(socket,**kwargs)
|
348
|
+
TLS.server_socket(socket,**kwargs)
|
528
349
|
end
|
529
350
|
|
530
351
|
#
|
531
|
-
#
|
532
|
-
#
|
352
|
+
# @!macro server_kwargs
|
353
|
+
# @option kwargs [Integer] :port (0)
|
354
|
+
# The local port to listen on.
|
355
|
+
#
|
356
|
+
# @option kwargs [String, nil] :host
|
357
|
+
# The host to bind to.
|
358
|
+
#
|
359
|
+
# @option kwargs [Integer] :backlog (5)
|
360
|
+
# The maximum backlog of pending connections.
|
361
|
+
#
|
362
|
+
# @!macro server_context_kwargs
|
533
363
|
#
|
534
|
-
|
535
|
-
#
|
364
|
+
|
365
|
+
#
|
366
|
+
# Creates a new TLS server listening on a given host and port.
|
536
367
|
#
|
537
368
|
# @param [Hash{Symbol => Object}] kwargs
|
538
|
-
# Additional keyword arguments for {#
|
369
|
+
# Additional keyword arguments for {#tls_context}.
|
539
370
|
#
|
540
|
-
#
|
541
|
-
# The local port to listen on.
|
371
|
+
# @!macro server_kwargs
|
542
372
|
#
|
543
|
-
# @
|
544
|
-
# The
|
373
|
+
# @yield [server]
|
374
|
+
# The given block will be passed the newly created SSL server.
|
545
375
|
#
|
546
|
-
# @
|
547
|
-
# The
|
376
|
+
# @yieldparam [OpenSSL::SSL::SSLServer] server
|
377
|
+
# The newly created SSL server.
|
548
378
|
#
|
549
|
-
# @
|
550
|
-
#
|
551
|
-
# May be one of the following:
|
379
|
+
# @return [OpenSSL::SSL::SSLServer]
|
380
|
+
# The newly created SSL server.
|
552
381
|
#
|
553
|
-
#
|
554
|
-
# * `:peer`
|
555
|
-
# * `:fail_if_no_peer_cert`
|
556
|
-
# * `:client_once`
|
382
|
+
# @api public
|
557
383
|
#
|
558
|
-
# @
|
559
|
-
# The RSA key to use for the SSL context.
|
384
|
+
# @since 1.1.0
|
560
385
|
#
|
561
|
-
|
562
|
-
|
386
|
+
def tls_server(**kwargs, &block)
|
387
|
+
TLS.server(**kwargs, &block)
|
388
|
+
end
|
389
|
+
|
390
|
+
#
|
391
|
+
# Creates a new temporary TLS server listening on a given host and
|
392
|
+
# port.
|
563
393
|
#
|
564
|
-
# @
|
565
|
-
#
|
394
|
+
# @param [Hash{Symbol => Object}] kwargs
|
395
|
+
# Additional keyword arguments for {#tls_context}.
|
566
396
|
#
|
567
|
-
#
|
568
|
-
# The path to the SSL `.crt` file.
|
397
|
+
# @!macro server_kwargs
|
569
398
|
#
|
570
|
-
# @
|
571
|
-
#
|
399
|
+
# @yield [server]
|
400
|
+
# The given block will be passed the newly created SSL server.
|
401
|
+
#
|
402
|
+
# @yieldparam [OpenSSL::SSL::SSLServer] server
|
403
|
+
# The newly created SSL server. Once the block has finished,
|
404
|
+
# the server will be closed.
|
405
|
+
#
|
406
|
+
# @return [OpenSSL::SSL::SSLServer]
|
407
|
+
# The newly created SSL server.
|
408
|
+
#
|
409
|
+
# @api public
|
410
|
+
#
|
411
|
+
# @since 1.1.0
|
412
|
+
#
|
413
|
+
def tls_server_session(**kwargs, &block)
|
414
|
+
TLS.server_session(**kwargs, &block)
|
415
|
+
end
|
416
|
+
|
417
|
+
#
|
418
|
+
# Creates a new SSL socket listening on a given host and port,
|
419
|
+
# accepting clients in a loop.
|
420
|
+
#
|
421
|
+
# @param [Hash{Symbol => Object}] kwargs
|
422
|
+
# Additional keyword arguments for {#tls_server_socket}.
|
423
|
+
#
|
424
|
+
# @!macro server_kwargs
|
572
425
|
#
|
573
426
|
# @yield [client]
|
574
427
|
# The given block will be passed the newly connected client.
|
@@ -590,54 +443,20 @@ module Ronin
|
|
590
443
|
#
|
591
444
|
# @api public
|
592
445
|
#
|
593
|
-
|
594
|
-
|
446
|
+
# @see TLS.server_loop
|
447
|
+
#
|
448
|
+
def tls_server_loop(**kwargs,&block)
|
449
|
+
TLS.server_loop(**kwargs,&block)
|
595
450
|
end
|
596
451
|
|
597
452
|
#
|
598
453
|
# Creates a new SSL socket listening on a given host and port,
|
599
454
|
# accepts only one client and then stops listening.
|
600
455
|
#
|
601
|
-
# @param [1, 1.1, 1.2, String, Symbol, nil] version
|
602
|
-
# The TLS version to use.
|
603
|
-
#
|
604
456
|
# @param [Hash{Symbol => Object}] kwargs
|
605
457
|
# Additional keyword arguments for {#tls_server_socket}.
|
606
458
|
#
|
607
|
-
#
|
608
|
-
# The local port to listen on.
|
609
|
-
#
|
610
|
-
# @option kwargs [String] :host
|
611
|
-
# The host to bind to.
|
612
|
-
#
|
613
|
-
# @option kwargs [Symbol, Boolean] :verify
|
614
|
-
# Specifies whether to verify the SSL certificate.
|
615
|
-
# May be one of the following:
|
616
|
-
#
|
617
|
-
# * `:none`
|
618
|
-
# * `:peer`
|
619
|
-
# * `:fail_if_no_peer_cert`
|
620
|
-
# * `:client_once`
|
621
|
-
#
|
622
|
-
# @option kwargs [Crypto::Key::RSA, OpenSSL::PKey::RSA, nil] :key (Network::SSL.key)
|
623
|
-
# The RSA key to use for the SSL context.
|
624
|
-
#
|
625
|
-
# @option kwargs [String] :key_file
|
626
|
-
# The path to the SSL `.key` file.
|
627
|
-
#
|
628
|
-
# @option kwargs [Crypto::Cert, OpenSSL::X509::Certificate, nil] :cert (Network::SSL.cert)
|
629
|
-
# The X509 certificate to use for the SSL context.
|
630
|
-
#
|
631
|
-
# @option kwargs [String] :cert_file
|
632
|
-
# The path to the SSL `.crt` file.
|
633
|
-
#
|
634
|
-
# @option kwargs [String] :ca_bundle
|
635
|
-
# Path to the CA certificate file or directory.
|
636
|
-
#
|
637
|
-
# @example
|
638
|
-
# tls_accept(1337) do |client|
|
639
|
-
# client.puts 'lol'
|
640
|
-
# end
|
459
|
+
# @!macro server_kwargs
|
641
460
|
#
|
642
461
|
# @yield [client]
|
643
462
|
# The given block will be passed the newly connected client.
|
@@ -650,6 +469,11 @@ module Ronin
|
|
650
469
|
# @return [nil]
|
651
470
|
#
|
652
471
|
# @example
|
472
|
+
# tls_accept(1337) do |client|
|
473
|
+
# client.puts 'lol'
|
474
|
+
# end
|
475
|
+
#
|
476
|
+
# @example Using a self-signed certificate:
|
653
477
|
# # $ openssl genrsa -out ssl.key 1024
|
654
478
|
# # $ openssl req -new -key ssl.key -x509 -days 3653 -out ssl.crt
|
655
479
|
# # $ cat ssl.key ssl.crt > ssl.pem
|
@@ -660,8 +484,10 @@ module Ronin
|
|
660
484
|
#
|
661
485
|
# @api public
|
662
486
|
#
|
663
|
-
|
664
|
-
|
487
|
+
# @see TLS.accept
|
488
|
+
#
|
489
|
+
def tls_accept(**kwargs, &block)
|
490
|
+
TLS.accept(**kwargs, &block)
|
665
491
|
end
|
666
492
|
end
|
667
493
|
end
|