rex-socket 0.1.54 → 0.1.55
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/cortex.yaml +15 -0
- data/lib/rex/socket/version.rb +1 -1
- data/lib/rex/socket.rb +69 -0
- data.tar.gz.sig +3 -3
- metadata +26 -84
- 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: f205a57e2e9e372f999bd08d4e39d6be05bb5fc4a3bcc83e3b27b0de29dd90ad
|
4
|
+
data.tar.gz: '028fca6197d04804b78b7f6ee8d9ca849196c84714a1eabf640b25fe723b8226'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 393eb18d30bf96737c546a91cc646991cb1b17641cce3266911378a6a423c1d7a3f0e921ca455816bf7563fae6fa6933a38a39263c5b7a823be1c319ff0d8960
|
7
|
+
data.tar.gz: c5f866f117febd1717a60404a2b07e5cf945f48c37c479e490d26992b5438abfb78f1b7e84940399e0e741ef155830ec07cb7fa5ef211fb88d70e7b33341e9de
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/cortex.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
info:
|
3
|
+
title: Rex Socket
|
4
|
+
description: The Rex Socket Abstraction Library
|
5
|
+
x-cortex-git:
|
6
|
+
github:
|
7
|
+
alias: r7org
|
8
|
+
repository: rapid7/rex-socket
|
9
|
+
x-cortex-tag: rex-socket
|
10
|
+
x-cortex-type: service
|
11
|
+
x-cortex-domain-parents:
|
12
|
+
- tag: metasploit
|
13
|
+
openapi: 3.0.1
|
14
|
+
servers:
|
15
|
+
- url: "/"
|
data/lib/rex/socket/version.rb
CHANGED
data/lib/rex/socket.rb
CHANGED
@@ -258,6 +258,29 @@ module Socket
|
|
258
258
|
@@resolver ? self.rex_gethostbyname(host) : ::Socket.gethostbyname(host)
|
259
259
|
end
|
260
260
|
|
261
|
+
#
|
262
|
+
# Wrapper for Resolv::DNS.getresources which normalizes the return value to a
|
263
|
+
# list of hostnames regardless of the resource class.
|
264
|
+
#
|
265
|
+
# @param name [String] The name to lookup.
|
266
|
+
# @param typeclass [Symbol] The resource class to lookup, e.g. CNAME, MX, etc.
|
267
|
+
# @raises ArgumentError An argument error is raised when the typeclass is invalid.
|
268
|
+
# @return [Array<String>] The hostnames that were returned by the query.
|
269
|
+
def self.getresources(name, typeclass)
|
270
|
+
return self.rex_getresources(name, typeclass) if @@resolver
|
271
|
+
|
272
|
+
typeclass = typeclass.upcase
|
273
|
+
attribute = DNS_RESOURCE_ATTRIBUTE_NAMES[typeclass]
|
274
|
+
if attribute.nil?
|
275
|
+
raise ArgumentError, "Invalid typeclass: #{typeclass}"
|
276
|
+
end
|
277
|
+
const = Resolv::DNS::Resource::IN.const_get(typeclass)
|
278
|
+
|
279
|
+
dns = Resolv::DNS.new
|
280
|
+
resources = dns.getresources(name, const)
|
281
|
+
resources.map(&attribute).map(&:to_s)
|
282
|
+
end
|
283
|
+
|
261
284
|
#
|
262
285
|
# Create a sockaddr structure using the supplied IP address, port, and
|
263
286
|
# address family
|
@@ -963,6 +986,52 @@ protected
|
|
963
986
|
# Ensure response types (depending on underlying library used) provide required methods
|
964
987
|
return v4, v6
|
965
988
|
end
|
989
|
+
|
990
|
+
def self.rex_getresources(name, typeclass, resolver: @@resolver)
|
991
|
+
raise ::SocketError.new(
|
992
|
+
"Rex::Socket internal DNS resolution requires passing/setting a resolver"
|
993
|
+
) unless resolver
|
994
|
+
raise ::SocketError.new(
|
995
|
+
"Rex::Socket internal DNS resolution requires passing a String name to resolve"
|
996
|
+
) unless name.is_a?(String)
|
997
|
+
|
998
|
+
typeclass = typeclass.upcase
|
999
|
+
attribute = REX_DNS_RESOURCE_ATTRIBUTE_NAMES[typeclass]
|
1000
|
+
if attribute.nil?
|
1001
|
+
raise ArgumentError, "Invalid typeclass: #{typeclass}"
|
1002
|
+
end
|
1003
|
+
const = ::Net::DNS.const_get(typeclass)
|
1004
|
+
|
1005
|
+
resources = begin
|
1006
|
+
resolver.send(name, const).answer.select do |a|
|
1007
|
+
a.type == const
|
1008
|
+
end.map(&attribute).map(&:to_s)
|
1009
|
+
rescue
|
1010
|
+
[]
|
1011
|
+
end
|
1012
|
+
|
1013
|
+
resources
|
1014
|
+
end
|
1015
|
+
|
1016
|
+
DNS_RESOURCE_ATTRIBUTE_NAMES = {
|
1017
|
+
CNAME: :name,
|
1018
|
+
MX: :exchange,
|
1019
|
+
NS: :name,
|
1020
|
+
PTR: :name,
|
1021
|
+
SOA: :mname,
|
1022
|
+
SRV: :target
|
1023
|
+
}.freeze
|
1024
|
+
private_constant :DNS_RESOURCE_ATTRIBUTE_NAMES
|
1025
|
+
|
1026
|
+
REX_DNS_RESOURCE_ATTRIBUTE_NAMES = {
|
1027
|
+
CNAME: :domainname,
|
1028
|
+
MX: :exchange,
|
1029
|
+
NS: :domainname,
|
1030
|
+
PTR: :domainname,
|
1031
|
+
SOA: :mname,
|
1032
|
+
SRV: :target
|
1033
|
+
}.freeze
|
1034
|
+
private_constant :REX_DNS_RESOURCE_ATTRIBUTE_NAMES
|
966
1035
|
end
|
967
1036
|
|
968
1037
|
end
|
data.tar.gz.sig
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
͂�-T'[�Ss�eq�KqS42��aH�Ɣn�5q�vB���#�x�,�C�3}����&96�{ �ϔ 8� k|�����-�Xa���J#PJ��I��:ĈΪ��;] ���o/"�ܸi�V炜�<��(�h��uM�ZQ�L�1���.����V/���ƥ�����H6Ҡ���2+i�f^��4�T/�cQu+�zxlƆD��Ǻ�<g�i0џ
|
2
|
+
��z#9j���� ~���a>�B�R��
|
3
|
+
�8�\�yZS}]0�׃�l�E������z<(�
|
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.55
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Metasploit Hackers
|
@@ -10,90 +10,31 @@ bindir: exe
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
+
|
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
|
+
D8sxL6Dgdq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dependencies:
|
98
39
|
- !ruby/object:Gem::Dependency
|
99
40
|
name: rake
|
@@ -157,6 +98,7 @@ files:
|
|
157
98
|
- Rakefile
|
158
99
|
- bin/console
|
159
100
|
- bin/setup
|
101
|
+
- cortex.yaml
|
160
102
|
- lib/rex/socket.rb
|
161
103
|
- lib/rex/socket/comm.rb
|
162
104
|
- lib/rex/socket/comm/local.rb
|
metadata.gz.sig
CHANGED
Binary file
|