arp_scan 0.1.2 → 0.1.3

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: 35970ca5fd7010c821b2a553e4852e0b3e4cbccf186aa57a1ce26ac0ad6c049c
4
- data.tar.gz: 1c63484f637139d6de689c29e9014ecce4d222506bc837c33a4edd75802944b4
3
+ metadata.gz: e9acd4f2a06b8706a4991c24b6ed5ddce3e71f280440a1bfec82e2155c76375c
4
+ data.tar.gz: 26bef346fb5f6ee4f5c97dee98283c44b8b443fe7065e130ca9698c2ed569734
5
5
  SHA512:
6
- metadata.gz: da55cbe303db00aca3fa6fa24818cedbf40f525b329d986a56cd5d9dfe16071a7f84e2c2a7fe74c9172e3e5debd0077a5337d51cd4942eba022289bd3bf09e21
7
- data.tar.gz: 80c489f8604c905e732bb13fb48c7d2a3f13a8e923a28d71cb68e5d74774b1359805b160c02ea46bba5ee71ca8af16b9597674fed9b8cdd1de7231bb82223dab
6
+ metadata.gz: 01af8e6a6a14daca95e60cc39ea2d529163019c48741bbcf0d70e527becd0b8c01ec43d9938b6e1e9c88efaa5ed36affce1fe6dd860df6dc0c1102c2652b99b4
7
+ data.tar.gz: 5665f838a56d966809fbeedc527efcbc9753677cc51847cacfe39af8b0177d8f54bcd95fd46fbbfa05b028026e433dee93f28da9bf019fe55dd409b554cd2db0
data/README.md CHANGED
@@ -75,10 +75,18 @@ first_host.mac => '00:11:22:33:44:55'
75
75
  first_host.oui => "NIC Manufacturer"
76
76
  ```
77
77
 
78
+ ## Build the Gem
79
+
80
+ ```shell
81
+ bundle exec rake build
82
+ ```
83
+
84
+ This writes the packaged gem to `pkg/`.
85
+
78
86
  ## Run the Tests
79
- ```ruby
80
- cd arp_scan/spec
81
- rspec .
87
+
88
+ ```shell
89
+ bundle exec rake spec
82
90
  ```
83
91
 
84
92
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ARPScan
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arp_scan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Rodrigues
@@ -16,26 +16,14 @@ executables: []
16
16
  extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
- - ".gitignore"
20
- - Gemfile
21
- - Gemfile.lock
22
19
  - LICENSE.txt
23
20
  - README.md
24
- - arp_scan.gemspec
25
21
  - lib/arp_scan.rb
26
22
  - lib/arp_scan/arp_scanner.rb
27
23
  - lib/arp_scan/host.rb
28
24
  - lib/arp_scan/scan_report.rb
29
25
  - lib/arp_scan/scan_result_processor.rb
30
26
  - lib/arp_scan/version.rb
31
- - spec/arp_scan_spec.rb
32
- - spec/arp_scanner_spec.rb
33
- - spec/host_spec.rb
34
- - spec/scan_report_spec.rb
35
- - spec/scan_result_processor_spec.rb
36
- - spec/spec_helper.rb
37
- - spec/test_output.txt
38
- - spec/test_output_2.txt
39
27
  homepage: https://github.com/mikerodrigues/arp_scan
40
28
  licenses:
41
29
  - MIT
@@ -57,12 +45,4 @@ requirements: []
57
45
  rubygems_version: 3.7.1
58
46
  specification_version: 4
59
47
  summary: A ruby wrapper for the arp-scan utility.
60
- test_files:
61
- - spec/arp_scan_spec.rb
62
- - spec/arp_scanner_spec.rb
63
- - spec/host_spec.rb
64
- - spec/scan_report_spec.rb
65
- - spec/scan_result_processor_spec.rb
66
- - spec/spec_helper.rb
67
- - spec/test_output.txt
68
- - spec/test_output_2.txt
48
+ test_files: []
data/.gitignore DELETED
@@ -1 +0,0 @@
1
- *.gem
data/Gemfile DELETED
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- group :test do
6
- gem 'rspec'
7
- gem 'rspec-support', '~>3.0.0'
8
- end
9
-
10
- # Specify your gem's dependencies in arp_scan.gemspec
11
- # gemspec
data/Gemfile.lock DELETED
@@ -1,26 +0,0 @@
1
- GEM
2
- remote: https://rubygems.org/
3
- specs:
4
- diff-lcs (1.4.4)
5
- rspec (3.0.0)
6
- rspec-core (~> 3.0.0)
7
- rspec-expectations (~> 3.0.0)
8
- rspec-mocks (~> 3.0.0)
9
- rspec-core (3.0.4)
10
- rspec-support (~> 3.0.0)
11
- rspec-expectations (3.0.4)
12
- diff-lcs (>= 1.2.0, < 2.0)
13
- rspec-support (~> 3.0.0)
14
- rspec-mocks (3.0.4)
15
- rspec-support (~> 3.0.0)
16
- rspec-support (3.0.4)
17
-
18
- PLATFORMS
19
- x86_64-linux
20
-
21
- DEPENDENCIES
22
- rspec
23
- rspec-support (~> 3.0.0)
24
-
25
- BUNDLED WITH
26
- 2.2.15
data/arp_scan.gemspec DELETED
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- lib = File.expand_path('lib', __dir__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'arp_scan/version'
6
-
7
- Gem::Specification.new do |spec|
8
- spec.name = 'arp_scan'
9
- spec.version = ARPScan::VERSION
10
- spec.authors = ['Michael Rodrigues']
11
- spec.email = ['mikebrodrigues@gmail.com']
12
- spec.summary = 'A ruby wrapper for the arp-scan utility.'
13
- spec.description = 'Use the arp-scan utility from your ruby programs.'
14
- spec.homepage = 'https://github.com/mikerodrigues/arp_scan'
15
- spec.license = 'MIT'
16
-
17
- spec.files = `git ls-files -z`.split("\x0")
18
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
- spec.require_paths = ['lib']
21
- end
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative './spec_helper'
4
-
5
- RSpec.describe ARPScan do
6
- ARPScan('-l')
7
- it 'is a method' do
8
- expect(ARPScan.respond_to?('__send__')).to eq(true)
9
- end
10
- end
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative './spec_helper'
4
-
5
- module ARPScan
6
- describe ARPScanner do
7
- describe '#scan' do
8
- it 'accepts arp-scan arguments as a string' do
9
- expect(ARPScanner.scan('-l').class).to eq(ScanReport)
10
- end
11
- end
12
- end
13
- end
data/spec/host_spec.rb DELETED
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative './spec_helper'
4
-
5
- module ARPScan
6
- describe Host do
7
- host = Host.new('10.0.0.1', '00:11:22:33:44:55', 'NIC Manufacturer')
8
-
9
- describe '#ip_addr' do
10
- it "returns the host's IP address" do
11
- expect(host.ip_addr).to eq('10.0.0.1')
12
- end
13
- end
14
-
15
- describe '#mac' do
16
- it "returns the host's MAC address" do
17
- expect(host.mac).to eq('00:11:22:33:44:55')
18
- end
19
- end
20
-
21
- describe '#oui' do
22
- it "returns the host's OUI information" do
23
- expect(host.oui).to eq('NIC Manufacturer')
24
- end
25
- end
26
- end
27
- end
@@ -1,76 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative './spec_helper'
4
-
5
- module ARPScan
6
- describe ScanReport do
7
- report_hash = {
8
- hosts: [Host.new('10.0.0.1', '00:11:22:33:44:55', 'NIC Manufacturer')],
9
- interface: 'eth0',
10
- datalink: 'EN10MB (Ethernet)',
11
- version: '1.8.1',
12
- range_size: 256,
13
- scan_time: 1.503,
14
- scan_rate: 170.33,
15
- reply_count: 1,
16
- arguments: '-l'
17
- }
18
-
19
- scan_report = ScanReport.new(report_hash)
20
-
21
- describe '#hosts' do
22
- it 'returns an Array of Host objects' do
23
- expect(scan_report.hosts.class).to eq(Array)
24
- expect(scan_report.hosts.first.class).to eq(Host)
25
- end
26
- end
27
-
28
- describe '#interface' do
29
- it 'returns the network interface used to scan' do
30
- expect(scan_report.interface).to eq('eth0')
31
- end
32
- end
33
-
34
- describe '#datalink' do
35
- it 'returns the datalink type of the network interface used to scan' do
36
- expect(scan_report.datalink).to eq('EN10MB (Ethernet)')
37
- end
38
- end
39
-
40
- describe '#version' do
41
- it 'returns the version of `arp-scan` used for the scan' do
42
- expect(scan_report.version).to eq('1.8.1')
43
- end
44
- end
45
-
46
- describe '#range_size' do
47
- it 'returns the size of the range of scanned IPs' do
48
- expect(scan_report.range_size).to eq(256)
49
- end
50
- end
51
-
52
- describe '#scan_time' do
53
- it 'returns the duration of the scan in seconds' do
54
- expect(scan_report.scan_time).to eq(1.503)
55
- end
56
- end
57
-
58
- describe '#scan_rate' do
59
- it 'returns the scan rate in hosts per second' do
60
- expect(scan_report.scan_rate).to eq(170.33)
61
- end
62
- end
63
-
64
- describe '#reply_count' do
65
- it 'returns the number of hosts that responded' do
66
- expect(scan_report.reply_count).to eq(1)
67
- end
68
- end
69
-
70
- describe '#arguments' do
71
- it 'returns the argument string used to scan' do
72
- expect(scan_report.arguments).to eq('-l')
73
- end
74
- end
75
- end
76
- end
@@ -1,67 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative './spec_helper'
4
-
5
- module ARPScan
6
- describe ScanResultProcessor do
7
- argument_string = '-l'
8
- report_string = File.read './test_output.txt'
9
- report_string_2 = File.read './test_output_2.txt'
10
- report = ARPScan::ScanResultProcessor.process(report_string, argument_string)
11
- report_2 = ARPScan::ScanResultProcessor.process(report_string_2, argument_string)
12
-
13
- describe '#process' do
14
- it 'processes arp-scan output to create a ScanReport object' do
15
- expect(report.class).to eq(ARPScan::ScanReport)
16
- expect(report_2.class).to eq(ARPScan::ScanReport)
17
- end
18
-
19
- it 'builds an array of Host objects' do
20
- expect(report.hosts[0].class).to eq(ARPScan::Host)
21
- expect(report_2.hosts[0].class).to eq(ARPScan::Host)
22
- end
23
-
24
- it 'parses the scan interface name' do
25
- expect(report.interface).to eq('eth0')
26
- expect(report_2.interface).to eq('enp4s0')
27
- end
28
-
29
- it 'parses the datalink type information' do
30
- expect(report.datalink).to eq('EN10MB (Ethernet)')
31
- expect(report_2.datalink).to eq('EN10MB')
32
- end
33
-
34
- it 'parses the ip of the scanner on newer versions of arp-scan' do
35
- expect(report_2.ipv4).to eq('10.0.0.5')
36
- end
37
-
38
- it 'parses the MAC of the scanner on newer versions of arp-scan' do
39
- expect(report_2.mac).to eq('a1:b2:c3:d4:e5:f6')
40
- end
41
-
42
- it 'parses the version of arp-scan that ran the scan' do
43
- expect(report.version).to eq('1.8.1')
44
- end
45
-
46
- it 'parses the number of hosts scanned' do
47
- expect(report.range_size).to eq(256)
48
- end
49
-
50
- it 'parses the duration of the scan in seconds' do
51
- expect(report.scan_time).to eq(1.494)
52
- end
53
-
54
- it 'parses the rate of the scan in hosts per second' do
55
- expect(report.scan_rate).to eq(171.35)
56
- end
57
-
58
- it 'parses the number of hosts that responded to the scan' do
59
- expect(report.reply_count).to eq(1)
60
- end
61
-
62
- it 'includes the argument string in the report' do
63
- expect(report.arguments).to eq('-l')
64
- end
65
- end
66
- end
67
- end
data/spec/spec_helper.rb DELETED
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require '../lib/arp_scan'
data/spec/test_output.txt DELETED
@@ -1,6 +0,0 @@
1
- Interface: eth0, datalink type: EN10MB (Ethernet)
2
- Starting arp-scan 1.8.1 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)
3
- 10.0.0.1 00:11:22:33:44:55 NIC Manufacturer
4
-
5
- 1 packets received by filter, 0 packets dropped by kernel
6
- Ending arp-scan 1.8.1: 256 hosts scanned in 1.494 seconds (171.35 hosts/sec). 1 responded
@@ -1,9 +0,0 @@
1
- Interface: enp4s0, type: EN10MB, MAC: a1:b2:c3:d4:e5:f6, IPv4: 10.0.0.5
2
- Starting arp-scan 1.10.0 with 256 hosts (https://github.com/royhills/arp-scan)
3
- 10.0.0.1 11:22:33:44:55:66 GL Technologies (Hong Kong) Limited
4
- 10.0.0.100 aa:bb:cc:dd:ee:ff SHENZHEN ZHIBOTONG ELECTRONICS CO.,LTD
5
- 10.0.0.213 1a:2b:3c:4d:e5:f6 (Unknown)
6
-
7
- 3 packets received by filter, 0 packets dropped by kernel
8
- Ending arp-scan 1.10.0: 256 hosts scanned in 1.965 seconds (130.28 hosts/sec). 3 responded
9
-