rex-socket 0.1.59 → 0.1.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e949497936b6f26c1c6da1830a2673f8708706e89598765b26ddf05179dceee0
4
- data.tar.gz: 49e42e30d773df6f4b52539d360748fe77e51dd49bb1f1e2782a35217839eef3
3
+ metadata.gz: 768cf09e183ef82a282e1173e076723617fa5d1d3ef6d159930c5f080e62267c
4
+ data.tar.gz: 9cfe878cd33e159f58803d2012150d20f2d9a934222e71e674618b553ef3f4ed
5
5
  SHA512:
6
- metadata.gz: c8ea54f52f4f10c8050e181980de4caf16bc5443657c55cf0ce5ef1d20b1a5bca84448515ab502ab79c4bc3eef66b1a199ada9e095304a42c25150ee9d3062fe
7
- data.tar.gz: aec32cadf5c60108aba67155731cf5eba9da3dba310f37fa6f6941f04a9e167762bae8953c05b5dfa7c6b096c8fdc44616b42a3f80e910a4cbc2b2e8c438308f
6
+ metadata.gz: 3135f51b48c61967266a771006fd0b432061f2c2717025695f9843cde59b40d7abf60c4bd7d92f957b9f574700cce4cdc0997e9707b5f2026eab1afd8a879696
7
+ data.tar.gz: c2874c8b85019ae4af581bd1d00e046b46d9c82b34b8032c13cc88547966706cde53775f80c856e5f4658ed186adc3aa836bf626f7c530e208ee1e46cc7c2493
@@ -25,42 +25,5 @@ on:
25
25
  - '*'
26
26
 
27
27
  jobs:
28
- test:
29
- runs-on: ${{ matrix.os }}
30
- timeout-minutes: 40
31
-
32
- strategy:
33
- fail-fast: false
34
- matrix:
35
- ruby:
36
- - '2.7'
37
- - '3.0'
38
- - '3.1'
39
- - '3.2'
40
- - '3.3'
41
- os:
42
- - ubuntu-20.04
43
- - windows-2019
44
- - macos-13
45
- - ubuntu-latest
46
- exclude:
47
- - { os: ubuntu-latest, ruby: '2.7' }
48
- - { os: ubuntu-latest, ruby: '3.0' }
49
-
50
- env:
51
- RAILS_ENV: test
52
-
53
- name: ${{ matrix.os }} - Ruby ${{ matrix.ruby }}
54
- steps:
55
- - name: Checkout code
56
- uses: actions/checkout@v4
57
-
58
- - name: Setup Ruby
59
- uses: ruby/setup-ruby@v1
60
- with:
61
- ruby-version: ${{ matrix.ruby }}
62
- bundler-cache: true
63
-
64
- - name: rspec
65
- run: |
66
- bundle exec rspec
28
+ build:
29
+ uses: rapid7/metasploit-framework/.github/workflows/shared_gem_verify_rails.yml@master
data/cortex.yaml CHANGED
@@ -10,6 +10,8 @@ info:
10
10
  x-cortex-type: service
11
11
  x-cortex-domain-parents:
12
12
  - tag: metasploit
13
+ x-cortex-groups:
14
+ - exposure:external-ship
13
15
  openapi: 3.0.1
14
16
  servers:
15
17
  - url: "/"
@@ -262,7 +262,7 @@ class Rex::Socket::Comm::Local
262
262
  end
263
263
 
264
264
  ip6_scope_idx = 0
265
- ip = param.peerhost
265
+ ip = Rex::Socket.getaddress(param.peerhost)
266
266
  port = param.peerport
267
267
 
268
268
  if param.proxies
@@ -51,6 +51,8 @@ class Rex::Socket::Parameters
51
51
  #
52
52
  # @option hash [String] 'PeerHost' The remote host to connect to
53
53
  # @option hash [String] 'PeerHostname' The unresolved remote hostname, used to specify Server Name Indication (SNI)
54
+ # @option hash [String] 'SSLKeyLogFile' The SSL key log file path, used for network capture
55
+ # decryption which is useful to decrypt TLS traffic in wireshark
54
56
  # @option hash [String] 'PeerAddr' (alias for 'PeerHost')
55
57
  # @option hash [Fixnum] 'PeerPort' The remote port to connect to
56
58
  # @option hash [String] 'LocalHost' The local host to communicate from, if any
@@ -116,6 +118,10 @@ class Rex::Socket::Parameters
116
118
  self.sslctx = hash['SSLContext']
117
119
  end
118
120
 
121
+ if (hash['SSLKeyLogFile'])
122
+ self.sslkeylogfile = hash['SSLKeyLogFile']
123
+ end
124
+
119
125
  self.ssl_version = hash.fetch('SSLVersion', nil)
120
126
 
121
127
  supported_ssl_verifiers = %W{CLIENT_ONCE FAIL_IF_NO_PEER_CERT NONE PEER}
@@ -302,6 +308,11 @@ class Rex::Socket::Parameters
302
308
  # @return [String]
303
309
  attr_accessor :peerhostname
304
310
 
311
+ # The SSL key log file path, equivalent to the sslkeylogfile parameter hash
312
+ # key.
313
+ # @return [String]
314
+ attr_accessor :sslkeylogfile
315
+
305
316
  # The remote port. Equivalent to the PeerPort parameter hash key.
306
317
  # @return [Fixnum]
307
318
  attr_writer :peerport
@@ -84,6 +84,20 @@ begin
84
84
  # Build the SSL connection
85
85
  self.sslctx = OpenSSL::SSL::SSLContext.new(version)
86
86
 
87
+ # writing to the sslkeylogfile is required, it adds support for network capture decryption which is useful to
88
+ # decrypt TLS traffic in wireshark
89
+ if sslkeylogfile
90
+ unless self.sslctx.respond_to?(:keylog_cb)
91
+ raise 'Unable to create sslkeylogfile - Ruby 3.2 or above required for this functionality'
92
+ end
93
+
94
+ self.sslctx.keylog_cb = proc do |_sock, line|
95
+ File.open(sslkeylogfile, 'ab') do |file|
96
+ file.write("#{line}\n")
97
+ end
98
+ end
99
+ end
100
+
87
101
  # Configure client certificate
88
102
  if params and params.ssl_client_cert
89
103
  self.sslctx.cert = OpenSSL::X509::Certificate.new(params.ssl_client_cert)
@@ -1,5 +1,5 @@
1
1
  module Rex
2
2
  module Socket
3
- VERSION = "0.1.59"
3
+ VERSION = "0.1.61"
4
4
  end
5
5
  end
data/lib/rex/socket.rb CHANGED
@@ -805,6 +805,7 @@ module Socket
805
805
  if (params)
806
806
  self.peerhost = params.peerhost
807
807
  self.peerhostname = params.peerhostname
808
+ self.sslkeylogfile = params.sslkeylogfile
808
809
  self.peerport = params.peerport
809
810
  self.localhost = params.localhost
810
811
  self.localport = params.localport
@@ -888,6 +889,10 @@ module Socket
888
889
  #
889
890
  attr_reader :peerhostname
890
891
  #
892
+ # The SSL key log file path.
893
+ #
894
+ attr_reader :sslkeylogfile
895
+ #
891
896
  # The peer port of the connected socket.
892
897
  #
893
898
  attr_reader :peerport
@@ -912,7 +917,7 @@ module Socket
912
917
 
913
918
  protected
914
919
 
915
- attr_writer :peerhost, :peerhostname, :peerport, :localhost, :localport # :nodoc:
920
+ attr_writer :peerhost, :peerhostname, :sslkeylogfile, :peerport, :localhost, :localport # :nodoc:
916
921
  attr_writer :context # :nodoc:
917
922
  attr_writer :ipv # :nodoc:
918
923
 
metadata CHANGED
@@ -1,40 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rex-socket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.59
4
+ version: 0.1.61
5
5
  platform: ruby
6
6
  authors:
7
7
  - Metasploit Hackers
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
- cert_chain:
11
- - |
12
- -----BEGIN CERTIFICATE-----
13
- MIIERDCCAqygAwIBAgIBATANBgkqhkiG9w0BAQsFADAmMSQwIgYDVQQDDBttc2Zk
14
- ZXYvREM9bWV0YXNwbG9pdC9EQz1jb20wHhcNMjMxMDMwMTYwNDI1WhcNMjUxMDI5
15
- MTYwNDI1WjAmMSQwIgYDVQQDDBttc2ZkZXYvREM9bWV0YXNwbG9pdC9EQz1jb20w
16
- ggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDZN/EKv+yVjwiKWvjAVhjF
17
- aWNYI0E9bJ5d1qKd29omRYX9a+OOKBCu5+394fyF5RjwU4mYGr2iopX9ixRJrWXH
18
- ojs70tEvV1CmvP9rhz7JKzQQoJOkinrz4d+StIylxVxVdgm7DeiB3ruTwvl7qKUv
19
- piWzhrBFiVU6XIEAwq6wNEmnv2D+Omyf4h0Tf99hc6G0QmBnU3XydqvnZ+AzUbBV
20
- 24RH3+NQoigLbvK4M5aOeYhk19di58hznebOw6twHzNczshrBeMFQp985ScNgsvF
21
- rL+7HNNwpcpngERwZfzDNn7iYN5X3cyvTcykShtsuPMa5zXsYo42LZrsTF87DW38
22
- D8sxL6Dgdqu25Mltdw9m+iD4rHSfb1KJYEoNO+WwBJLO2Y4d6G1CR66tVeWsZspb
23
- zneOVC+sDuil7hOm+6a7Y2yrrRyT6IfL/07DywjPAIRUp5+Jn8ZrkWRNo2AOwWBG
24
- k5gz7SfJPHuyVnPlxoMA0MTFCUnnnbyHu882TGoJGgMCAwEAAaN9MHswCQYDVR0T
25
- BAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFIQfNa4E889ZE334cwU7eNu2hScH
26
- MCAGA1UdEQQZMBeBFW1zZmRldkBtZXRhc3Bsb2l0LmNvbTAgBgNVHRIEGTAXgRVt
27
- c2ZkZXZAbWV0YXNwbG9pdC5jb20wDQYJKoZIhvcNAQELBQADggGBAMfzvKcV27p7
28
- pctmpW2JmIXLMrjNLyGJAxELH/t9pJueXdga7uj2fJkYQDbwGw5x4MGyFqhqJLH4
29
- l/qsUF3PyAXDTSWLVaqXQVWO+IIHxecG0XjPXTNudzMU0hzqbqiBKvsW7/a3V5BP
30
- SWlFzrFkoXWlPouFpoakyYMJjpW4SGdPzRv7pM4OhXtkXpHiRvx5985FrHgHlI89
31
- NSIuIUbp8zqk4hP1i9MV0Lc/vTf2gOmo+RHnjqG1NiYfMCYyY/Mcd4W36kGOl468
32
- I8VDTwgCufkAzFu7BJ5yCOueqtDcuq+d3YhAyU7NI4+Ja8EwazOnB+07sWhKpg7z
33
- yuQ1mWYPmZfVQpoSVv1CvXsoqJYXVPBBLOacKKSj8ArVG6pPn9Bej7IOQdblaFjl
34
- DgscAao7wB3xW2BWEp1KnaDWkf1x9ttgoBEYyuYwU7uatB67kBQG1PKvLt79wHvz
35
- Dxs+KOjGbBRfMnPgVGYkORKVrZIwlaboHbDKxcVW5xv+oZc7KYXWGg==
36
- -----END CERTIFICATE-----
37
- date: 2024-12-05 00:00:00.000000000 Z
10
+ cert_chain: []
11
+ date: 2025-04-11 00:00:00.000000000 Z
38
12
  dependencies:
39
13
  - !ruby/object:Gem::Dependency
40
14
  name: rake
@@ -137,7 +111,7 @@ files:
137
111
  homepage: https://github.com/rapid7/rex-socket
138
112
  licenses: []
139
113
  metadata: {}
140
- post_install_message:
114
+ post_install_message:
141
115
  rdoc_options: []
142
116
  require_paths:
143
117
  - lib
@@ -152,8 +126,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
126
  - !ruby/object:Gem::Version
153
127
  version: '0'
154
128
  requirements: []
155
- rubygems_version: 3.5.22
156
- signing_key:
129
+ rubygems_version: 3.4.19
130
+ signing_key:
157
131
  specification_version: 4
158
132
  summary: The Ruby Exploitation (Rex) Socket Abstraction Library.
159
133
  test_files: []
checksums.yaml.gz.sig DELETED
Binary file
data.tar.gz.sig DELETED
@@ -1 +0,0 @@
1
- \��I�ζ��t{:����S����:�=�|ϋH��Aw�xMVP|8�_���Q�R�G�/>��� ��t�n � �6Ϋn2�⃋9�>S�,�^Nf���\ד���9͗�_�t^�b�HQ��H؋��᭬á*�b����
+ �?t�j�V��!�RJ�{��X?!���
metadata.gz.sig DELETED
Binary file