rex-socket 0.1.58 → 0.1.60
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 +4 -4
- data/.github/workflows/verify.yml +2 -39
- data/cortex.yaml +2 -0
- data/lib/rex/socket/comm/local.rb +6 -5
- data/lib/rex/socket/parameters.rb +2 -1
- data/lib/rex/socket/proxies.rb +24 -0
- data/lib/rex/socket/version.rb +1 -1
- metadata +8 -33
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a61eea97f22de5fbf53bd8b10afdc2a49affa0d3ced6a6457dbc78c7c13f88c4
|
4
|
+
data.tar.gz: 0b43ec7143f9dca80b8bc38105e6873252eda7b19b023e393432580169002620
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c055962142f5fcadf24016b0274d065dafe53b47bff9a290fed250fe8a99a11a4a6a29b414b6d9656ce3304903ae4c620c03601235b6008f047e2ad171f2e375
|
7
|
+
data.tar.gz: 37943cfd24524c9a8474132c1d7cb3051a221173ad493ed7a3ad103e1223163bd1bc7da1639b21fa6c36add59c3777012aee7acdd6484e0c1f45230722d34c56
|
@@ -25,42 +25,5 @@ on:
|
|
25
25
|
- '*'
|
26
26
|
|
27
27
|
jobs:
|
28
|
-
|
29
|
-
|
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
@@ -9,6 +9,7 @@ require 'rex/socket/udp'
|
|
9
9
|
require 'rex/socket/sctp'
|
10
10
|
require 'rex/socket/sctp_server'
|
11
11
|
require 'rex/socket/ip'
|
12
|
+
require 'rex/socket/proxies'
|
12
13
|
require 'timeout'
|
13
14
|
|
14
15
|
###
|
@@ -261,7 +262,7 @@ class Rex::Socket::Comm::Local
|
|
261
262
|
end
|
262
263
|
|
263
264
|
ip6_scope_idx = 0
|
264
|
-
ip = param.peerhost
|
265
|
+
ip = Rex::Socket.getaddress(param.peerhost)
|
265
266
|
port = param.peerport
|
266
267
|
|
267
268
|
if param.proxies
|
@@ -353,7 +354,7 @@ class Rex::Socket::Comm::Local
|
|
353
354
|
|
354
355
|
def self.proxy(sock, type, host, port)
|
355
356
|
case type.downcase
|
356
|
-
when
|
357
|
+
when Rex::Socket::Proxies::ProxyType::SAPNI
|
357
358
|
packet_type = 'NI_ROUTE'
|
358
359
|
route_info_version = 2
|
359
360
|
ni_version = 39
|
@@ -422,7 +423,7 @@ class Rex::Socket::Comm::Local
|
|
422
423
|
raise Rex::ConnectionProxyError.new(host, port, type, "Connection to #{host}:#{port} failed (Unknown fail)")
|
423
424
|
end
|
424
425
|
|
425
|
-
when
|
426
|
+
when Rex::Socket::Proxies::ProxyType::HTTP
|
426
427
|
setup = "CONNECT #{host}:#{port} HTTP/1.0\r\n\r\n"
|
427
428
|
size = sock.put(setup)
|
428
429
|
if size != setup.length
|
@@ -445,7 +446,7 @@ class Rex::Socket::Comm::Local
|
|
445
446
|
if resp.code != 200
|
446
447
|
raise Rex::ConnectionProxyError.new(host, port, type, "The proxy returned a non-OK response"), caller
|
447
448
|
end
|
448
|
-
when
|
449
|
+
when Rex::Socket::Proxies::ProxyType::SOCKS4
|
449
450
|
supports_ipv6 = false
|
450
451
|
setup = [4,1,port.to_i].pack('CCn') + Rex::Socket.resolv_nbo(host, supports_ipv6) + Rex::Text.rand_text_alpha(rand(8)+1) + "\x00"
|
451
452
|
size = sock.put(setup)
|
@@ -465,7 +466,7 @@ class Rex::Socket::Comm::Local
|
|
465
466
|
if ret[1,1] != "\x5a"
|
466
467
|
raise Rex::ConnectionProxyError.new(host, port, type, "Proxy responded with error code #{ret[0,1].unpack("C")[0]}"), caller
|
467
468
|
end
|
468
|
-
when
|
469
|
+
when Rex::Socket::Proxies::ProxyType::SOCKS5
|
469
470
|
auth_methods = [5,1,0].pack('CCC')
|
470
471
|
size = sock.put(auth_methods)
|
471
472
|
if size != auth_methods.length
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# -*- coding: binary -*-
|
2
2
|
require 'rex/socket'
|
3
|
+
require 'rex/socket/proxies'
|
3
4
|
|
4
5
|
###
|
5
6
|
#
|
@@ -163,7 +164,7 @@ class Rex::Socket::Parameters
|
|
163
164
|
end
|
164
165
|
|
165
166
|
if hash['Proxies']
|
166
|
-
self.proxies = hash['Proxies']
|
167
|
+
self.proxies = Rex::Socket::Proxies.parse(hash['Proxies'])
|
167
168
|
end
|
168
169
|
|
169
170
|
# The protocol this socket will be using
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# -*- coding: binary -*-
|
2
|
+
|
3
|
+
module Rex
|
4
|
+
module Socket
|
5
|
+
module Proxies
|
6
|
+
module ProxyType
|
7
|
+
SAPNI = 'sapni'
|
8
|
+
HTTP = 'http'
|
9
|
+
SOCKS4 = 'socks4'
|
10
|
+
SOCKS5 = 'socks5'
|
11
|
+
end
|
12
|
+
|
13
|
+
# @param [String,nil] value A proxy chain of format {type:host:port[,type:host:port][...]}
|
14
|
+
# @return [Array] The array of proxies, i.e. {[['type', 'host', 'port']]}
|
15
|
+
def self.parse(value)
|
16
|
+
value.to_s.strip.split(',').map { |a| a.strip }.map { |a| a.split(':').map { |b| b.strip } }
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.supported_types
|
20
|
+
ProxyType.constants.map { |c| ProxyType.const_get(c) }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/rex/socket/version.rb
CHANGED
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.
|
4
|
+
version: 0.1.60
|
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+yVjwiKWv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1NiYfMCYyY/Mcd4W36kGOl468
|
32
|
-
I8VDTwgCufkAzFu7BJ5yCOueqtDcuq+d3YhAyU7NI4+Ja8EwazOnB+07sWhKpg7z
|
33
|
-
yuQ1mWYPmZfVQpoSVv1CvXsoqJYXVPBBLOacKKSj8ArVG6pPn9Bej7IOQdblaFjl
|
34
|
-
DgscAao7wB3xW2BWEp1KnaDWkf1x9ttgoBEYyuYwU7uatB67kBQG1PKvLt79wHvz
|
35
|
-
Dxs+KOjGbBRfMnPgVGYkORKVrZIwlaboHbDKxcVW5xv+oZc7KYXWGg==
|
36
|
-
-----END CERTIFICATE-----
|
37
|
-
date: 2024-11-22 00:00:00.000000000 Z
|
10
|
+
cert_chain: []
|
11
|
+
date: 2025-04-09 00:00:00.000000000 Z
|
38
12
|
dependencies:
|
39
13
|
- !ruby/object:Gem::Dependency
|
40
14
|
name: rake
|
@@ -118,6 +92,7 @@ files:
|
|
118
92
|
- lib/rex/socket/comm/local.rb
|
119
93
|
- lib/rex/socket/ip.rb
|
120
94
|
- lib/rex/socket/parameters.rb
|
95
|
+
- lib/rex/socket/proxies.rb
|
121
96
|
- lib/rex/socket/range_walker.rb
|
122
97
|
- lib/rex/socket/sctp.rb
|
123
98
|
- lib/rex/socket/sctp_server.rb
|
@@ -136,7 +111,7 @@ files:
|
|
136
111
|
homepage: https://github.com/rapid7/rex-socket
|
137
112
|
licenses: []
|
138
113
|
metadata: {}
|
139
|
-
post_install_message:
|
114
|
+
post_install_message:
|
140
115
|
rdoc_options: []
|
141
116
|
require_paths:
|
142
117
|
- lib
|
@@ -151,8 +126,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
126
|
- !ruby/object:Gem::Version
|
152
127
|
version: '0'
|
153
128
|
requirements: []
|
154
|
-
rubygems_version: 3.4.
|
155
|
-
signing_key:
|
129
|
+
rubygems_version: 3.4.19
|
130
|
+
signing_key:
|
156
131
|
specification_version: 4
|
157
132
|
summary: The Ruby Exploitation (Rex) Socket Abstraction Library.
|
158
133
|
test_files: []
|
checksums.yaml.gz.sig
DELETED
Binary file
|
data.tar.gz.sig
DELETED
Binary file
|
metadata.gz.sig
DELETED
Binary file
|