hooray 0.1.8 → 0.1.9
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/.gitignore +2 -1
- data/.hound.yml +2 -0
- data/.travis.yml +3 -1
- data/Gemfile +10 -9
- data/MIT-LICENSE +7 -8
- data/README.md +39 -19
- data/Rakefile +1 -1
- data/hooray.gemspec +2 -0
- data/lib/hooray/seek.rb +2 -3
- data/lib/hooray/version.rb +1 -1
- data/spec/hooray/node_spec.rb +4 -2
- metadata +18 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01dbc476c1b307bbc38b11487bcfc8bb1e038041
|
4
|
+
data.tar.gz: 9c7b3175552fbf3c979b4dc03a1a438942b99688
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be790c61d159a70f45a15917a334a25d3628d8178bab7770c8936a011c006a2173ad94aea37594f88b68f75e42575562b2b82ee1f6ff30867baa9747284395ba
|
7
|
+
data.tar.gz: 57354d535ad19aa5becd0ebae1054fcf81b2675e3c42540e2c6236612941286fbc4e0485752005b984bc7cdc3e142b04d0c834eddbb4a7b87f4cb4698c4a8f6f
|
data/.gitignore
CHANGED
data/.hound.yml
ADDED
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -2,13 +2,14 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
|
6
|
-
gem '
|
7
|
-
gem 'rake'
|
8
|
-
gem 'rspec', '>= 3'
|
9
|
-
gem 'rubocop'
|
10
|
-
gem 'guard'
|
11
|
-
gem 'guard-rspec'
|
12
|
-
gem 'guard-rubocop'
|
5
|
+
group :test do
|
6
|
+
gem 'pry'
|
7
|
+
gem 'rake'
|
8
|
+
gem 'rspec', '>= 3'
|
9
|
+
gem 'rubocop'
|
10
|
+
gem 'guard'
|
11
|
+
gem 'guard-rspec'
|
12
|
+
gem 'guard-rubocop'
|
13
13
|
|
14
|
-
gem 'coveralls', require: false if ENV['CI']
|
14
|
+
gem 'coveralls', require: false if ENV['CI']
|
15
|
+
end
|
data/MIT-LICENSE
CHANGED
@@ -1,12 +1,11 @@
|
|
1
|
-
Copyright (c)
|
1
|
+
Copyright (c) 2014-2015 Hooray Authors
|
2
2
|
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
the following conditions:
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
4
|
+
copy of this software and associated documentation files (the "Software"),
|
5
|
+
to deal in the Software without restriction, including without limitation
|
6
|
+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
7
|
+
and/or sell copies of the Software, and to permit persons to whom the
|
8
|
+
Software is furnished to do so, subject to the following conditions:
|
10
9
|
|
11
10
|
The above copyright notice and this permission notice shall be
|
12
11
|
included in all copies or substantial portions of the Software.
|
data/README.md
CHANGED
@@ -1,32 +1,52 @@
|
|
1
|
-
Hooray
|
2
|
-
|
1
|
+
# Hooray
|
2
|
+
[](http://badge.fury.io/rb/hooray)
|
3
|
+
[](https://coveralls.io/r/nofxx/hooray?branch=master)
|
4
|
+
[](https://codeclimate.com/github/nofxx/hooray)
|
5
|
+
[](https://travis-ci.org/nofxx/hooray)
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
, ________
|
10
|
+
/| | \ /
|
11
|
+
|___| __ __ ,_ __, \ /
|
12
|
+
| |\/ \_/ \_/ | / | | | \ /
|
13
|
+
| |/\__/ \__/ |_/\_/|_/ \_/|/ \/
|
14
|
+
/| ()
|
15
|
+
\|
|
16
|
+
|
17
|
+
|
3
18
|
|
4
19
|
Find devices around you. Fast and without hyphens.
|
5
20
|
|
21
|
+
|
22
|
+
## Install
|
23
|
+
|
6
24
|
gem install hooray
|
7
25
|
|
8
26
|
|
9
|
-
|
27
|
+
## Use `hoo`
|
10
28
|
|
11
29
|
|
12
30
|
```
|
13
31
|
hoo list
|
14
32
|
```
|
15
33
|
```
|
16
|
-
NAME | IP
|
17
|
-
|
18
|
-
Motorola Mobility |
|
19
|
-
Giga-byte Technology Co. |
|
20
|
-
Veih's Android |
|
21
|
-
Nery's LG |
|
22
|
-
nofxx's iPhone |
|
23
|
-
LG Electronics |
|
24
|
-
TP-Link |
|
25
|
-
Siemens Subscriber Networks |
|
34
|
+
NAME | IP | MAC
|
35
|
+
----------------------------|------------|------------------
|
36
|
+
Motorola Mobility | 10.1.1.70 | 34:bb:XX:XX:XX:XX
|
37
|
+
Giga-byte Technology Co. | 10.1.1.71 | 94:de:XX:XX:XX:XX
|
38
|
+
Veih's Android | 10.1.1.72 | 04:46:XX:XX:XX:XX
|
39
|
+
Nery's LG | 10.1.1.73 | cc:fa:XX:XX:XX:XX
|
40
|
+
nofxx's iPhone | 10.1.1.77 | 64:a3:XX:XX:XX:XX
|
41
|
+
LG Electronics | 10.1.1.79 | cc:fa:XX:XX:XX:XX
|
42
|
+
TP-Link | 10.1.1.253 | f8:d1:XX:XX:XX:XX
|
43
|
+
Siemens Subscriber Networks | 10.1.1.254 | 00:0b:XX:XX:XX:XX
|
26
44
|
---
|
27
|
-
8
|
45
|
+
8 nodes @ 2015-01-08 00:33:07 -0200 1.27s
|
28
46
|
```
|
29
47
|
|
48
|
+
**That's the idea: 1 second to find a device.**
|
49
|
+
|
30
50
|
|
31
51
|
## Find running services
|
32
52
|
|
@@ -40,7 +60,7 @@ dsl modem | 192.168.1.1 | 64:a3:XX:XX:XX:XX
|
|
40
60
|
test server | 192.168.1.75 | 64:a3:XX:XX:XX:XX
|
41
61
|
nofxx desktop | 192.168.1.77 | 64:a3:XX:XX:XX:XX
|
42
62
|
---
|
43
|
-
3
|
63
|
+
3 nodes @ 2014-12-11 19:23:11 -0200 1.10s
|
44
64
|
```
|
45
65
|
|
46
66
|
Or simply by ports:
|
@@ -80,8 +100,8 @@ You can use any program, not just ssh.
|
|
80
100
|
|
81
101
|
```
|
82
102
|
require 'hooray'
|
83
|
-
Hooray::Seek.lan(port, protocol).
|
84
|
-
Hooray::Seek.new(network, port, protocol).
|
103
|
+
Hooray::Seek.lan(port, protocol).nodes
|
104
|
+
Hooray::Seek.new(network, port, protocol).nodes
|
85
105
|
```
|
86
106
|
|
87
107
|
* Nil port means ICMP ping.
|
@@ -93,8 +113,8 @@ Possible protocols: tcp, udp, http, wmi & icmp (requires root).
|
|
93
113
|
|
94
114
|
## Why?
|
95
115
|
|
96
|
-
Bind macs or fix IP's is also boring and a per device work.
|
97
|
-
As more we use
|
116
|
+
Bind macs or fix IP's is also boring and a per device/node work.
|
117
|
+
As more we use connected (IoT) devices in our company, nmap gets boring.
|
98
118
|
Not to mention slow, there's no easy way to assign names to devices I know,
|
99
119
|
which makes OS scan/port scan a needed option most times (thus making it slower).
|
100
120
|
Also (please open a issue if you know how) even in fast mode nmap won't run in under 2s.
|
data/Rakefile
CHANGED
data/hooray.gemspec
CHANGED
@@ -6,6 +6,7 @@ require 'hooray/version'
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = 'hooray'
|
8
8
|
s.version = Hooray::VERSION
|
9
|
+
s.platform = Gem::Platform::RUBY
|
9
10
|
|
10
11
|
s.authors = ['Marcos Piccinini']
|
11
12
|
s.homepage = 'http://github.com/nofxx/hooray'
|
@@ -22,6 +23,7 @@ Gem::Specification.new do |s|
|
|
22
23
|
s.require_paths = ["lib"]
|
23
24
|
|
24
25
|
s.add_dependency 'thor'
|
26
|
+
s.add_dependency 'psych', '2.0.8'
|
25
27
|
s.add_dependency 'paint'
|
26
28
|
s.add_dependency 'macaddr'
|
27
29
|
s.add_dependency 'net-ping'
|
data/lib/hooray/seek.rb
CHANGED
@@ -11,7 +11,6 @@ module Hooray
|
|
11
11
|
|
12
12
|
def initialize(network = nil, *params)
|
13
13
|
@scan = {}
|
14
|
-
@bots = []
|
15
14
|
config_network network
|
16
15
|
config_filters params
|
17
16
|
end
|
@@ -56,7 +55,7 @@ module Hooray
|
|
56
55
|
# Creates a bot per port on IP
|
57
56
|
def scan_bot(ip)
|
58
57
|
(ports || [nil]).each do |port|
|
59
|
-
|
58
|
+
Thread.new do
|
60
59
|
if ping_class.new(ip.to_s, port, TIMEOUT).ping?
|
61
60
|
@scan[ip] << port
|
62
61
|
print '.'
|
@@ -73,7 +72,7 @@ module Hooray
|
|
73
72
|
@scan[ip] = []
|
74
73
|
scan_bot(ip)
|
75
74
|
end
|
76
|
-
|
75
|
+
Thread.list.reject { |t| t == Thread.current }.each(&:join)
|
77
76
|
@scan.reject! { |_k, v| v.empty? }
|
78
77
|
end
|
79
78
|
|
data/lib/hooray/version.rb
CHANGED
data/spec/hooray/node_spec.rb
CHANGED
@@ -9,8 +9,10 @@ describe 'Node' do
|
|
9
9
|
expect(Node.new(ip: '10.1.1.1').ip).to be_a(IPAddr)
|
10
10
|
end
|
11
11
|
|
12
|
-
|
13
|
-
|
12
|
+
unless ENV['CI']
|
13
|
+
it 'should have mac address' do
|
14
|
+
expect(Node.new(mac: 'aa:cc:dd:ee:ff:gg').mac).to eq('aa:cc:dd:ee:ff:gg')
|
15
|
+
end
|
14
16
|
end
|
15
17
|
|
16
18
|
it 'should have name' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hooray
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcos Piccinini
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: psych
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.0.8
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.0.8
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: paint
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -89,6 +103,7 @@ extra_rdoc_files: []
|
|
89
103
|
files:
|
90
104
|
- ".coveralls.yml"
|
91
105
|
- ".gitignore"
|
106
|
+
- ".hound.yml"
|
92
107
|
- ".travis.yml"
|
93
108
|
- Gemfile
|
94
109
|
- Guardfile
|
@@ -132,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
147
|
version: '0'
|
133
148
|
requirements: []
|
134
149
|
rubyforge_project:
|
135
|
-
rubygems_version: 2.4.
|
150
|
+
rubygems_version: 2.4.5
|
136
151
|
signing_key:
|
137
152
|
specification_version: 4
|
138
153
|
summary: Find devices connected in LAN
|