ruby-masscan 0.2.1 → 0.2.3

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
  SHA256:
3
- metadata.gz: 064d7200b60b80a1ed4f0459239235d21f96587a3199833988dd5953728cd168
4
- data.tar.gz: 619757cb909fcec538c63ef5d37d2cb1f1029509d71e957be9aa6f74726ad4ea
3
+ metadata.gz: 10e9abe454a6c9e5715a61cff5b55eb5d29c037d1caf7692ccb937a811b83a3b
4
+ data.tar.gz: 8807aa7d6f7868f0ed84d0296de265b1ea1bf41a1301e779b767bd678747dc9f
5
5
  SHA512:
6
- metadata.gz: 9d9fa47ab80653e00c4d3f16b02e1cbe824575d0979b43596f7a52c703b9eda0616882e8bd7effdb77a3f9bfafe40b50043ace08a06f4725b59335dab724fee2
7
- data.tar.gz: ad559b68f9af88c2c2e1b66711a93b3bceda9962cd0b3f1f478400a0f1dd7d79a7a87eab81eef4ff9c1cca426c135732d05437affb757fdc3d1ebcfc64b681b2
6
+ metadata.gz: 75b5b24e0596c0d887b86b9d471c39dbedf966f74b9861db1b4aeb2809b243f6e7ad79b30851aa9c726e3178dda23dd6cbfc938836de750b7ff71772e952746e
7
+ data.tar.gz: faa1362698c3c0b11acc83d30b7e240d84b7786c17807e5d60d49836c654eaa7efa38f8e0f99144c895b4e308c7815e9c9a834a680cf837feed852516031018a
@@ -9,9 +9,10 @@ jobs:
9
9
  fail-fast: false
10
10
  matrix:
11
11
  ruby:
12
- - 2.6
13
- - 2.7
14
- - 3.0
12
+ - '3.0'
13
+ - '3.1'
14
+ - '3.2'
15
+ - '3.3'
15
16
  - jruby
16
17
  - truffleruby
17
18
  name: Ruby ${{ matrix.ruby }}
data/ChangeLog.md CHANGED
@@ -1,3 +1,18 @@
1
+ ### 0.2.3 / 2024-01-27
2
+
3
+ * Switched to using `require_relative` to improve load-times.
4
+ * Added `# frozen_string_literal: true` to all files.
5
+
6
+ ### 0.2.2 / 2023-04-20
7
+
8
+ * Corrected option definitions:
9
+ * The `--range` option expects a IP or CIDR range value.
10
+ * The `--exclude` option requires a value.
11
+ * `--range`, `--exclude`, `--excludefile`, `--includefile` options may be
12
+ repeated.
13
+ * The --pcap-payloads` option expects a file.
14
+ * The `--retries` option requires an argument.
15
+
1
16
  ### 0.2.1 / 2023-03-15
2
17
 
3
18
  * Unescape `\\xXX` hex escaped characters in payload strings parsed from `.list`
data/README.md CHANGED
@@ -82,11 +82,11 @@ end
82
82
  #<struct Masscan::Status status=:open, protocol=:tcp, port=443, reason=nil, ttl=nil, ip=#<IPAddr: IPv4:93.184.216.34/255.255.255.255>, timestamp=2021-08-25 23:47:50 -0700, mac=nil>
83
83
  #<struct Masscan::Status status=:open, protocol=:tcp, port=80, reason=nil, ttl=nil, ip=#<IPAddr: IPv4:93.184.216.34/255.255.255.255>, timestamp=2021-08-25 23:47:50 -0700, mac=nil>
84
84
  #<struct Masscan::Status status=:open, protocol=:icmp, port=0, reason=nil, ttl=nil, ip=#<IPAddr: IPv4:93.184.216.34/255.255.255.255>, timestamp=2021-08-25 23:47:50 -0700, mac=nil>
85
- #<struct Masscan::Banner protocol=:tcp, port=443, ip=#<IPAddr: IPv4:93.184.216.34/255.255.255.255>, timestamp=2021-08-25 23:47:52 -0700, app_protocol=:ssl3, payload="TLS/1.1 cipher:0xc013, www.example.org, www.example.org, example.com, example.edu, example.net, example.org, www.example.com, www.example.edu, www.example.net">
86
- #<struct Masscan::Banner protocol=:tcp, port=443, ip=#<IPAddr: IPv4:93.184.216.34/255.255.255.255>, timestamp=2021-08-25 23:47:52 -0700, app_protocol=:x509, payload="MIIG1TCCBb2gAwIBAgIQD74IsIVNBXOKsMzhya/uyTANBgkqhkiG9w0BAQsFADBPMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMSkwJwYDVQQDEyBEaWdpQ2VydCBUTFMgUlNBIFNIQTI1NiAyMDIwIENBMTAeFw0yMDExMjQwMDAwMDBaFw0yMTEyMjUyMzU5NTl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0LmNv">
87
- #<struct Masscan::Banner protocol=:tcp, port=80, ip=#<IPAddr: IPv4:93.184.216.34/255.255.255.255>, timestamp=2021-08-25 23:47:52 -0700, app_protocol=:http_server, payload="ECS (sec/974D)">
88
- #<struct Masscan::Banner protocol=:tcp, port=80, ip=#<IPAddr: IPv4:93.184.216.34/255.255.255.255>, timestamp=2021-08-25 23:47:52 -0700, app_protocol=:html_title, payload="404 - Not Found">
89
- #<struct Masscan::Banner protocol=:tcp, port=80, ip=#<IPAddr: IPv4:93.184.216.34/255.255.255.255>, timestamp=2021-08-25 23:47:52 -0700, app_protocol=:http, payload="HTTP/1.0 404 Not Found\\x0d\\x0aContent-Type: text/html\\x0d\\x0aDate: Thu, 26 Aug 2021 06:47:52 GMT\\x0d\\x0aServer: ECS (sec/974D)\\x0d\\x0aContent-Length: 345\\x0d\\x0aConnection: close\\x0d\\x0a\\x0d">
85
+ #<struct Masscan::Banner protocol=:tcp, port=443, ttl=nil, ip=#<IPAddr: IPv4:93.184.216.34/255.255.255.255>, timestamp=2021-08-25 23:47:52 -0700, app_protocol=:ssl3, payload="TLS/1.1 cipher:0xc013, www.example.org, www.example.org, example.com, example.edu, example.net, example.org, www.example.com, www.example.edu, www.example.net">
86
+ #<struct Masscan::Banner protocol=:tcp, port=443, ttl=nil, ip=#<IPAddr: IPv4:93.184.216.34/255.255.255.255>, timestamp=2021-08-25 23:47:52 -0700, app_protocol=:x509, payload="MIIG1TCCBb2gAwIBAgIQD74IsIVNBXOKsMzhya/uyTANBgkqhkiG9w0BAQsFADBPMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMSkwJwYDVQQDEyBEaWdpQ2VydCBUTFMgUlNBIFNIQTI1NiAyMDIwIENBMTAeFw0yMDExMjQwMDAwMDBaFw0yMTEyMjUyMzU5NTlaMIGQMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEUMBIGA1UEBxMLTG9zIEFuZ2VsZXMxPDA6B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-25 23:47:52 -0700, app_protocol=:http_server, payload="ECS (sec/974D)">
88
+ #<struct Masscan::Banner protocol=:tcp, port=80, ttl=nil, ip=#<IPAddr: IPv4:93.184.216.34/255.255.255.255>, timestamp=2021-08-25 23:47:52 -0700, app_protocol=:html_title, payload="404 - Not Found">
89
+ #<struct Masscan::Banner protocol=:tcp, port=80, ttl=nil, ip=#<IPAddr: IPv4:93.184.216.34/255.255.255.255>, timestamp=2021-08-25 23:47:52 -0700, app_protocol=:http, payload="HTTP/1.0 404 Not Found\r\nContent-Type: text/html\r\nDate: Thu, 26 Aug 2021 06:47:52 GMT\r\nServer: ECS (sec/974D)\r\nContent-Length: 345\r\nConnection: close\r\n\r">
90
90
  ```
91
91
 
92
92
  Parse `masscan` JSON output files:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Masscan
2
4
  #
3
5
  # Represents a banner record.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'command_mapper/command'
2
4
 
3
5
  module Masscan
@@ -7,11 +9,11 @@ module Masscan
7
9
  # ## Example
8
10
  #
9
11
  # require 'masscan/command'
10
- #
12
+ #
11
13
  # Masscan::Command.sudo do |masscan|
12
14
  # masscan.output_format = :list
13
15
  # masscan.output_file = 'masscan.txt'
14
- #
16
+ #
15
17
  # masscan.ips = '192.168.1.1/24'
16
18
  # masscan.ports = [20,21,22,23,25,80,110,443,512,522,8080,1080]
17
19
  # end
@@ -159,7 +161,7 @@ module Masscan
159
161
  end
160
162
 
161
163
  command "masscan" do
162
- option '--range', name: :range, value: {type: List.new}
164
+ option '--range', name: :range, value: true, repeats: true
163
165
  option '-p', name: :ports, value: {type: PortList.new}
164
166
  option '--banners', name: :banners
165
167
  option '--rate', name: :rate, value: {type: Num.new}
@@ -173,14 +175,14 @@ module Masscan
173
175
  option '--adapter-vlan', name: :adapter_vlan, value: true
174
176
  option '--router-mac', name: :router_mac, value: true
175
177
  option '--ping', name: :ping
176
- option '--exclude', name: :exclude, value: {type: List.new}
177
- option '--excludefile', name: :exclude_file, value: {type: InputFile.new}
178
- option '--includefile', name: :include_file, value: {type: InputFile.new}
178
+ option '--exclude', name: :exclude, value: true, repeats: true
179
+ option '--excludefile', name: :exclude_file, value: {type: InputFile.new}, repeats: true
180
+ option '--includefile', name: :include_file, value: {type: InputFile.new}, repeats: true
179
181
  option '--append-output', name: :append_output
180
182
  option '--iflist', name: :list_interfaces
181
- option '--retries', name: :retries
183
+ option '--retries', name: :retries, value: {type: Num.new}
182
184
  option '--nmap', name: :nmap_help
183
- option '--pcap-payloads', name: :pcap_payloads
185
+ option '--pcap-payloads', name: :pcap_payloads, value: {type: InputFile.new}
184
186
  option '--nmap-payloads', name: :nmap_payloads, value: {type: InputFile.new}
185
187
 
186
188
  option '--http-method', name: :http_method, value: true
@@ -1,6 +1,8 @@
1
- require 'masscan/parsers/list'
2
- require 'masscan/parsers/json'
3
- require 'masscan/parsers/binary'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'parsers/list'
4
+ require_relative 'parsers/json'
5
+ require_relative 'parsers/binary'
4
6
 
5
7
  module Masscan
6
8
  #
@@ -1,5 +1,7 @@
1
- require 'masscan/status'
2
- require 'masscan/banner'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../status'
4
+ require_relative '../banner'
3
5
 
4
6
  require 'socket'
5
7
 
@@ -1,6 +1,8 @@
1
- require 'masscan/parsers/plain_text'
2
- require 'masscan/status'
3
- require 'masscan/banner'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'plain_text'
4
+ require_relative '../status'
5
+ require_relative '../banner'
4
6
 
5
7
  require 'json'
6
8
 
@@ -1,6 +1,8 @@
1
- require 'masscan/parsers/plain_text'
2
- require 'masscan/status'
3
- require 'masscan/banner'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'plain_text'
4
+ require_relative '../status'
5
+ require_relative '../banner'
4
6
 
5
7
  module Masscan
6
8
  module Parsers
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Masscan
2
4
  module Parsers
3
5
  #
@@ -1,3 +1,5 @@
1
- require 'masscan/parsers/binary'
2
- require 'masscan/parsers/list'
3
- require 'masscan/parsers/json'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'parsers/binary'
4
+ require_relative 'parsers/list'
5
+ require_relative 'parsers/json'
@@ -1,4 +1,6 @@
1
- require 'masscan/command'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'command'
2
4
 
3
5
  module Masscan
4
6
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Masscan
2
4
  #
3
5
  # Represents a port status record.
@@ -1,4 +1,6 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Masscan
2
4
  # ruby-masscan version
3
- VERSION = '0.2.1'
5
+ VERSION = '0.2.3'
4
6
  end
data/lib/masscan.rb CHANGED
@@ -1,3 +1,5 @@
1
- require 'masscan/command'
2
- require 'masscan/program'
3
- require 'masscan/output_file'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'masscan/command'
4
+ require_relative 'masscan/program'
5
+ require_relative 'masscan/output_file'
data/ruby-masscan.gemspec CHANGED
@@ -7,10 +7,7 @@ Gem::Specification.new do |gem|
7
7
 
8
8
  gem.name = gemspec.fetch('name')
9
9
  gem.version = gemspec.fetch('version') do
10
- lib_dir = File.join(File.dirname(__FILE__),'lib')
11
- $LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)
12
-
13
- require 'masscan/version'
10
+ require_relative 'lib/masscan/version'
14
11
  Masscan::VERSION
15
12
  end
16
13
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-masscan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Postmodern
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-15 00:00:00.000000000 Z
11
+ date: 2024-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: command_mapper
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  version: '0'
112
112
  requirements:
113
113
  - masscan >= 1.0.0
114
- rubygems_version: 3.3.26
114
+ rubygems_version: 3.4.10
115
115
  signing_key:
116
116
  specification_version: 4
117
117
  summary: A Ruby interface to masscan.