pwn 0.5.58 → 0.5.60

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0da642f1edb8037cac919389d67915e49d7278b22263df754a01bf7bc1bb3d64
4
- data.tar.gz: 2b7a06914ea20e5bdc21cebe7dcadae532c12bed37980ced533b19d54278f7aa
3
+ metadata.gz: a6c816ffedc2894df4b53a12630f520b60c6948ecab662b527477c3d95d439e8
4
+ data.tar.gz: 6d7d1b7deeac4665d4b6173cf4d2cc9a9af66d9d06b861b6dbe1b09d764e2688
5
5
  SHA512:
6
- metadata.gz: a5b15e8a1f3ee7d85eb5fc90e0458526abb8c9c3788013687b39fa5fbb8e77c57fc6f26da3f0a05b2587e9179ce94ef5704a8ab89f126d3711ae7eb0ad47f7bb
7
- data.tar.gz: 5f63dca98c0f3d4e78d1e38ac07d9ec4f7548b732afb96519731897206eb2d3ecde0ccd1c949046400509bd197682ee9a68e57447b884c4f82a46b859998c6f8
6
+ metadata.gz: b0c01cb75c862332b5cd527c615301999731e640cf8252e766fcbb46eaa912dd8ff26a85de0ab9338157638748174efd4268cb7daf06f49b7eeaed76bb72556e
7
+ data.tar.gz: cf6d6bf0aa6ca87ab063b39129d9a3b5bb1281912a426ecc2ba29c80e063f3e4530c71b0274eb55ea1971655d0d48fd9d413f511e143dc131d8d4b844fd65482
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.58]:001 >>> PWN.help
40
+ pwn[v0.5.60]:001 >>> PWN.help
41
41
  ```
42
42
 
43
43
  [![Installing the pwn Security Automation Framework](https://raw.githubusercontent.com/0dayInc/pwn/master/documentation/pwn_install.png)](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.58]:001 >>> PWN.help
55
+ pwn[v0.5.60]: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.58]:001 >>> PWN.help
65
+ pwn[v0.5.60]: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_bdba_scan CHANGED
@@ -183,6 +183,7 @@ begin
183
183
  rescue IO::TimeoutError,
184
184
  RestClient::BadGateway,
185
185
  RestClient::BadRequest,
186
+ RestClient::Conflict,
186
187
  RestClient::Exceptions::OpenTimeout,
187
188
  RestClient::Forbidden,
188
189
  RestClient::GatewayTimeout,
data/bin/pwn_gqrx_scanner CHANGED
@@ -43,7 +43,7 @@ OptionParser.new do |options|
43
43
  opts[:precision] = p
44
44
  end
45
45
 
46
- options.on('-SFLOAT', '--strength-lock=FLOAT', '<Optional - Strength to trigger lock on frequency (Defaults to -45.0)>') do |s|
46
+ options.on('-SFLOAT', '--strength-lock=FLOAT', '<Optional - Strength to lock onto frequency (Defaults to -45.0)>') do |s|
47
47
  opts[:strength_lock] = s
48
48
  end
49
49
 
@@ -242,17 +242,18 @@ def init_freq(opts = {})
242
242
  init_freq_hash = {
243
243
  demod_mode_n_passband: demod_n_passband,
244
244
  frequency: current_freq,
245
+ bandwidth: bandwidth,
245
246
  audio_gain_db: audio_gain_db,
246
247
  squelch: current_squelch,
247
248
  rf_gain: rf_gain,
248
249
  if_gain: if_gain,
249
250
  bb_gain: bb_gain,
250
251
  strength: current_strength,
251
- strength_trigger_lock_on_freq: strength_lock,
252
+ strength_lock: strength_lock,
252
253
  lock_freq_duration: lock_freq_duration
253
254
  }
254
- puts JSON.pretty_generate(init_freq_hash)
255
255
 
256
+ print '.'
256
257
  sleep lock_freq_duration if current_strength > strength_lock
257
258
 
258
259
  init_freq_hash
@@ -269,9 +270,22 @@ def scan_range(opts = {})
269
270
  strength_lock = opts[:strength_lock]
270
271
 
271
272
  multiplier = 10**(precision - 1)
273
+ prev_freq_hash = {
274
+ demod_mode_n_passband: demodulator_mode,
275
+ frequency: start_freq,
276
+ bandwidth: bandwidth,
277
+ audio_gain_db: 0.0,
278
+ squelch: 0.0,
279
+ rf_gain: 0.0,
280
+ if_gain: 0.0,
281
+ bb_gain: 0.0,
282
+ strength: 0.0,
283
+ strength_lock: strength_lock,
284
+ lock_freq_duration: lock_freq_duration
285
+ }
272
286
  if start_freq > target_freq
273
287
  start_freq.downto(target_freq) do |this_freq|
274
- next unless (i % multiplier).zero?
288
+ next unless (this_freq % multiplier).zero?
275
289
 
276
290
  init_freq_hash = init_freq(
277
291
  gqrx_sock: gqrx_sock,
@@ -281,6 +295,20 @@ def scan_range(opts = {})
281
295
  lock_freq_duration: lock_freq_duration,
282
296
  strength_lock: strength_lock
283
297
  )
298
+
299
+ current_strength = init_freq_hash[:strength]
300
+ prev_strength = prev_freq_hash[:strength]
301
+ prev_freq = prev_freq_hash[:frequency]
302
+
303
+ approaching_detection = true if current_strength > prev_strength &&
304
+ current_strength > strength_lock
305
+ if approaching_detection && current_strength <= prev_strength
306
+ puts "\n**** Found a signal ~ #{prev_freq} Hz ****"
307
+ puts JSON.pretty_generate(prev_freq_hash)
308
+ approaching_detection = false
309
+ end
310
+
311
+ prev_freq_hash = init_freq_hash
284
312
  end
285
313
  else
286
314
  this_freq = start_freq
@@ -294,6 +322,20 @@ def scan_range(opts = {})
294
322
  strength_lock: strength_lock
295
323
  )
296
324
 
325
+ current_strength = init_freq_hash[:strength]
326
+ prev_strength = prev_freq_hash[:strength]
327
+ prev_freq = prev_freq_hash[:frequency]
328
+
329
+ approaching_detection = true if current_strength > prev_strength &&
330
+ current_strength > strength_lock
331
+ if approaching_detection && current_strength < prev_strength
332
+ puts "\n**** Discovered a signal ~ #{prev_freq} Hz ****"
333
+ puts JSON.pretty_generate(prev_freq_hash)
334
+ approaching_detection = false
335
+ end
336
+
337
+ prev_freq_hash = init_freq_hash
338
+
297
339
  this_freq += multiplier
298
340
  end
299
341
  end
@@ -323,7 +365,7 @@ begin
323
365
  demodulator_mode.upcase!
324
366
  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)
325
367
 
326
- bandwidth = opts[:bandwidth] ||= '270.000'
368
+ bandwidth = opts[:bandwidth] ||= '200.000'
327
369
 
328
370
  puts "Setting demodulator mode to #{demodulator_mode} and bandwidth to #{bandwidth}..."
329
371
  bandwidth = bandwidth.to_s.delete('.').to_i unless bandwidth.nil?
@@ -341,7 +383,7 @@ begin
341
383
  resp_ok: 'RPRT 0'
342
384
  )
343
385
 
344
- squelch = opts[:squelch] ||= -50.0
386
+ squelch = opts[:squelch] ||= -63.0
345
387
  squelch = squelch.to_f
346
388
  squelch_resp = gqrx_cmd(
347
389
  gqrx_sock: gqrx_sock,
@@ -356,10 +398,10 @@ begin
356
398
  lock_freq_duration = opts[:lock_freq_duration] ||= 0.5
357
399
  lock_freq_duration = lock_freq_duration.to_f
358
400
 
359
- strength_lock = opts[:strength_lock] ||= -45.0
401
+ strength_lock = opts[:strength_lock] ||= -60.0
360
402
  strength_lock = strength_lock.to_f
361
403
 
362
- rf_gain = opts[:rf_gain] ||= 16.0
404
+ rf_gain = opts[:rf_gain] ||= 0.0
363
405
  rf_gain = rf_gain.to_f
364
406
  squelch_resp = gqrx_cmd(
365
407
  gqrx_sock: gqrx_sock,
@@ -367,7 +409,7 @@ begin
367
409
  resp_ok: 'RPRT 0'
368
410
  )
369
411
 
370
- intermediate_gain = opts[:intermediate_gain] ||= 40.0
412
+ intermediate_gain = opts[:intermediate_gain] ||= 32.0
371
413
  intermediate_gain = intermediate_gain.to_f
372
414
  squelch_resp = gqrx_cmd(
373
415
  gqrx_sock: gqrx_sock,
@@ -385,11 +427,12 @@ begin
385
427
 
386
428
  s_freq_pretty = start_freq.to_s.chars.insert(-4, '.').insert(-8, '.').join
387
429
  t_freq_pretty = target_freq.to_s.chars.insert(-4, '.').insert(-8, '.').join
388
- puts "*** Scanning from #{s_freq_pretty} to #{t_freq_pretty}"
430
+ puts "*** Scanning from #{s_freq_pretty} to #{t_freq_pretty}\n\n\n"
389
431
 
390
432
  scan_range(
391
433
  gqrx_sock: gqrx_sock,
392
434
  demodulator_mode: demodulator_mode,
435
+ bandwidth: bandwidth,
393
436
  start_freq: start_freq,
394
437
  target_freq: target_freq,
395
438
  precision: precision,
data/lib/pwn/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PWN
4
- VERSION = '0.5.58'
4
+ VERSION = '0.5.60'
5
5
  end
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.58
4
+ version: 0.5.60
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-18 00:00:00.000000000 Z
11
+ date: 2024-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport