pwn 0.5.54 → 0.5.57
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 +83 -27
- data/lib/pwn/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be55cd1ef6de2ead835c5559f1b03e415bc78373669732ac2733670836a823c4
|
4
|
+
data.tar.gz: ae9385cbe7ea8ec60ab8089e5820a9a77618d95db8489cfc34fd85f9b024e6a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f51818e4dec719633a3c5e69b1cd86d676d2e36d031a1666570ac3cf91ab34a9bdcedbbb248e157f5c51667cda1425e25b2e776c5303db050fd7484ff8bcc466
|
7
|
+
data.tar.gz: 0bf0d8c6aac40dc0859c4ffdca6509c1fdd349935bdeb24f1704c23351f7dc682bef3133456d9a0d570c0ffba6cdd7a406b1fca7186f5d19c508b8a67ceb31c5
|
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.57]: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.57]: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.57]: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
@@ -31,7 +31,7 @@ OptionParser.new do |options|
|
|
31
31
|
opts[:audio_gain_db] = a
|
32
32
|
end
|
33
33
|
|
34
|
-
options.on('-
|
34
|
+
options.on('-bHZ', '--bandwidth=HZ', '<Optional - Set Bandwidth 0.0 - SDR Bandwidth Limit, e.g. 20.000.000 (Defaults to 270.000)>') do |b|
|
35
35
|
opts[:bandwidth] = b
|
36
36
|
end
|
37
37
|
|
@@ -39,20 +39,32 @@ OptionParser.new do |options|
|
|
39
39
|
opts[:demodulator_mode] = d
|
40
40
|
end
|
41
41
|
|
42
|
-
options.on('-
|
42
|
+
options.on('-PINT', '--precision=INT', '<Optional - Precision of Frequency 1-12 (Defaults to 5)>') do |p|
|
43
|
+
opts[:precision] = p
|
44
|
+
end
|
45
|
+
|
46
|
+
options.on('-SFLOAT', '--strength-lock=FLOAT', '<Optional - Strength to trigger lock on frequency (Defaults to -45.0)>') do |s|
|
47
|
+
opts[:strength_lock] = s
|
48
|
+
end
|
49
|
+
|
50
|
+
options.on('-LFLOAT', '--lock-freq-duration=FLOAT', '<Optional - Duration to lock onto Freqency when Strength < --strength-lock value (Defaults to 0.25)>') do |l|
|
43
51
|
opts[:lock_on_freq_duration] = l
|
44
52
|
end
|
45
53
|
|
46
|
-
options.on('-QFLOAT', '--squelch=FLOAT', '<Optional - Squelch Threshold -150 to 0(Defaults to -
|
54
|
+
options.on('-QFLOAT', '--squelch=FLOAT', '<Optional - Squelch Threshold -150.0 to 0 (Defaults to -50.0)>') do |q|
|
47
55
|
opts[:squelch] = q
|
48
56
|
end
|
49
57
|
|
50
|
-
options.on('-
|
51
|
-
opts[:
|
58
|
+
options.on('-RFLOAT', '--rf-gain=FLOAT', '<Optional - RF Gain 0.0-16.0(Defaults to 16.0)>') do |r|
|
59
|
+
opts[:rf_gain] = r
|
52
60
|
end
|
53
61
|
|
54
|
-
options.on('-
|
55
|
-
opts[:
|
62
|
+
options.on('-IFLOAT', '--intermediate-gain=FLOAT', '<Optional - Intermediate Gain 0.0-40.0 (Defaults to 40.0)>') do |i|
|
63
|
+
opts[:intermediate_gain] = i
|
64
|
+
end
|
65
|
+
|
66
|
+
options.on('-BFLOAT', '--basedband-gain=FLOAT', '<Optional - Baseband Gain 0.0-62.0 (Defaults to 10.0)>') do |b|
|
67
|
+
opts[:baseband_gain] = b
|
56
68
|
end
|
57
69
|
end.parse!
|
58
70
|
|
@@ -142,7 +154,8 @@ def gqrx_cmd(opts = {})
|
|
142
154
|
response = []
|
143
155
|
got_freq = false
|
144
156
|
# Read all responses from gqrx_sock.write
|
145
|
-
timeout = 0.
|
157
|
+
timeout = 0.001 if timeout.nil?
|
158
|
+
|
146
159
|
begin
|
147
160
|
response.push(gqrx_sock.readline.chomp) while gqrx_sock.wait_readable(timeout)
|
148
161
|
raise IOError if response.empty?
|
@@ -178,7 +191,7 @@ def init_freq(opts = {})
|
|
178
191
|
bandwidth = opts[:bandwidth]
|
179
192
|
this_freq = opts[:this_freq]
|
180
193
|
lock_on_freq_duration = opts[:lock_on_freq_duration]
|
181
|
-
|
194
|
+
strength_lock = opts[:strength_lock]
|
182
195
|
|
183
196
|
demod_n_passband = gqrx_cmd(
|
184
197
|
gqrx_sock: gqrx_sock,
|
@@ -196,6 +209,11 @@ def init_freq(opts = {})
|
|
196
209
|
cmd: 'f'
|
197
210
|
)
|
198
211
|
|
212
|
+
audio_gain_db = gqrx_cmd(
|
213
|
+
gqrx_sock: gqrx_sock,
|
214
|
+
cmd: 'l AF'
|
215
|
+
).to_f
|
216
|
+
|
199
217
|
current_strength = gqrx_cmd(
|
200
218
|
gqrx_sock: gqrx_sock,
|
201
219
|
cmd: 'l STRENGTH'
|
@@ -206,9 +224,19 @@ def init_freq(opts = {})
|
|
206
224
|
cmd: 'l SQL'
|
207
225
|
).to_f
|
208
226
|
|
209
|
-
|
227
|
+
rf_gain = gqrx_cmd(
|
210
228
|
gqrx_sock: gqrx_sock,
|
211
|
-
cmd: 'l
|
229
|
+
cmd: 'l RF_GAIN'
|
230
|
+
).to_f
|
231
|
+
|
232
|
+
if_gain = gqrx_cmd(
|
233
|
+
gqrx_sock: gqrx_sock,
|
234
|
+
cmd: 'l IF_GAIN'
|
235
|
+
).to_f
|
236
|
+
|
237
|
+
bb_gain = gqrx_cmd(
|
238
|
+
gqrx_sock: gqrx_sock,
|
239
|
+
cmd: 'l BB_GAIN'
|
212
240
|
).to_f
|
213
241
|
|
214
242
|
init_freq_hash = {
|
@@ -216,12 +244,16 @@ def init_freq(opts = {})
|
|
216
244
|
frequency: current_freq,
|
217
245
|
audio_gain_db: audio_gain_db,
|
218
246
|
squelch: current_squelch,
|
247
|
+
rf_gain: rf_gain,
|
248
|
+
if_gain: if_gain,
|
249
|
+
bb_gain: bb_gain,
|
219
250
|
strength: current_strength,
|
220
|
-
|
251
|
+
strength_trigger_lock_on_freq: strength_lock,
|
252
|
+
lock_on_freq_duration: lock_on_freq_duration
|
221
253
|
}
|
222
254
|
puts JSON.pretty_generate(init_freq_hash)
|
223
255
|
|
224
|
-
sleep lock_on_freq_duration if current_strength
|
256
|
+
sleep lock_on_freq_duration if current_strength > strength_lock
|
225
257
|
|
226
258
|
init_freq_hash
|
227
259
|
end
|
@@ -234,7 +266,7 @@ def scan_range(opts = {})
|
|
234
266
|
target_freq = opts[:target_freq]
|
235
267
|
precision = opts[:precision]
|
236
268
|
lock_on_freq_duration = opts[:lock_on_freq_duration]
|
237
|
-
|
269
|
+
strength_lock = opts[:strength_lock]
|
238
270
|
|
239
271
|
multiplier = 10**(precision - 1)
|
240
272
|
if start_freq > target_freq
|
@@ -247,7 +279,7 @@ def scan_range(opts = {})
|
|
247
279
|
bandwidth: bandwidth,
|
248
280
|
this_freq: this_freq,
|
249
281
|
lock_on_freq_duration: lock_on_freq_duration,
|
250
|
-
|
282
|
+
strength_lock: strength_lock
|
251
283
|
)
|
252
284
|
end
|
253
285
|
else
|
@@ -259,7 +291,7 @@ def scan_range(opts = {})
|
|
259
291
|
bandwidth: bandwidth,
|
260
292
|
this_freq: this_freq,
|
261
293
|
lock_on_freq_duration: lock_on_freq_duration,
|
262
|
-
|
294
|
+
strength_lock: strength_lock
|
263
295
|
)
|
264
296
|
|
265
297
|
this_freq += multiplier
|
@@ -291,7 +323,7 @@ begin
|
|
291
323
|
demodulator_mode.upcase!
|
292
324
|
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)
|
293
325
|
|
294
|
-
bandwidth = opts[:bandwidth] ||= '
|
326
|
+
bandwidth = opts[:bandwidth] ||= '270.000'
|
295
327
|
|
296
328
|
puts "Setting demodulator mode to #{demodulator_mode} and bandwidth to #{bandwidth}..."
|
297
329
|
bandwidth = bandwidth.to_s.delete('.').to_i unless bandwidth.nil?
|
@@ -301,7 +333,15 @@ begin
|
|
301
333
|
resp_ok: 'RPRT 0'
|
302
334
|
)
|
303
335
|
|
304
|
-
|
336
|
+
audio_gain_db = opts[:audio_gain_db] ||= 1.0
|
337
|
+
audio_gain_db = audio_gain_db.to_f
|
338
|
+
audio_gain_db_resp = gqrx_cmd(
|
339
|
+
gqrx_sock: gqrx_sock,
|
340
|
+
cmd: "L AF #{audio_gain_db}",
|
341
|
+
resp_ok: 'RPRT 0'
|
342
|
+
)
|
343
|
+
|
344
|
+
squelch = opts[:squelch] ||= -50.0
|
305
345
|
squelch = squelch.to_f
|
306
346
|
squelch_resp = gqrx_cmd(
|
307
347
|
gqrx_sock: gqrx_sock,
|
@@ -309,21 +349,37 @@ begin
|
|
309
349
|
resp_ok: 'RPRT 0'
|
310
350
|
)
|
311
351
|
|
312
|
-
precision = opts[:precision] ||=
|
352
|
+
precision = opts[:precision] ||= 5
|
313
353
|
precision = precision.to_i
|
314
354
|
raise "ERROR: Invalid precision: #{precision}" unless (1..12).include?(precision)
|
315
355
|
|
316
|
-
lock_on_freq_duration = opts[:lock_on_freq_duration] ||=
|
356
|
+
lock_on_freq_duration = opts[:lock_on_freq_duration] ||= 0.25
|
317
357
|
lock_on_freq_duration = lock_on_freq_duration.to_f
|
318
358
|
|
319
|
-
|
320
|
-
|
359
|
+
strength_lock = opts[:strength_lock] ||= -45.0
|
360
|
+
strength_lock = strength_lock.to_f
|
321
361
|
|
322
|
-
|
323
|
-
|
324
|
-
|
362
|
+
rf_gain = opts[:rf_gain] ||= 16.0
|
363
|
+
rf_gain = rf_gain.to_f
|
364
|
+
squelch_resp = gqrx_cmd(
|
325
365
|
gqrx_sock: gqrx_sock,
|
326
|
-
cmd: "L
|
366
|
+
cmd: "L RF_GAIN #{rf_gain}",
|
367
|
+
resp_ok: 'RPRT 0'
|
368
|
+
)
|
369
|
+
|
370
|
+
intermediate_gain = opts[:intermediate_gain] ||= 40.0
|
371
|
+
intermediate_gain = intermediate_gain.to_f
|
372
|
+
squelch_resp = gqrx_cmd(
|
373
|
+
gqrx_sock: gqrx_sock,
|
374
|
+
cmd: "L IF_GAIN #{intermediate_gain}",
|
375
|
+
resp_ok: 'RPRT 0'
|
376
|
+
)
|
377
|
+
|
378
|
+
baseband_gain = opts[:baseband_gain] ||= 10.0
|
379
|
+
baseband_gain = baseband_gain.to_f
|
380
|
+
squelch_resp = gqrx_cmd(
|
381
|
+
gqrx_sock: gqrx_sock,
|
382
|
+
cmd: "L BB_GAIN #{baseband_gain}",
|
327
383
|
resp_ok: 'RPRT 0'
|
328
384
|
)
|
329
385
|
|
@@ -338,7 +394,7 @@ begin
|
|
338
394
|
target_freq: target_freq,
|
339
395
|
precision: precision,
|
340
396
|
lock_on_freq_duration: lock_on_freq_duration,
|
341
|
-
|
397
|
+
strength_lock: strength_lock,
|
342
398
|
squelch: squelch
|
343
399
|
)
|
344
400
|
puts 'Scan Complete.'
|
data/lib/pwn/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pwn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.57
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 0day Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|