waps 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +41 -0
- data/lib/waps.rb +5 -2
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44feb99ca1eaedbf4222928c4e09a68476969dcdd18a5e6e0414d8a27ff54c6a
|
4
|
+
data.tar.gz: df55be1c6de6a8c22866e5561636920a932970d57877b6ff257a23b98d2cc09e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69ad813e8149ca3674c32ac7bac07e6946ce171674f9952076a19e31d236c5bf974244468d6ccea73c8c87c955bfbfd6e2c582b03df0ce64a729907c45ad1461
|
7
|
+
data.tar.gz: 0f289df12e7cb243a329b49dbd3ed8802b19d9545527620579bd3c4b2b912dd7adf1f9bb490c3dc6a9da79013fe1eb837552499d9ea17e957c45888afdfc5245
|
data/README.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# Wireless Access Point Scanner - Ruby Gem
|
2
|
+
|
3
|
+
WAPS uses iwlist to scan for wireless access points and convert the output into ruby hash format. Following is the usage of the gem.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
```
|
8
|
+
gem install wasp
|
9
|
+
```
|
10
|
+
Require
|
11
|
+
|
12
|
+
```
|
13
|
+
require 'wasp'
|
14
|
+
```
|
15
|
+
|
16
|
+
## Usage
|
17
|
+
|
18
|
+
* First Require the gem: ``` require 'wasp' ```
|
19
|
+
* Creating new instance require interface name. Leave it empty if not sure. ``` new_scan = Wasp.new('Interface_name')```
|
20
|
+
* Start Scan. ```results = new_scan.scan```
|
21
|
+
* Get specific field. ``` mac_address = new_scan.get('address') ```
|
22
|
+
|
23
|
+
## Response Field
|
24
|
+
|
25
|
+
* Address
|
26
|
+
* SSID
|
27
|
+
* Signal Level
|
28
|
+
* Encryption
|
29
|
+
* Channel
|
30
|
+
* Frequency
|
31
|
+
* Quality
|
32
|
+
|
33
|
+
## Authors
|
34
|
+
|
35
|
+
* **Gurjant Singh** - *Initial work* - [gurjant31](https://github.com/gurjant31)
|
36
|
+
|
37
|
+
See also the list of [contributors](https://github.com/gurjant31/waps/contributors) who participated in this project.
|
38
|
+
|
39
|
+
## License
|
40
|
+
|
41
|
+
This project is licensed under the MIT License - see the LICENSE.md file for details
|
data/lib/waps.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'open3'
|
2
|
+
|
1
3
|
class Waps
|
2
4
|
|
3
5
|
def initialize(interface_name)
|
@@ -7,7 +9,7 @@ class Waps
|
|
7
9
|
|
8
10
|
def scan
|
9
11
|
raw_input = run_command
|
10
|
-
@output = parse(raw_input)
|
12
|
+
@output = (raw_input.keys.include? :error) ? raw_input : parse(raw_input[:output])
|
11
13
|
end
|
12
14
|
|
13
15
|
def parse(raw_input)
|
@@ -17,7 +19,8 @@ class Waps
|
|
17
19
|
end
|
18
20
|
|
19
21
|
def run_command
|
20
|
-
|
22
|
+
output,error,status = Open3.capture3("sudo iwlist #{@interface_name} scan")
|
23
|
+
return output == "" ? {error: error} : {output: output}
|
21
24
|
end
|
22
25
|
|
23
26
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: waps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gurjant Singh
|
@@ -29,8 +29,10 @@ email:
|
|
29
29
|
- waps@defensestation.ca
|
30
30
|
executables: []
|
31
31
|
extensions: []
|
32
|
-
extra_rdoc_files:
|
32
|
+
extra_rdoc_files:
|
33
|
+
- README.md
|
33
34
|
files:
|
35
|
+
- README.md
|
34
36
|
- lib/waps.rb
|
35
37
|
homepage: https://github.com/gurjant31/waps
|
36
38
|
licenses:
|