pwn 0.5.53 → 0.5.55
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 +80 -26
- 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: 49f3ecb6074cc73010b66fe20b083fd02ac50c7b5347a9f6844a9f23588cef47
|
4
|
+
data.tar.gz: '08aa7ea01888cbf32f4a5156485f9cbc50887ad1a02ccd86652cbacaeaba4f1a'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ff98cab3c8dffc7d331d1583d5b8d5624b9e0fda4631b3c67a5f93ba0b96de74a89b02d8b77f3879a2416398aa162c6c630477cb2a6b6215030aec967629c22
|
7
|
+
data.tar.gz: a56bffc519b3db38601f673e34f12167294446b6792f63e21207eee4881b6641041c01d4021cfa73147c5aa650bdf329f42c17ced6778708d546a41aae4411bd
|
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.55]: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.55]: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.55]: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 (Defaults to 200.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 6)>') 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 -55.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 5.0)>') do |l|
|
43
51
|
opts[:lock_on_freq_duration] = l
|
44
52
|
end
|
45
53
|
|
46
|
-
options.on('-QFLOAT', '--squelch=FLOAT', '<Optional - Squelch Threshold -
|
54
|
+
options.on('-QFLOAT', '--squelch=FLOAT', '<Optional - Squelch Threshold -65.0 to 0(Defaults to -150.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
|
60
|
+
end
|
61
|
+
|
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
|
52
64
|
end
|
53
65
|
|
54
|
-
options.on('-
|
55
|
-
opts[:
|
66
|
+
options.on('-BFLOAT', '--basedband-gain=FLOAT', '<Optional - Baseband Gain 0.0-62.0 (Defaults to 0.0)>') do |b|
|
67
|
+
opts[:baseband_gain] = b
|
56
68
|
end
|
57
69
|
end.parse!
|
58
70
|
|
@@ -142,7 +154,7 @@ 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.03 if timeout.nil?
|
146
158
|
begin
|
147
159
|
response.push(gqrx_sock.readline.chomp) while gqrx_sock.wait_readable(timeout)
|
148
160
|
raise IOError if response.empty?
|
@@ -178,7 +190,7 @@ def init_freq(opts = {})
|
|
178
190
|
bandwidth = opts[:bandwidth]
|
179
191
|
this_freq = opts[:this_freq]
|
180
192
|
lock_on_freq_duration = opts[:lock_on_freq_duration]
|
181
|
-
|
193
|
+
strength_lock = opts[:strength_lock]
|
182
194
|
|
183
195
|
demod_n_passband = gqrx_cmd(
|
184
196
|
gqrx_sock: gqrx_sock,
|
@@ -196,6 +208,11 @@ def init_freq(opts = {})
|
|
196
208
|
cmd: 'f'
|
197
209
|
)
|
198
210
|
|
211
|
+
audio_gain_db = gqrx_cmd(
|
212
|
+
gqrx_sock: gqrx_sock,
|
213
|
+
cmd: 'l AF'
|
214
|
+
).to_f
|
215
|
+
|
199
216
|
current_strength = gqrx_cmd(
|
200
217
|
gqrx_sock: gqrx_sock,
|
201
218
|
cmd: 'l STRENGTH'
|
@@ -206,9 +223,19 @@ def init_freq(opts = {})
|
|
206
223
|
cmd: 'l SQL'
|
207
224
|
).to_f
|
208
225
|
|
209
|
-
|
226
|
+
rf_gain = gqrx_cmd(
|
210
227
|
gqrx_sock: gqrx_sock,
|
211
|
-
cmd: 'l
|
228
|
+
cmd: 'l RF_GAIN'
|
229
|
+
).to_f
|
230
|
+
|
231
|
+
if_gain = gqrx_cmd(
|
232
|
+
gqrx_sock: gqrx_sock,
|
233
|
+
cmd: 'l IF_GAIN'
|
234
|
+
).to_f
|
235
|
+
|
236
|
+
bb_gain = gqrx_cmd(
|
237
|
+
gqrx_sock: gqrx_sock,
|
238
|
+
cmd: 'l BB_GAIN'
|
212
239
|
).to_f
|
213
240
|
|
214
241
|
init_freq_hash = {
|
@@ -216,12 +243,15 @@ def init_freq(opts = {})
|
|
216
243
|
frequency: current_freq,
|
217
244
|
audio_gain_db: audio_gain_db,
|
218
245
|
squelch: current_squelch,
|
246
|
+
rf_gain: rf_gain,
|
247
|
+
if_gain: if_gain,
|
248
|
+
bb_gain: bb_gain,
|
219
249
|
strength: current_strength,
|
220
|
-
|
250
|
+
strength_trigger_lock_on_freq: strength_lock
|
221
251
|
}
|
222
252
|
puts JSON.pretty_generate(init_freq_hash)
|
223
253
|
|
224
|
-
sleep lock_on_freq_duration if current_strength
|
254
|
+
sleep lock_on_freq_duration if current_strength > strength_lock
|
225
255
|
|
226
256
|
init_freq_hash
|
227
257
|
end
|
@@ -234,7 +264,7 @@ def scan_range(opts = {})
|
|
234
264
|
target_freq = opts[:target_freq]
|
235
265
|
precision = opts[:precision]
|
236
266
|
lock_on_freq_duration = opts[:lock_on_freq_duration]
|
237
|
-
|
267
|
+
strength_lock = opts[:strength_lock]
|
238
268
|
|
239
269
|
multiplier = 10**(precision - 1)
|
240
270
|
if start_freq > target_freq
|
@@ -247,7 +277,7 @@ def scan_range(opts = {})
|
|
247
277
|
bandwidth: bandwidth,
|
248
278
|
this_freq: this_freq,
|
249
279
|
lock_on_freq_duration: lock_on_freq_duration,
|
250
|
-
|
280
|
+
strength_lock: strength_lock
|
251
281
|
)
|
252
282
|
end
|
253
283
|
else
|
@@ -259,7 +289,7 @@ def scan_range(opts = {})
|
|
259
289
|
bandwidth: bandwidth,
|
260
290
|
this_freq: this_freq,
|
261
291
|
lock_on_freq_duration: lock_on_freq_duration,
|
262
|
-
|
292
|
+
strength_lock: strength_lock
|
263
293
|
)
|
264
294
|
|
265
295
|
this_freq += multiplier
|
@@ -291,7 +321,7 @@ begin
|
|
291
321
|
demodulator_mode.upcase!
|
292
322
|
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
323
|
|
294
|
-
bandwidth = opts[:bandwidth] ||= '
|
324
|
+
bandwidth = opts[:bandwidth] ||= '200.000'
|
295
325
|
|
296
326
|
puts "Setting demodulator mode to #{demodulator_mode} and bandwidth to #{bandwidth}..."
|
297
327
|
bandwidth = bandwidth.to_s.delete('.').to_i unless bandwidth.nil?
|
@@ -301,7 +331,15 @@ begin
|
|
301
331
|
resp_ok: 'RPRT 0'
|
302
332
|
)
|
303
333
|
|
304
|
-
|
334
|
+
audio_gain_db = opts[:audio_gain_db] ||= 1.0
|
335
|
+
audio_gain_db = audio_gain_db.to_f
|
336
|
+
audio_gain_db_resp = gqrx_cmd(
|
337
|
+
gqrx_sock: gqrx_sock,
|
338
|
+
cmd: "L AF #{audio_gain_db}",
|
339
|
+
resp_ok: 'RPRT 0'
|
340
|
+
)
|
341
|
+
|
342
|
+
squelch = opts[:squelch] ||= -65.0
|
305
343
|
squelch = squelch.to_f
|
306
344
|
squelch_resp = gqrx_cmd(
|
307
345
|
gqrx_sock: gqrx_sock,
|
@@ -313,17 +351,33 @@ begin
|
|
313
351
|
precision = precision.to_i
|
314
352
|
raise "ERROR: Invalid precision: #{precision}" unless (1..12).include?(precision)
|
315
353
|
|
316
|
-
lock_on_freq_duration = opts[:lock_on_freq_duration] ||=
|
354
|
+
lock_on_freq_duration = opts[:lock_on_freq_duration] ||= 5.0
|
317
355
|
lock_on_freq_duration = lock_on_freq_duration.to_f
|
318
356
|
|
319
|
-
|
320
|
-
|
357
|
+
strength_lock = opts[:strength_lock] ||= -55.0
|
358
|
+
strength_lock = strength_lock.to_f
|
321
359
|
|
322
|
-
|
323
|
-
|
324
|
-
|
360
|
+
rf_gain = opts[:rf_gain] ||= 16.0
|
361
|
+
rf_gain = rf_gain.to_f
|
362
|
+
squelch_resp = gqrx_cmd(
|
325
363
|
gqrx_sock: gqrx_sock,
|
326
|
-
cmd: "L
|
364
|
+
cmd: "L RF_GAIN #{rf_gain}",
|
365
|
+
resp_ok: 'RPRT 0'
|
366
|
+
)
|
367
|
+
|
368
|
+
intermediate_gain = opts[:intermediate_gain] ||= 40.0
|
369
|
+
intermediate_gain = intermediate_gain.to_f
|
370
|
+
squelch_resp = gqrx_cmd(
|
371
|
+
gqrx_sock: gqrx_sock,
|
372
|
+
cmd: "L IF_GAIN #{intermediate_gain}",
|
373
|
+
resp_ok: 'RPRT 0'
|
374
|
+
)
|
375
|
+
|
376
|
+
baseband_gain = opts[:baseband_gain] ||= 0.0
|
377
|
+
baseband_gain = baseband_gain.to_f
|
378
|
+
squelch_resp = gqrx_cmd(
|
379
|
+
gqrx_sock: gqrx_sock,
|
380
|
+
cmd: "L BB_GAIN #{baseband_gain}",
|
327
381
|
resp_ok: 'RPRT 0'
|
328
382
|
)
|
329
383
|
|
@@ -338,7 +392,7 @@ begin
|
|
338
392
|
target_freq: target_freq,
|
339
393
|
precision: precision,
|
340
394
|
lock_on_freq_duration: lock_on_freq_duration,
|
341
|
-
|
395
|
+
strength_lock: strength_lock,
|
342
396
|
squelch: squelch
|
343
397
|
)
|
344
398
|
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.55
|
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
|