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 +4 -4
- data/.github/workflows/ruby.yml +4 -3
- data/ChangeLog.md +15 -0
- data/README.md +5 -5
- data/lib/masscan/banner.rb +2 -0
- data/lib/masscan/command.rb +10 -8
- data/lib/masscan/output_file.rb +5 -3
- data/lib/masscan/parsers/binary.rb +4 -2
- data/lib/masscan/parsers/json.rb +5 -3
- data/lib/masscan/parsers/list.rb +5 -3
- data/lib/masscan/parsers/plain_text.rb +2 -0
- data/lib/masscan/parsers.rb +5 -3
- data/lib/masscan/program.rb +3 -1
- data/lib/masscan/status.rb +2 -0
- data/lib/masscan/version.rb +3 -1
- data/lib/masscan.rb +5 -3
- data/ruby-masscan.gemspec +1 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10e9abe454a6c9e5715a61cff5b55eb5d29c037d1caf7692ccb937a811b83a3b
|
4
|
+
data.tar.gz: 8807aa7d6f7868f0ed84d0296de265b1ea1bf41a1301e779b767bd678747dc9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75b5b24e0596c0d887b86b9d471c39dbedf966f74b9861db1b4aeb2809b243f6e7ad79b30851aa9c726e3178dda23dd6cbfc938836de750b7ff71772e952746e
|
7
|
+
data.tar.gz: faa1362698c3c0b11acc83d30b7e240d84b7786c17807e5d60d49836c654eaa7efa38f8e0f99144c895b4e308c7815e9c9a834a680cf837feed852516031018a
|
data/.github/workflows/ruby.yml
CHANGED
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/uyTANBgkqhkiG9w0BAQsFADBPMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jM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GlnaWNlcnQuY29tL0RpZ2lDZXJ0VExTUlNBU0hBMjU2MjAyMENBMS5jcmwwPqA8oDqGOGh0dHA6Ly9jcmw0LmRpZ2ljZXJ0LmNv">
|
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
|
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/uyTANBgkqhkiG9w0BAQsFADBPMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMSkwJwYDVQQDEyBEaWdpQ2VydCBUTFMgUlNBIFNIQTI1NiAyMDIwIENBMTAeFw0yMDExMjQwMDAwMDBaFw0yMTEyMjUyMzU5NTlaMIGQMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEUMBIGA1UEBxMLTG9zIEFuZ2VsZXMxPDA6BgNVBAoTM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: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:
|
data/lib/masscan/banner.rb
CHANGED
data/lib/masscan/command.rb
CHANGED
@@ -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:
|
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:
|
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
|
data/lib/masscan/output_file.rb
CHANGED
data/lib/masscan/parsers/json.rb
CHANGED
data/lib/masscan/parsers/list.rb
CHANGED
data/lib/masscan/parsers.rb
CHANGED
data/lib/masscan/program.rb
CHANGED
data/lib/masscan/status.rb
CHANGED
data/lib/masscan/version.rb
CHANGED
data/lib/masscan.rb
CHANGED
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
|
-
|
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.
|
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:
|
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.
|
114
|
+
rubygems_version: 3.4.10
|
115
115
|
signing_key:
|
116
116
|
specification_version: 4
|
117
117
|
summary: A Ruby interface to masscan.
|