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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 18bb58a6a55981a1a6e883d7a60f99851162d6f8
4
- data.tar.gz: 66d105060da27f4303522d2947196abab1bb58b1
3
+ metadata.gz: f089313baf795935488a8dd6afd689ca30581cd7
4
+ data.tar.gz: 571a4ebe9c229c3d3e721f400862467352b7a1e1
5
5
  SHA512:
6
- metadata.gz: 5226bee52b4a24107ef6673fe73002eba689ec865e82ffc534e6992f05c80223a47b005da96b8292cc6db9464608a4fb4a6d97863d1fcd4ef208de0b5ead7715
7
- data.tar.gz: 77a6ee0ad79d35244ea92ed9fb7a20279886640acdd0150e233641d1e3e35afd248f35124691a67630f446e3d5f773d83cfb12ec33751c8e218ec38f75088fb7
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
- &��\{�������T�L�\��>�T{ڄ�-{��Է�{��)��r�r��`-/܁>�'B��^A����È��T~%st[)k2D \���c*n���}�|IW�f�\���ro�����e��˜�(d�M<�w�Ԁ&�s?����ǰD�f�;�=/�h�")Q�]�'у21����1��O~o�����7�!�+�Pㄏ� �rW�dK�r����*�7K}���gu)��"��r,�{�e^e ���`LjQ �
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 = 24*3600*365
143
- vf = Time.at(Time.now.to_i - rand(yr * 3) - yr)
144
- vt = Time.at(vf.to_i + (10 * yr))
145
- cn = Rex::Text.rand_text_alpha_lower(rand(8)+2)
146
- key = OpenSSL::PKey::RSA.new(2048){ }
147
- cert = OpenSSL::X509::Certificate.new
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([["CN", cn]])
151
- cert.issuer = OpenSSL::X509::Name.new([["CN", cn]])
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
@@ -1,5 +1,5 @@
1
1
  module Rex
2
2
  module Socket
3
- VERSION = "0.1.8"
3
+ VERSION = "0.1.9"
4
4
  end
5
5
  end
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.8
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-06-30 00:00:00.000000000 Z
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.8
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