arp_scan 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +23 -14
- data/lib/arp_scan/output_processor.rb +1 -2
- data/lib/arp_scan/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a350836a9cf6579fa714992273f38bce584c7457
|
4
|
+
data.tar.gz: d118e275d8c1c3e3b3e0f10588752cf96fe90ab8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 029d7744afbcb0a3c6bc5474bcf0f868696d33d489f44a01a1e2b4927510959acfb7c8f7ecfca5eef31c216b05422db1d397b622bd0f94b3cd2dac3a499562b5
|
7
|
+
data.tar.gz: 144b8459b0c4b3b9c5997895a6790b281b1f1be5737ee9371aa2366ee764385b191fedce487b84e23c1f53198f5ed90ebf237eaeccbf55baed091918c9749787
|
data/README.md
CHANGED
@@ -31,10 +31,16 @@ This code is untested and will hopefully be refactored soon.
|
|
31
31
|
|
32
32
|
Add this line to your application's Gemfile:
|
33
33
|
|
34
|
+
From GitHub:
|
34
35
|
```ruby
|
35
36
|
gem 'arp_scan', :git => 'git://github.com/mikerodrigues/arp_scan.git'
|
36
37
|
```
|
37
38
|
|
39
|
+
From RubyGems:
|
40
|
+
```ruby
|
41
|
+
gem 'arp_scan'
|
42
|
+
```
|
43
|
+
|
38
44
|
And then execute:
|
39
45
|
|
40
46
|
$ bundle
|
@@ -52,26 +58,29 @@ metainfo about the scan itself.
|
|
52
58
|
|
53
59
|
Scanning is easy:
|
54
60
|
|
55
|
-
|
61
|
+
```ruby
|
62
|
+
require 'arp_scan'
|
56
63
|
|
57
|
-
|
64
|
+
report = ARPScan('--localnet')
|
58
65
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
+
report.datalink => "EN10MB (Ethernet)"
|
67
|
+
report.interface => "eth0"
|
68
|
+
report.range_size => 256
|
69
|
+
report.reply_count => 2
|
70
|
+
report.scan_rate => 169.99 # hosts/sec
|
71
|
+
report.scan_time => 1.586 # seconds
|
72
|
+
report.version => "1.8.1" # arp-scan version
|
73
|
+
```
|
66
74
|
|
67
75
|
Each `ScanReport` also holds zero or more `Host` objects representing founds
|
68
76
|
hosts:
|
69
77
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
78
|
+
```ruby
|
79
|
+
first_host = report.hosts.first
|
80
|
+
first_host.ip_addr => '10.0.0.1'
|
81
|
+
first_host.mac => '00:11:22:33:44:55'
|
82
|
+
first_host.oui => "NIC Manufacturer"
|
83
|
+
```
|
75
84
|
|
76
85
|
|
77
86
|
|
@@ -10,7 +10,7 @@ module ARPScan
|
|
10
10
|
|
11
11
|
def self.process(string)
|
12
12
|
report = {}
|
13
|
-
report[:hosts] = string.scan(Host_Entry_Regex)
|
13
|
+
report[:hosts] = string.scan(Host_Entry_Regex).map {|entry| Host.new(*entry)}
|
14
14
|
report[:interface],
|
15
15
|
report[:datalink] = string.scan(Interface_Summary_Regex)[0]
|
16
16
|
report[:version],
|
@@ -18,7 +18,6 @@ module ARPScan
|
|
18
18
|
report[:scan_time],
|
19
19
|
report[:scan_rate],
|
20
20
|
report[:reply_count] = string.scan(Received_Summary_Regex)[0]
|
21
|
-
hosts = report[:hosts].map {|entry| Host.new(*entry)}
|
22
21
|
ScanReport.new(report)
|
23
22
|
end
|
24
23
|
end
|
data/lib/arp_scan/version.rb
CHANGED