rex-socket 0.1.19 → 0.1.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +1 -0
- data.tar.gz.sig +3 -0
- data/lib/rex/socket/ssl.rb +13 -11
- data/lib/rex/socket/version.rb +1 -1
- metadata +84 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d324f9013128cde497a5e115e4c7573c6700add0
|
4
|
+
data.tar.gz: 9b45082ec8785468b0a5a36c6bf5eee8b8e50ca4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46cdc0c917347c6754763f072d9cd4ccee6121904cf591d153ba4ff860a1e7182a5906353bb8574ac0cee3b4668a36c7916900721a7c04e9dd7d5561487d9121
|
7
|
+
data.tar.gz: a9b518568244c4dc29f92fc2a273aa45c9cfdd8f17212693839e40406fe0e285d149661fb0a2bd0d18b6032a22e4bee25a17569dd4369f378a3972c3256b5acd
|
checksums.yaml.gz.sig
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
[搚�����mNb���*��D�����pz�ɘ��ua���� �0J�su��̾1�֨���'��5����)����\b <��Y�������[,�;)�3 �3�q��@ �h���2��C�|�*v;�����Q7b��:�&F��i�`��LL�Z��N�V�+K��
|
data.tar.gz.sig
ADDED
data/lib/rex/socket/ssl.rb
CHANGED
@@ -13,10 +13,12 @@ module Rex::Socket::Ssl
|
|
13
13
|
|
14
14
|
module CertProvider
|
15
15
|
|
16
|
-
def self.ssl_generate_subject(cn
|
17
|
-
st
|
18
|
-
loc
|
19
|
-
|
16
|
+
def self.ssl_generate_subject(cn: nil, org: nil, loc: nil, st: nil)
|
17
|
+
st ||= Rex::Text.rand_state
|
18
|
+
loc ||= Rex::Text.rand_name.capitalize
|
19
|
+
org ||= Rex::Text.rand_name.capitalize
|
20
|
+
cn ||= Rex::Text.rand_hostname
|
21
|
+
"/C=US/ST=#{st}/L=#{loc}/O=#{org}/CN=#{cn}"
|
20
22
|
end
|
21
23
|
|
22
24
|
def self.ssl_generate_issuer
|
@@ -30,11 +32,11 @@ module Rex::Socket::Ssl
|
|
30
32
|
# certificate. This matches a typical "snakeoil" cert.
|
31
33
|
#
|
32
34
|
# @return [String, String, Array]
|
33
|
-
def self.ssl_generate_certificate(
|
35
|
+
def self.ssl_generate_certificate(cert_vars: {}, **opts)
|
34
36
|
yr = 24*3600*365
|
35
37
|
vf = Time.at(Time.now.to_i - rand(yr * 3) - yr)
|
36
38
|
vt = Time.at(vf.to_i + (rand(9)+1) * yr)
|
37
|
-
subject = ssl_generate_subject(
|
39
|
+
subject = ssl_generate_subject(**cert_vars)
|
38
40
|
issuer = ssl_generate_issuer
|
39
41
|
key = OpenSSL::PKey::RSA.new(2048){ }
|
40
42
|
cert = OpenSSL::X509::Certificate.new
|
@@ -88,8 +90,8 @@ module Rex::Socket::Ssl
|
|
88
90
|
@@cert_provider.ssl_generate_issuer
|
89
91
|
end
|
90
92
|
|
91
|
-
def self.ssl_generate_certificate(
|
92
|
-
@@cert_provider.ssl_generate_certificate(
|
93
|
+
def self.ssl_generate_certificate(**opts)
|
94
|
+
@@cert_provider.ssl_generate_certificate(**opts)
|
93
95
|
end
|
94
96
|
|
95
97
|
#
|
@@ -102,8 +104,8 @@ module Rex::Socket::Ssl
|
|
102
104
|
#
|
103
105
|
# Shim for the ssl_generate_certificate module method
|
104
106
|
#
|
105
|
-
def ssl_generate_certificate(
|
106
|
-
Rex::Socket::Ssl.ssl_generate_certificate(
|
107
|
+
def ssl_generate_certificate(**opts)
|
108
|
+
Rex::Socket::Ssl.ssl_generate_certificate(**opts)
|
107
109
|
end
|
108
110
|
|
109
111
|
#
|
@@ -117,7 +119,7 @@ module Rex::Socket::Ssl
|
|
117
119
|
if params.ssl_cert
|
118
120
|
key, cert, chain = ssl_parse_pem(params.ssl_cert)
|
119
121
|
else
|
120
|
-
key, cert, chain = ssl_generate_certificate(params.ssl_cn)
|
122
|
+
key, cert, chain = ssl_generate_certificate(cert_vars: {cn: params.ssl_cn})
|
121
123
|
end
|
122
124
|
|
123
125
|
ctx = OpenSSL::SSL::SSLContext.new()
|
data/lib/rex/socket/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,94 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rex-socket
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Maloney
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
|
-
cert_chain:
|
11
|
-
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G
|
14
|
+
A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp
|
15
|
+
Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4
|
16
|
+
MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG
|
17
|
+
A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI
|
18
|
+
hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8
|
19
|
+
RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT
|
20
|
+
gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm
|
21
|
+
KPZpO/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1LN0tm3ruiv8oy
|
85
|
+
cq4FiEmVUXZejSRvVVtABeWdZWo+lJ8NxCBUEYYmnMrjgFIbGiEbBsg7PGtyeQsA
|
86
|
+
5Wbg7Lx889mS1tKfQBcPif8EjpTiXNfMiywmpaMYmvm+yQgzrRLDbjz6JV0Rc5Ga
|
87
|
+
WChka+LTPnMtsWJuFM8ka8icMeS28/nAGERdewxWvz+DeAPMORdTJ7aqb6+Y9xuz
|
88
|
+
G+Hmcg1v810agasPdoydE0RTVZgEOOMoQ07qu7JFXVWZ9ZQpHT7qJATWL/b2csFG
|
89
|
+
8mVuTXnyJOKRJA==
|
90
|
+
-----END CERTIFICATE-----
|
91
|
+
date: 2019-08-30 00:00:00.000000000 Z
|
12
92
|
dependencies:
|
13
93
|
- !ruby/object:Gem::Dependency
|
14
94
|
name: bundler
|
@@ -123,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
203
|
version: '0'
|
124
204
|
requirements: []
|
125
205
|
rubyforge_project:
|
126
|
-
rubygems_version: 2.
|
206
|
+
rubygems_version: 2.6.14
|
127
207
|
signing_key:
|
128
208
|
specification_version: 4
|
129
209
|
summary: The Ruby Exploitation (Rex) Socket Abstraction Library.
|
metadata.gz.sig
ADDED
Binary file
|