rex-socket 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +2 -1
- data/lib/rex/socket/ssl_tcp_server.rb +23 -8
- data/lib/rex/socket/version.rb +1 -1
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f089313baf795935488a8dd6afd689ca30581cd7
|
4
|
+
data.tar.gz: 571a4ebe9c229c3d3e721f400862467352b7a1e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5e550e2585b6c9d37ce381ced3f8bcdad76ff1fe59f71e2e0da49500b057ca85b947a4d914f95284bc984f0fe8c5c9052b85ce21c9d605090540b232a8ac4fa
|
7
|
+
data.tar.gz: 851c8ffde6dd2bf3642f0c54e87fe5ee10bed0e1ebf1802f63e622c7ae970cc0963fb0fe14aecda4946fff6a16653f74d4da5181bae237fb7fa18e3dc9209dbf
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
,����f��fه����R
|
2
|
+
p��("r*�r�����������7*�=�i�'ƹJs� I�eJ�y�������w�!4���
|
@@ -133,22 +133,37 @@ module Rex::Socket::SslTcpServer
|
|
133
133
|
Rex::Socket::SslTcpServer.ssl_parse_pem(ssl_cert)
|
134
134
|
end
|
135
135
|
|
136
|
+
def self.ssl_generate_subject
|
137
|
+
st = Rex::Text.rand_state
|
138
|
+
loc = Rex::Text.rand_name.capitalize
|
139
|
+
org = Rex::Text.rand_name.capitalize
|
140
|
+
cn = Rex::Text.rand_hostname
|
141
|
+
"US/ST=#{st}/L=#{loc}/O=#{org}/CN=#{cn}"
|
142
|
+
end
|
143
|
+
|
144
|
+
def self.ssl_generate_issuer
|
145
|
+
org = Rex::Text.rand_name.capitalize
|
146
|
+
cn = Rex::Text.rand_name.capitalize + " " + Rex::Text.rand_name.capitalize
|
147
|
+
"US/O=#{org}/CN=#{cn}"
|
148
|
+
end
|
149
|
+
|
136
150
|
#
|
137
151
|
# Generate a realistic-looking but obstensibly fake SSL
|
138
152
|
# certificate. This matches a typical "snakeoil" cert.
|
139
153
|
#
|
140
154
|
# @return [String, String, Array]
|
141
155
|
def self.ssl_generate_certificate
|
142
|
-
yr
|
143
|
-
vf
|
144
|
-
vt
|
145
|
-
|
146
|
-
|
147
|
-
|
156
|
+
yr = 24*3600*365
|
157
|
+
vf = Time.at(Time.now.to_i - rand(yr * 3) - yr)
|
158
|
+
vt = Time.at(vf.to_i + (rand(9)+1) * yr)
|
159
|
+
subject = ssl_generate_subject
|
160
|
+
issuer = ssl_generate_issuer
|
161
|
+
key = OpenSSL::PKey::RSA.new(2048){ }
|
162
|
+
cert = OpenSSL::X509::Certificate.new
|
148
163
|
cert.version = 2
|
149
164
|
cert.serial = (rand(0xFFFFFFFF) << 32) + rand(0xFFFFFFFF)
|
150
|
-
cert.subject = OpenSSL::X509::Name.new([["
|
151
|
-
cert.issuer = OpenSSL::X509::Name.new([["
|
165
|
+
cert.subject = OpenSSL::X509::Name.new([["C", subject]])
|
166
|
+
cert.issuer = OpenSSL::X509::Name.new([["C", issuer]])
|
152
167
|
cert.not_before = vf
|
153
168
|
cert.not_after = vt
|
154
169
|
cert.public_key = key.public_key
|
data/lib/rex/socket/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Maloney
|
@@ -88,7 +88,7 @@ cert_chain:
|
|
88
88
|
G+Hmcg1v810agasPdoydE0RTVZgEOOMoQ07qu7JFXVWZ9ZQpHT7qJATWL/b2csFG
|
89
89
|
8mVuTXnyJOKRJA==
|
90
90
|
-----END CERTIFICATE-----
|
91
|
-
date: 2017-
|
91
|
+
date: 2017-10-24 00:00:00.000000000 Z
|
92
92
|
dependencies:
|
93
93
|
- !ruby/object:Gem::Dependency
|
94
94
|
name: bundler
|
@@ -202,7 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
202
202
|
version: '0'
|
203
203
|
requirements: []
|
204
204
|
rubyforge_project:
|
205
|
-
rubygems_version: 2.6.
|
205
|
+
rubygems_version: 2.6.13
|
206
206
|
signing_key:
|
207
207
|
specification_version: 4
|
208
208
|
summary: The Ruby Exploitation (Rex) Socket Abstraction Library.
|
metadata.gz.sig
CHANGED
Binary file
|