arp_scan 0.0.5 → 0.0.6
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 +4 -4
- data/lib/arp_scan/host.rb +12 -1
- data/lib/arp_scan/scan_report.rb +30 -1
- data/lib/arp_scan/scan_result_processor.rb +8 -1
- data/lib/arp_scan/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0da554d94d3c4a4ad2f5e0f8f8d8715a3d2f577
|
4
|
+
data.tar.gz: 8fe6d25d5d0db6f24dc38a5b0da2221d15ccaabb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c511bd3dd089abe3b23146222906d592694b1fede141ef48d211eeaee431a6c3a362846dadd0733d91b60ed978197b78c5984c8679ca2f0dedbffbf9833a0882
|
7
|
+
data.tar.gz: 91db2dd695ac6c36580ec84f19bbbd22c19821559b45580aa4b2a19df2fc510abb053699688932d6d85779f9c77d30c2ea8c3da7fdd6b539a0db00da36a9f4df
|
data/lib/arp_scan/host.rb
CHANGED
@@ -2,7 +2,18 @@ module ARPScan
|
|
2
2
|
# Abstracts replying hosts from the arp-scan output.
|
3
3
|
#
|
4
4
|
class Host
|
5
|
-
|
5
|
+
|
6
|
+
# The IP address of the host.
|
7
|
+
#
|
8
|
+
attr_reader :ip_addr
|
9
|
+
|
10
|
+
# The MAC address of the host.
|
11
|
+
#
|
12
|
+
attr_reader :mac
|
13
|
+
|
14
|
+
# OUI information about the host.
|
15
|
+
#
|
16
|
+
attr_reader :oui
|
6
17
|
|
7
18
|
# Create a new hsot. IP address, MAC address and OUI information are
|
8
19
|
# expected.
|
data/lib/arp_scan/scan_report.rb
CHANGED
@@ -5,7 +5,36 @@ module ARPScan
|
|
5
5
|
#
|
6
6
|
class ScanReport
|
7
7
|
|
8
|
-
|
8
|
+
# Array of Host objects.
|
9
|
+
#
|
10
|
+
attr_reader :hosts
|
11
|
+
|
12
|
+
# Name of the interface used for the scan.
|
13
|
+
#
|
14
|
+
attr_reader :interface
|
15
|
+
|
16
|
+
# Information about the interface type.
|
17
|
+
#
|
18
|
+
attr_reader :datalink
|
19
|
+
|
20
|
+
# `arp-scan` version number.
|
21
|
+
#
|
22
|
+
attr_reader :version
|
23
|
+
|
24
|
+
# Size of the scan range ( # of hosts scanned ).
|
25
|
+
#
|
26
|
+
attr_reader :range_size
|
27
|
+
|
28
|
+
# Duration of the scan in seconds, returns a Float.
|
29
|
+
#
|
30
|
+
attr_reader :scan_time
|
31
|
+
|
32
|
+
# The rate of the scan in hosts per second, returns a Float.
|
33
|
+
#
|
34
|
+
attr_reader :scan_rate
|
35
|
+
|
36
|
+
# The number of hosts that replied to the scan, returns a Fixnum
|
37
|
+
attr_reader :reply_count
|
9
38
|
|
10
39
|
# Create a new scan report, passing in every attribute. The best way to do
|
11
40
|
# this is with the ScanResultProcessor module.
|
@@ -7,10 +7,17 @@ module ARPScan
|
|
7
7
|
#
|
8
8
|
module ScanResultProcessor
|
9
9
|
|
10
|
-
#
|
10
|
+
# Regex to capture IP address, MAC address, and OUI information
|
11
11
|
#
|
12
12
|
Host_Entry_Regex = /(\d+.\d+.\d+.\d+)\s(\w\w:\w\w:\w\w:\w\w:\w\w:\w\w)\s(.*)/
|
13
|
+
|
14
|
+
# Regex to capture interface and datalink
|
15
|
+
#
|
13
16
|
Interface_Summary_Regex = /Interface: (?<interface>.+), datalink type: (?<datalink>.*$)/
|
17
|
+
|
18
|
+
# Regex to capture arp-scan version, scan range size, scan time, scan rate,
|
19
|
+
# and the number of responding hosts.
|
20
|
+
#
|
14
21
|
Scan_Summary_Regex = /Ending arp-scan (?<version>.*): (?<range_size>.*) hosts scanned in (?<scan_time>.*) seconds \((?<scan_rate>.*) hosts\/sec\). (?<reply_count>.*) responded/
|
15
22
|
|
16
23
|
# This method does the actual processing of the arp-scan result string. It
|
data/lib/arp_scan/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arp_scan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Rodrigues
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|