network_interface 0.0.1 → 0.0.2
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 +7 -0
- data/.gitignore +1 -0
- data/Gemfile.lock +20 -12
- data/bin/list_interfaces.rb +52 -0
- data/ext/network_interface_ext/netifaces.c +1 -1
- data/ext/network_interface_ext/netifaces.h +1 -0
- data/lib/network_interface/version.rb +1 -1
- metadata +21 -35
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 52fb1a0e9f04f0062700dce9cd2afc292c7b15c9
|
4
|
+
data.tar.gz: ab551e02256081dd51b60606ac8665a4fdac489f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: bc7398db2eb281e5348898ca0af4e99a53aa0db0eaef22740915dbebfd323a043106cd842c7350e6d0e7394a6bc448df9635a52f4b7c1c4d34d2b626ae11de9c
|
7
|
+
data.tar.gz: 2dc7d93eed2dfa8a778d64c615619505e0188f10f7f0b505486559fbb7447397f482668496c5a7316067953e3ada5abf70f1d26ac55e6af29d7921c62ce9912c
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,23 +1,28 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
network_interface (0.0.
|
4
|
+
network_interface (0.0.2)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
diff-lcs (1.
|
10
|
-
rake (
|
11
|
-
rake-compiler (0.
|
9
|
+
diff-lcs (1.3)
|
10
|
+
rake (12.0.0)
|
11
|
+
rake-compiler (1.0.4)
|
12
12
|
rake
|
13
|
-
rspec (
|
14
|
-
rspec-core (~>
|
15
|
-
rspec-expectations (~>
|
16
|
-
rspec-mocks (~>
|
17
|
-
rspec-core (
|
18
|
-
|
19
|
-
|
20
|
-
|
13
|
+
rspec (3.6.0)
|
14
|
+
rspec-core (~> 3.6.0)
|
15
|
+
rspec-expectations (~> 3.6.0)
|
16
|
+
rspec-mocks (~> 3.6.0)
|
17
|
+
rspec-core (3.6.0)
|
18
|
+
rspec-support (~> 3.6.0)
|
19
|
+
rspec-expectations (3.6.0)
|
20
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
21
|
+
rspec-support (~> 3.6.0)
|
22
|
+
rspec-mocks (3.6.0)
|
23
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
24
|
+
rspec-support (~> 3.6.0)
|
25
|
+
rspec-support (3.6.0)
|
21
26
|
|
22
27
|
PLATFORMS
|
23
28
|
ruby
|
@@ -28,3 +33,6 @@ DEPENDENCIES
|
|
28
33
|
rake
|
29
34
|
rake-compiler
|
30
35
|
rspec
|
36
|
+
|
37
|
+
BUNDLED WITH
|
38
|
+
1.15.4
|
@@ -0,0 +1,52 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# $Id$
|
4
|
+
# $Revision$
|
5
|
+
#
|
6
|
+
# This small utility will display all the informations about the network interfaces
|
7
|
+
# that one can use under Windows with modules using pcaprub and having the INTERFACE option (ex: arp_poisonning, arp_sweep, ...).
|
8
|
+
# To use th interface option under Windows use the Index value displayed by this tool (ex: "SET INTERFACE 1")
|
9
|
+
#
|
10
|
+
#
|
11
|
+
|
12
|
+
begin
|
13
|
+
require 'network_interface'
|
14
|
+
rescue ::Exception => e
|
15
|
+
$stderr.puts "Error: NetworkInterface is not installed..."
|
16
|
+
exit
|
17
|
+
end
|
18
|
+
|
19
|
+
found = false
|
20
|
+
NetworkInterface.interfaces.each_with_index do |iface, i|
|
21
|
+
found = true
|
22
|
+
detail = NetworkInterface.interface_info(iface)
|
23
|
+
addr = NetworkInterface.addresses(iface)
|
24
|
+
puts "#" * 70
|
25
|
+
puts ""
|
26
|
+
puts "INDEX : " + (i + 1).to_s
|
27
|
+
if detail
|
28
|
+
puts "NAME : " + detail["name"]
|
29
|
+
puts "DESCRIPTION : " + detail["description"]
|
30
|
+
puts "GUID : " + detail["guid"]
|
31
|
+
else
|
32
|
+
puts "NAME : " + iface
|
33
|
+
end
|
34
|
+
if addr[NetworkInterface::AF_LINK][0]['addr']
|
35
|
+
puts "MAC ADDRESS : #{addr[NetworkInterface::AF_LINK][0]['addr']}"
|
36
|
+
else
|
37
|
+
puts "MAC ADDRESS : NONE"
|
38
|
+
end
|
39
|
+
if addr && addr[NetworkInterface::AF_INET]
|
40
|
+
addr[NetworkInterface::AF_INET].each do |ip4|
|
41
|
+
puts "IP ADDRESS : #{ip4['addr']}/#{ip4['netmask']}"
|
42
|
+
end
|
43
|
+
else
|
44
|
+
puts "IP ADDRESS : NONE"
|
45
|
+
end
|
46
|
+
puts ""
|
47
|
+
end
|
48
|
+
if found
|
49
|
+
puts "#" * 70
|
50
|
+
else
|
51
|
+
$stderr.puts "Error, no network interfaces have been detected"
|
52
|
+
end
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: network_interface
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Brandon Turner
|
@@ -10,90 +9,84 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 2017-08-29 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: bundler
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
17
|
requirements:
|
20
|
-
- - ~>
|
18
|
+
- - "~>"
|
21
19
|
- !ruby/object:Gem::Version
|
22
20
|
version: '1.3'
|
23
21
|
type: :development
|
24
22
|
prerelease: false
|
25
23
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
24
|
requirements:
|
28
|
-
- - ~>
|
25
|
+
- - "~>"
|
29
26
|
- !ruby/object:Gem::Version
|
30
27
|
version: '1.3'
|
31
28
|
- !ruby/object:Gem::Dependency
|
32
29
|
name: rake
|
33
30
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
31
|
requirements:
|
36
|
-
- -
|
32
|
+
- - ">="
|
37
33
|
- !ruby/object:Gem::Version
|
38
34
|
version: '0'
|
39
35
|
type: :development
|
40
36
|
prerelease: false
|
41
37
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
38
|
requirements:
|
44
|
-
- -
|
39
|
+
- - ">="
|
45
40
|
- !ruby/object:Gem::Version
|
46
41
|
version: '0'
|
47
42
|
- !ruby/object:Gem::Dependency
|
48
43
|
name: rake-compiler
|
49
44
|
requirement: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
45
|
requirements:
|
52
|
-
- -
|
46
|
+
- - ">="
|
53
47
|
- !ruby/object:Gem::Version
|
54
48
|
version: '0'
|
55
49
|
type: :development
|
56
50
|
prerelease: false
|
57
51
|
version_requirements: !ruby/object:Gem::Requirement
|
58
|
-
none: false
|
59
52
|
requirements:
|
60
|
-
- -
|
53
|
+
- - ">="
|
61
54
|
- !ruby/object:Gem::Version
|
62
55
|
version: '0'
|
63
56
|
- !ruby/object:Gem::Dependency
|
64
57
|
name: rspec
|
65
58
|
requirement: !ruby/object:Gem::Requirement
|
66
|
-
none: false
|
67
59
|
requirements:
|
68
|
-
- -
|
60
|
+
- - ">="
|
69
61
|
- !ruby/object:Gem::Version
|
70
62
|
version: '0'
|
71
63
|
type: :development
|
72
64
|
prerelease: false
|
73
65
|
version_requirements: !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
66
|
requirements:
|
76
|
-
- -
|
67
|
+
- - ">="
|
77
68
|
- !ruby/object:Gem::Version
|
78
69
|
version: '0'
|
79
|
-
description:
|
70
|
+
description: "\n This gem was originally added to the Metasploit Pcaprub gem.
|
80
71
|
It's been spun\n out into its own gem for anyone who might want to programmatically
|
81
72
|
get\n information on their network interfaces. "
|
82
73
|
email:
|
83
74
|
- lance.sanchez@rapid7.com
|
84
75
|
- brandon_turner@rapid7.com
|
85
|
-
executables:
|
76
|
+
executables:
|
77
|
+
- list_interfaces.rb
|
86
78
|
extensions:
|
87
79
|
- ext/network_interface_ext/extconf.rb
|
88
80
|
extra_rdoc_files: []
|
89
81
|
files:
|
90
|
-
- .gitignore
|
91
|
-
- .rspec
|
82
|
+
- ".gitignore"
|
83
|
+
- ".rspec"
|
92
84
|
- Gemfile
|
93
85
|
- Gemfile.lock
|
94
86
|
- LICENSE
|
95
87
|
- README.md
|
96
88
|
- Rakefile
|
89
|
+
- bin/list_interfaces.rb
|
97
90
|
- ext/network_interface_ext/extconf.rb
|
98
91
|
- ext/network_interface_ext/netifaces.c
|
99
92
|
- ext/network_interface_ext/netifaces.h
|
@@ -105,33 +98,26 @@ files:
|
|
105
98
|
homepage: https://github.com/rapid7/network_interface
|
106
99
|
licenses:
|
107
100
|
- MIT
|
101
|
+
metadata: {}
|
108
102
|
post_install_message:
|
109
103
|
rdoc_options: []
|
110
104
|
require_paths:
|
111
105
|
- lib
|
112
106
|
required_ruby_version: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
107
|
requirements:
|
115
|
-
- -
|
108
|
+
- - ">="
|
116
109
|
- !ruby/object:Gem::Version
|
117
110
|
version: '0'
|
118
|
-
segments:
|
119
|
-
- 0
|
120
|
-
hash: -3620416272362916495
|
121
111
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
|
-
none: false
|
123
112
|
requirements:
|
124
|
-
- -
|
113
|
+
- - ">="
|
125
114
|
- !ruby/object:Gem::Version
|
126
115
|
version: '0'
|
127
|
-
segments:
|
128
|
-
- 0
|
129
|
-
hash: -3620416272362916495
|
130
116
|
requirements: []
|
131
117
|
rubyforge_project:
|
132
|
-
rubygems_version:
|
118
|
+
rubygems_version: 2.6.13
|
133
119
|
signing_key:
|
134
|
-
specification_version:
|
120
|
+
specification_version: 4
|
135
121
|
summary: A cross platform gem to help get network interface information
|
136
122
|
test_files:
|
137
123
|
- spec/netiface_spec.rb
|