pwn 0.5.47 → 0.5.50
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/README.md +3 -3
- data/bin/pwn_gqrx_scanner +71 -26
- data/lib/pwn/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 154afb0d351151e4fa856779ea706f70e4032e8dd0efb4f469c8c2ac6fdf073a
|
4
|
+
data.tar.gz: 2ee1306939c069af7a6784c23593c2734e2f675d92856e06d2f1bdc4f3bc7195
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4707bb48b5e013cb085df46675aacc9c0288013d1d5900bd81235a78a1d2bd7d1ac23719ed1d7107abbc25dc4cb2d69521a0abfe2d895d9dd2bcf7a36147d298
|
7
|
+
data.tar.gz: 5524ea205fc1486c79a3e575404abd58c8f458e8291528b5c4d8dc8f375f05b2486dfcad12c4f8839e147de2ca40eacf54a581709284cefc9c259b3ec4e3d783
|
data/README.md
CHANGED
@@ -37,7 +37,7 @@ $ cd /opt/pwn
|
|
37
37
|
$ ./install.sh
|
38
38
|
$ ./install.sh ruby-gem
|
39
39
|
$ pwn
|
40
|
-
pwn[v0.5.
|
40
|
+
pwn[v0.5.50]:001 >>> PWN.help
|
41
41
|
```
|
42
42
|
|
43
43
|
[](https://youtu.be/G7iLUY4FzsI)
|
@@ -52,7 +52,7 @@ $ rvm use ruby-3.3.0@pwn
|
|
52
52
|
$ gem uninstall --all --executables pwn
|
53
53
|
$ gem install --verbose pwn
|
54
54
|
$ pwn
|
55
|
-
pwn[v0.5.
|
55
|
+
pwn[v0.5.50]:001 >>> PWN.help
|
56
56
|
```
|
57
57
|
|
58
58
|
If you're using a multi-user install of RVM do:
|
@@ -62,7 +62,7 @@ $ rvm use ruby-3.3.0@pwn
|
|
62
62
|
$ rvmsudo gem uninstall --all --executables pwn
|
63
63
|
$ rvmsudo gem install --verbose pwn
|
64
64
|
$ pwn
|
65
|
-
pwn[v0.5.
|
65
|
+
pwn[v0.5.50]:001 >>> PWN.help
|
66
66
|
```
|
67
67
|
|
68
68
|
PWN periodically upgrades to the latest version of Ruby which is reflected in `/opt/pwn/.ruby-version`. The easiest way to upgrade to the latest version of Ruby from a previous PWN installation is to run the following script:
|
data/bin/pwn_gqrx_scanner
CHANGED
@@ -10,8 +10,8 @@ OptionParser.new do |options|
|
|
10
10
|
#{$PROGRAM_NAME} [opts]
|
11
11
|
"
|
12
12
|
|
13
|
-
options.on('-tFREQ', '--target-freq=FREQ', '<Required - Frequency to Conclude Scanning (e.g. 900000000 == 900 mHz>') do |
|
14
|
-
opts[:
|
13
|
+
options.on('-tFREQ', '--target-freq=FREQ', '<Required - Frequency to Conclude Scanning (e.g. 900000000 == 900 mHz>') do |e|
|
14
|
+
opts[:target_freq] = e
|
15
15
|
end
|
16
16
|
|
17
17
|
options.on('-dMODE', '--demodulator-mode=MODE', '<Optional - Set Demodulator ModeOFF | RAW | AM | FM | WFM | WFM_ST | WFM_ST_OIRT | LSB |USB | CW | CWL | CWU (Defaults to AM)>') do |d|
|
@@ -29,6 +29,14 @@ OptionParser.new do |options|
|
|
29
29
|
options.on('-pPORT', '--port=PORT', '<Optional - GQRX Port (Defaults to 7356)>') do |p|
|
30
30
|
opts[:port] = p
|
31
31
|
end
|
32
|
+
|
33
|
+
options.on('-PPLACE', '--precision=PLACE', '<Optional - Precision of Frequency 1-9 (Defaults to 3)>') do |p|
|
34
|
+
opts[:precision] = p
|
35
|
+
end
|
36
|
+
|
37
|
+
options.on('-SFLOAT', '--sleep-between-hops=FLOAT', '<Optional - Float to Sleep Between Hops (Defaults to 0)>') do |s|
|
38
|
+
opts[:sleep_between_hops] = s
|
39
|
+
end
|
32
40
|
end.parse!
|
33
41
|
|
34
42
|
if opts.empty?
|
@@ -59,45 +67,82 @@ def gqrx_cmd(opts = {})
|
|
59
67
|
gqrx_sock.readline.chomp if does_respond
|
60
68
|
end
|
61
69
|
|
70
|
+
def scan_range(opts = {})
|
71
|
+
gqrx_sock = opts[:gqrx_sock]
|
72
|
+
start_freq = opts[:start_freq]
|
73
|
+
target_freq = opts[:target_freq]
|
74
|
+
precision = opts[:precision]
|
75
|
+
multiplier = 10**(precision - 1)
|
76
|
+
sleep_between_hops = opts[:sleep_between_hops]
|
77
|
+
|
78
|
+
if start_freq > target_freq
|
79
|
+
start_freq.downto(target_freq) do |i|
|
80
|
+
next unless (i % multiplier).zero?
|
81
|
+
|
82
|
+
this_freq = i
|
83
|
+
gqrx_cmd(gqrx_sock: gqrx_sock, cmd: "F #{this_freq}")
|
84
|
+
resp = gqrx_cmd(gqrx_sock: gqrx_sock, cmd: 'f')
|
85
|
+
# Split the response from NNNNNNNNN to NNN.NNN.NNN
|
86
|
+
this_freq = resp.to_s.chars.insert(-4, '.').insert(-8, '.').join
|
87
|
+
puts ">>> #{this_freq}"
|
88
|
+
sleep sleep_between_hops
|
89
|
+
end
|
90
|
+
else
|
91
|
+
while start_freq <= target_freq
|
92
|
+
this_freq = start_freq
|
93
|
+
gqrx_cmd(gqrx_sock: gqrx_sock, cmd: "F #{this_freq}")
|
94
|
+
resp = gqrx_cmd(gqrx_sock: gqrx_sock, cmd: 'f')
|
95
|
+
# Split the response from NNNNNNNNN to NNN.NNN.NNN
|
96
|
+
this_freq = resp.to_s.chars.insert(-4, '.').insert(-8, '.').join
|
97
|
+
puts ">>> #{this_freq}"
|
98
|
+
sleep sleep_between_hops
|
99
|
+
|
100
|
+
start_freq += multiplier
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
62
105
|
begin
|
63
106
|
pwn_provider = 'ruby-gem'
|
64
107
|
pwn_provider = ENV.fetch('PWN_PROVIDER') if ENV.keys.any? { |s| s == 'PWN_PROVIDER' }
|
65
108
|
|
66
109
|
demodulator_mode = opts[:demodulator_mode] ||= 'AM'
|
110
|
+
demodulator_mode.upcase!
|
67
111
|
raise "ERROR: Invalid demodulator mode: #{demodulator_mode}" unless %w[OFF RAW AM FM WFM WFM_ST WFM_ST_OIRT LSB USB CW CWL CWU].include?(demodulator_mode)
|
68
112
|
|
113
|
+
host = opts[:host] ||= '127.0.0.1'
|
114
|
+
port = opts[:port] ||= 7356
|
115
|
+
puts "Connecting to GQRX at #{host}:#{port}..."
|
116
|
+
|
117
|
+
gqrx_sock = PWN::Plugins::Sock.connect(target: host, port: port)
|
69
118
|
puts "Setting demodulator mode to #{demodulator_mode}..."
|
70
119
|
demod_resp = gqrx_cmd(gqrx_sock: gqrx_sock, cmd: "M #{demodulator_mode}")
|
71
120
|
puts demod_resp
|
72
121
|
|
73
|
-
start_freq = opts[:start_freq]
|
74
|
-
start_freq =
|
122
|
+
start_freq = opts[:start_freq]
|
123
|
+
start_freq = start_freq.to_s.delete('.').to_i unless start_freq.nil?
|
124
|
+
start_freq = gqrx_cmd(gqrx_sock: gqrx_sock, cmd: 'f').to_i if start_freq.nil?
|
75
125
|
|
76
|
-
|
77
|
-
|
126
|
+
target_freq = opts[:target_freq]
|
127
|
+
target_freq = target_freq.to_s.delete('.').to_i unless target_freq.nil?
|
128
|
+
raise 'ERROR: Invalid end frequency' if target_freq.nil?
|
78
129
|
|
79
|
-
puts "Scanning from #{start_freq} to #{
|
130
|
+
puts "Scanning from #{start_freq} to #{target_freq}..."
|
80
131
|
|
81
|
-
|
82
|
-
|
83
|
-
|
132
|
+
precision = opts[:precision] ||= 3
|
133
|
+
precision = precision.to_i
|
134
|
+
raise "ERROR: Invalid precision: #{precision}" unless (1..9).include?(precision)
|
84
135
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
puts "Scanning #{freq}..."
|
96
|
-
gqrx_cmd(gqrx_sock: gqrx_sock, cmd: "F #{freq}")
|
97
|
-
resp = gqrx_cmd(gqrx_sock: gqrx_sock, cmd: 'f')
|
98
|
-
puts "Reached #{resp}..."
|
99
|
-
end
|
100
|
-
end
|
136
|
+
sleep_between_hops = opts[:sleep_between_hops] ||= 0
|
137
|
+
sleep_between_hops = sleep_between_hops.to_f
|
138
|
+
|
139
|
+
scan_range(
|
140
|
+
gqrx_sock: gqrx_sock,
|
141
|
+
start_freq: start_freq,
|
142
|
+
target_freq: target_freq,
|
143
|
+
precision: precision,
|
144
|
+
sleep_between_hops: sleep_between_hops
|
145
|
+
)
|
101
146
|
rescue SystemExit, Interrupt
|
102
147
|
puts "\nGoodbye."
|
103
148
|
ensure
|
data/lib/pwn/version.rb
CHANGED