ronin-support 1.0.5 → 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 +36 -0
- data/ChangeLog.md +125 -1
- 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 +3 -3
- 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 +143 -8
- 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 +127 -16
- data/lib/ronin/support/network/ip_range/glob.rb +175 -32
- data/lib/ronin/support/network/ip_range/range.rb +37 -22
- data/lib/ronin/support/network/ip_range.rb +147 -23
- 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 +6 -3
- 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 +6 -3
- 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 +6 -3
- 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 +6 -3
- 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 +14 -3
@@ -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
|
@@ -41,23 +41,23 @@ module Ronin
|
|
41
41
|
# Enumerating over a IP-glob range:
|
42
42
|
#
|
43
43
|
# IPRange.each('10.0.1-3.*') { |ip| puts ip }
|
44
|
+
# # 10.0.1.0
|
44
45
|
# # 10.0.1.1
|
45
|
-
# # 10.0.1.2
|
46
46
|
# # ...
|
47
|
-
# # 10.0.1.253
|
48
47
|
# # 10.0.1.254
|
48
|
+
# # 10.0.1.255
|
49
49
|
# # ...
|
50
|
+
# # 10.0.2.0
|
50
51
|
# # 10.0.2.1
|
51
|
-
# # 10.0.2.2
|
52
52
|
# # ...
|
53
|
-
# # 10.0.2.253
|
54
53
|
# # 10.0.2.254
|
54
|
+
# # 10.0.2.255
|
55
55
|
# # ...
|
56
|
+
# # 10.0.3.0
|
56
57
|
# # 10.0.3.1
|
57
|
-
# # 10.0.3.2
|
58
58
|
# # ...
|
59
|
-
# # 10.0.3.253
|
60
59
|
# # 10.0.3.254
|
60
|
+
# # 10.0.3.255
|
61
61
|
#
|
62
62
|
# @api public
|
63
63
|
#
|
@@ -65,6 +65,22 @@ module Ronin
|
|
65
65
|
#
|
66
66
|
class IPRange
|
67
67
|
|
68
|
+
# Regular expression to match CIDR ranges or IP-glob ranges.
|
69
|
+
#
|
70
|
+
# @api private
|
71
|
+
#
|
72
|
+
# @since 1.1.0
|
73
|
+
REGEX = /#{CIDR::REGEX}|#{Glob::REGEX}/
|
74
|
+
|
75
|
+
# The parsed IP range.
|
76
|
+
#
|
77
|
+
# @return [CIDR, Glob]
|
78
|
+
#
|
79
|
+
# @api private
|
80
|
+
#
|
81
|
+
# @since 1.1.0
|
82
|
+
attr_reader :range
|
83
|
+
|
68
84
|
#
|
69
85
|
# Initializes the IP range.
|
70
86
|
#
|
@@ -77,9 +93,15 @@ module Ronin
|
|
77
93
|
# @example Initializing an IP-glob range:
|
78
94
|
# ip_range = IPRange.new('10.0.1-3.*')
|
79
95
|
#
|
96
|
+
# @raise [ArgumentError]
|
97
|
+
# The IP range was neither a CIDR range or a IP-glob range.
|
98
|
+
#
|
80
99
|
def initialize(string)
|
81
|
-
@range =
|
82
|
-
|
100
|
+
@range = case string
|
101
|
+
when CIDR::REGEX then CIDR.new(string)
|
102
|
+
when Glob::REGEX then Glob.new(string)
|
103
|
+
else
|
104
|
+
raise(ArgumentError,"invalid IP range: #{string.inspect}")
|
83
105
|
end
|
84
106
|
end
|
85
107
|
|
@@ -126,23 +148,23 @@ module Ronin
|
|
126
148
|
#
|
127
149
|
# @example Enumerating over a IP-glob range:
|
128
150
|
# IPRange.each('10.0.1-3.*') { |ip| puts ip }
|
151
|
+
# # 10.0.1.0
|
129
152
|
# # 10.0.1.1
|
130
|
-
# # 10.0.1.2
|
131
153
|
# # ...
|
132
|
-
# # 10.0.1.253
|
133
154
|
# # 10.0.1.254
|
155
|
+
# # 10.0.1.255
|
134
156
|
# # ...
|
157
|
+
# # 10.0.2.0
|
135
158
|
# # 10.0.2.1
|
136
|
-
# # 10.0.2.2
|
137
159
|
# # ...
|
138
|
-
# # 10.0.2.253
|
139
160
|
# # 10.0.2.254
|
161
|
+
# # 10.0.2.255
|
140
162
|
# # ...
|
163
|
+
# # 10.0.3.0
|
141
164
|
# # 10.0.3.1
|
142
|
-
# # 10.0.3.2
|
143
165
|
# # ...
|
144
|
-
# # 10.0.3.253
|
145
166
|
# # 10.0.3.254
|
167
|
+
# # 10.0.3.255
|
146
168
|
#
|
147
169
|
# @see #each
|
148
170
|
#
|
@@ -160,7 +182,7 @@ module Ronin
|
|
160
182
|
# Indicates that the IP range is a CIDR range.
|
161
183
|
#
|
162
184
|
def self.cidr?(string)
|
163
|
-
|
185
|
+
string =~ CIDR::REGEX
|
164
186
|
end
|
165
187
|
|
166
188
|
#
|
@@ -173,7 +195,7 @@ module Ronin
|
|
173
195
|
# Indicates that the IP range is a IP-glob range.
|
174
196
|
#
|
175
197
|
def self.glob?(string)
|
176
|
-
string
|
198
|
+
string =~ Glob::REGEX
|
177
199
|
end
|
178
200
|
|
179
201
|
#
|
@@ -181,6 +203,9 @@ module Ronin
|
|
181
203
|
#
|
182
204
|
# @return [String]
|
183
205
|
#
|
206
|
+
# @see CIDR#string
|
207
|
+
# @see Glob#string
|
208
|
+
#
|
184
209
|
def string
|
185
210
|
@range.string
|
186
211
|
end
|
@@ -190,6 +215,9 @@ module Ronin
|
|
190
215
|
#
|
191
216
|
# @return [Boolean]
|
192
217
|
#
|
218
|
+
# @see CIDR#ipv4?
|
219
|
+
# @see Glob#ipv4?
|
220
|
+
#
|
193
221
|
def ipv4?
|
194
222
|
@range.ipv4?
|
195
223
|
end
|
@@ -199,10 +227,64 @@ module Ronin
|
|
199
227
|
#
|
200
228
|
# @return [Boolean]
|
201
229
|
#
|
230
|
+
# @see CIDR#ipv6?
|
231
|
+
# @see Glob#ipv6?
|
232
|
+
#
|
202
233
|
def ipv6?
|
203
234
|
@range.ipv6?
|
204
235
|
end
|
205
236
|
|
237
|
+
#
|
238
|
+
# Determines whether the IP address exists within the IP range.
|
239
|
+
#
|
240
|
+
# @param [IP, IPAddr, String] ip
|
241
|
+
# The IP address to check.
|
242
|
+
#
|
243
|
+
# @return [Boolean]
|
244
|
+
# Indicates whether the IP address exists within the IP range.
|
245
|
+
#
|
246
|
+
# @since 1.1.0
|
247
|
+
#
|
248
|
+
def include?(ip)
|
249
|
+
@range.include?(ip)
|
250
|
+
end
|
251
|
+
|
252
|
+
#
|
253
|
+
# Compares the IP range to another IP range.
|
254
|
+
#
|
255
|
+
# @param [Object] other
|
256
|
+
# The other IP range.
|
257
|
+
#
|
258
|
+
# @return [Boolean]
|
259
|
+
#
|
260
|
+
# @since 1.1.0
|
261
|
+
#
|
262
|
+
def ==(other)
|
263
|
+
other.kind_of?(self.class) && @range == other.range
|
264
|
+
end
|
265
|
+
|
266
|
+
#
|
267
|
+
# Determines if the given IP range is a sub-set of the IP range.
|
268
|
+
#
|
269
|
+
# @param [IPRange, Enumerable<String>] other
|
270
|
+
# The other IP range.
|
271
|
+
#
|
272
|
+
# @return [Boolean]
|
273
|
+
#
|
274
|
+
# @see CIDR#===
|
275
|
+
# @see Glob#===
|
276
|
+
#
|
277
|
+
# @since 1.1.0
|
278
|
+
#
|
279
|
+
def ===(other)
|
280
|
+
case other
|
281
|
+
when IPRange
|
282
|
+
@range === other.range
|
283
|
+
else
|
284
|
+
@range === other
|
285
|
+
end
|
286
|
+
end
|
287
|
+
|
206
288
|
#
|
207
289
|
# Enumerates over each IP address that is included in the addresses
|
208
290
|
# netmask. Supports both IPv4 and IPv6 addresses.
|
@@ -230,23 +312,23 @@ module Ronin
|
|
230
312
|
# @example Enumerating over a IP-glob range:
|
231
313
|
# ip_range = IPRange.new('10.0.1-3.*')
|
232
314
|
# ip_range.each { |ip| puts ip }
|
315
|
+
# # 10.0.1.0
|
233
316
|
# # 10.0.1.1
|
234
|
-
# # 10.0.1.2
|
235
317
|
# # ...
|
236
|
-
# # 10.0.1.253
|
237
318
|
# # 10.0.1.254
|
319
|
+
# # 10.0.1.255
|
238
320
|
# # ...
|
321
|
+
# # 10.0.2.0
|
239
322
|
# # 10.0.2.1
|
240
|
-
# # 10.0.2.2
|
241
323
|
# # ...
|
242
|
-
# # 10.0.2.253
|
243
324
|
# # 10.0.2.254
|
325
|
+
# # 10.0.2.255
|
244
326
|
# # ...
|
327
|
+
# # 10.0.3.0
|
245
328
|
# # 10.0.3.1
|
246
|
-
# # 10.0.3.2
|
247
329
|
# # ...
|
248
|
-
# # 10.0.3.253
|
249
330
|
# # 10.0.3.254
|
331
|
+
# # 10.0.3.255
|
250
332
|
#
|
251
333
|
# @see CIDR#each
|
252
334
|
# @see Glob#each
|
@@ -255,6 +337,48 @@ module Ronin
|
|
255
337
|
@range.each(&block)
|
256
338
|
end
|
257
339
|
|
340
|
+
#
|
341
|
+
# The first IP address in the IP range.
|
342
|
+
#
|
343
|
+
# @return [String]
|
344
|
+
#
|
345
|
+
# @see CIDR#first
|
346
|
+
# @see Glob#last
|
347
|
+
#
|
348
|
+
# @since 1.1.0
|
349
|
+
#
|
350
|
+
def first
|
351
|
+
@range.first
|
352
|
+
end
|
353
|
+
|
354
|
+
#
|
355
|
+
# The last IP address in the IP range.
|
356
|
+
#
|
357
|
+
# @return [String]
|
358
|
+
#
|
359
|
+
# @see CIDR#first
|
360
|
+
# @see Glob#last
|
361
|
+
#
|
362
|
+
# @since 1.1.0
|
363
|
+
#
|
364
|
+
def last
|
365
|
+
@range.last
|
366
|
+
end
|
367
|
+
|
368
|
+
#
|
369
|
+
# Calculates the size of the IP range.
|
370
|
+
#
|
371
|
+
# @return [Integer]
|
372
|
+
#
|
373
|
+
# @see CIDR#size
|
374
|
+
# @see Glob#size
|
375
|
+
#
|
376
|
+
# @since 1.1.0
|
377
|
+
#
|
378
|
+
def size
|
379
|
+
@range.size
|
380
|
+
end
|
381
|
+
|
258
382
|
#
|
259
383
|
# Converts the IP range back to a String.
|
260
384
|
#
|
@@ -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
|
@@ -23,11 +23,6 @@ require 'ronin/support/network/udp/mixin'
|
|
23
23
|
require 'ronin/support/network/ssl/mixin'
|
24
24
|
require 'ronin/support/network/unix/mixin'
|
25
25
|
require 'ronin/support/network/http/mixin'
|
26
|
-
require 'ronin/support/network/ftp/mixin'
|
27
|
-
require 'ronin/support/network/smtp/mixin'
|
28
|
-
require 'ronin/support/network/esmtp/mixin'
|
29
|
-
require 'ronin/support/network/pop3/mixin'
|
30
|
-
require 'ronin/support/network/imap/mixin'
|
31
26
|
|
32
27
|
module Ronin
|
33
28
|
module Support
|
@@ -47,11 +42,6 @@ module Ronin
|
|
47
42
|
include SSL::Mixin
|
48
43
|
include UNIX::Mixin
|
49
44
|
include HTTP::Mixin
|
50
|
-
include FTP::Mixin
|
51
|
-
include SMTP::Mixin
|
52
|
-
include ESMTP::Mixin
|
53
|
-
include POP3::Mixin
|
54
|
-
include IMAP::Mixin
|
55
45
|
end
|
56
46
|
end
|
57
47
|
end
|
@@ -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
|
@@ -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
|
@@ -100,8 +100,11 @@ module Ronin
|
|
100
100
|
pop3.start(user,password)
|
101
101
|
|
102
102
|
if block_given?
|
103
|
-
|
104
|
-
|
103
|
+
begin
|
104
|
+
yield pop3
|
105
|
+
ensure
|
106
|
+
pop3.finish
|
107
|
+
end
|
105
108
|
else
|
106
109
|
return pop3
|
107
110
|
end
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -164,8 +164,11 @@ module Ronin
|
|
164
164
|
smtp.start(helo,user,password,auth)
|
165
165
|
|
166
166
|
if block_given?
|
167
|
-
|
168
|
-
|
167
|
+
begin
|
168
|
+
yield smtp
|
169
|
+
ensure
|
170
|
+
smtp.finish
|
171
|
+
end
|
169
172
|
else
|
170
173
|
return smtp
|
171
174
|
end
|
@@ -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
|
@@ -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
|
@@ -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
|