rex-socket 0.1.27 → 0.1.28

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: 1c761ab84c205dd7b2046c7249f279f4f9b4ac2ba16168dd4c7cc62e1ac41fb8
4
- data.tar.gz: 4ead3c6958a08e49e7255946a772ee8ba4934de87e3f1e1e96ad94db9399fb69
3
+ metadata.gz: 324deceef4e08a04cdfee10fa7fcda792dfee027e2a83792492da6294a2a5b18
4
+ data.tar.gz: bdb5cdb27e4cf46c90fe0c5ace17347c47fcb257497fba247c18a627afe9b536
5
5
  SHA512:
6
- metadata.gz: 5b2ddff4009180354ffc849c021da8087855406e0fa2d7c549981cc7bdfc13adc854cda40da406605c513d719327fa2464948f2e24c06a533b248a149e171061
7
- data.tar.gz: 4a862d8480c701c99a28ff67be3db07ecd5803509f18d712f5acfa42bbb432e3022a5797a8847d13e7a989243e19bf4081ad632e7466ee51e5ef29006a5ab39d
6
+ metadata.gz: 5b161f04cb05e3e44c6fd0034e4a5fc062d229bc582937a525f44230706a5c3b90c0abbafa71d359453040667034a76a597d93ecb153cf65abec00f4dfc8ef1d
7
+ data.tar.gz: 8c2238d6a358ef0dbb2cb513ca723d3fd97ea5ce97c64c8e79f7f166764d50a68cb0721e23a3701086d3418e7caac937366f2ab2b0fc887b54e742408cd37312
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -84,27 +84,27 @@ class RangeWalker
84
84
 
85
85
  # Handle IPv6 CIDR first
86
86
  if arg.include?(':') && arg.include?('/')
87
- return false if (new_ranges = parse_ipv6_cidr(arg)) == nil
87
+ next if (new_ranges = parse_ipv6_cidr(arg)).nil?
88
88
 
89
89
  # Handle plain IPv6 next (support ranges, but not CIDR)
90
90
  elsif arg.include?(':')
91
- return false if (new_ranges = parse_ipv6(arg)) == nil
91
+ next if (new_ranges = parse_ipv6(arg)).nil?
92
92
 
93
93
  # Handle IPv4 CIDR
94
94
  elsif arg.include?("/")
95
- return false if (new_ranges = parse_ipv4_cidr(arg)) == nil
95
+ next if (new_ranges = parse_ipv4_cidr(arg)).nil?
96
96
 
97
97
  # Handle hostnames
98
98
  elsif arg =~ /[^-0-9,.*]/
99
- return false if (new_ranges = parse_hostname(arg)) == nil
99
+ next if (new_ranges = parse_hostname(arg)).nil?
100
100
 
101
101
  # Handle IPv4 ranges
102
102
  elsif arg =~ MATCH_IPV4_RANGE
103
103
  # Then it's in the format of 1.2.3.4-5.6.7.8
104
- return false if (new_ranges = parse_ipv4_ranges(arg)) == nil
104
+ next if (new_ranges = parse_ipv4_ranges(arg)).nil?
105
105
 
106
106
  else
107
- new_ranges = expand_nmap(arg)
107
+ next if (new_ranges = expand_nmap(arg)).nil?
108
108
  end
109
109
 
110
110
  ranges += new_ranges
@@ -275,18 +275,16 @@ class RangeWalker
275
275
  #
276
276
  def expand_nmap(arg)
277
277
  # Can't really do anything with IPv6
278
- return false if arg.include?(":")
278
+ return if arg.include?(":")
279
279
 
280
280
  # nmap calls these errors, but it's hard to catch them with our
281
281
  # splitting below, so short-cut them here
282
- return false if arg.include?(",-") or arg.include?("-,")
282
+ return if arg.include?(",-") or arg.include?("-,")
283
283
 
284
284
  bytes = []
285
285
  sections = arg.split('.')
286
- if sections.length != 4
287
- # Too many or not enough dots
288
- return false
289
- end
286
+ return unless sections.length == 4 # Too many or not enough dots
287
+
290
288
  sections.each { |section|
291
289
  if section.empty?
292
290
  # pretty sure this is an unintentional artifact of the C
@@ -300,7 +298,7 @@ class RangeWalker
300
298
  # I think this ought to be 1-254, but this is how nmap does it.
301
299
  section = "0-255"
302
300
  elsif section.include?("*")
303
- return false
301
+ return
304
302
  end
305
303
 
306
304
  # Break down the sections into ranges like so
@@ -317,18 +315,18 @@ class RangeWalker
317
315
  # if the upper bound is empty, stop at 255
318
316
  #
319
317
  bounds = r.split('-', -1)
320
- return false if (bounds.length > 2)
318
+ return if (bounds.length > 2)
321
319
 
322
320
  bounds[0] = 0 if bounds[0].nil? or bounds[0].empty?
323
321
  bounds[1] = 255 if bounds[1].nil? or bounds[1].empty?
324
322
  bounds.map!{|b| b.to_i}
325
- return false if bounds[0] > bounds[1]
323
+ return if bounds[0] > bounds[1]
326
324
  else
327
325
  # Then it's a single value
328
326
  bounds[0] = r.to_i
329
327
  end
330
- return false if bounds[0] > 255 or (bounds[1] and bounds[1] > 255)
331
- return false if bounds[1] and bounds[0] > bounds[1]
328
+ return if bounds[0] > 255 or (bounds[1] and bounds[1] > 255)
329
+ return if bounds[1] and bounds[0] > bounds[1]
332
330
  if bounds[1]
333
331
  bounds[0].upto(bounds[1]) do |i|
334
332
  sets.push(i)
@@ -1,5 +1,5 @@
1
1
  module Rex
2
2
  module Socket
3
- VERSION = "0.1.27"
3
+ VERSION = "0.1.28"
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.27
4
+ version: 0.1.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Metasploit Hackers
@@ -93,7 +93,7 @@ cert_chain:
93
93
  EknWpNgVhohbot1lfVAMmIhdtOVaRVcQQixWPwprDj/ydB8ryDMDosIMcw+fkoXU
94
94
  9GJsSaSRRYQ9UUkVL27b64okU8D48m8=
95
95
  -----END CERTIFICATE-----
96
- date: 2021-03-24 00:00:00.000000000 Z
96
+ date: 2021-03-25 00:00:00.000000000 Z
97
97
  dependencies:
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: rake
metadata.gz.sig CHANGED
Binary file