pwn 0.5.46 → 0.5.47

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a7184b7779835838904c456d596a269bdbcfc16ef1decfc74b1647b919a2a994
4
- data.tar.gz: 619117c61e14f580ded62296cad6ffaaba0c929fb30341a1476eb0b08fa24aae
3
+ metadata.gz: 910719a42741cc9b2eff2806e8a8194876bdd7b221233011fc2f9fa4e257f553
4
+ data.tar.gz: 07ba7fd748c10f2f429e486843351244b1e2b9e06a8e520604a172a6f5887d7f
5
5
  SHA512:
6
- metadata.gz: e5dd45352701c3610f8dadccd03dff9ac894a1c2c8a1347f92560d5066b919d660e30efca60bd693c043f31a1b8b787b1a21027338094465f6871ed5d8e95e46
7
- data.tar.gz: f23b45f291a86fd85a1f095a926c670ebc1ee00dc1464f995b06076b3bb3d44d7ec95d0807329af2b2a23e515b8554f2f08111cab663d8310720caf1ae51a20b
6
+ metadata.gz: 1c632a95588955c41d2bbf60870fd747ba6398c59fcfe7f0e7782ed1d41818ca64022525fadc255d879c50f9d04d5a43254693373cc870603c2a48659773a052
7
+ data.tar.gz: b8c3569b0b95cd3f8317e51adc6989a2d9fa5ff24a32e3ff0d5fe36f362ee22f011f9c435d3120e7ad7a79000e64f8bed00de4b8455ec663f8b461fa595b1c6f
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.46]:001 >>> PWN.help
40
+ pwn[v0.5.47]: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.46]:001 >>> PWN.help
55
+ pwn[v0.5.47]: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.46]:001 >>> PWN.help
65
+ pwn[v0.5.47]: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,11 +10,15 @@ OptionParser.new do |options|
10
10
  #{$PROGRAM_NAME} [opts]
11
11
  "
12
12
 
13
- options.on('-sFREQ', '--start-freq=FREQ', '<Optional - Frequency to Set when Scanning Begins (Defaults to last known frequency)>') do |s|
13
+ options.on('-tFREQ', '--target-freq=FREQ', '<Required - Frequency to Conclude Scanning (e.g. 900000000 == 900 mHz>') do |s|
14
14
  opts[:start_freq] = s
15
15
  end
16
16
 
17
- options.on('-tFREQ', '--target-freq=FREQ', '<Required - Frequency to Conclude Scanning (e.g. 900000000 == 900 mHz>') do |s|
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|
18
+ opts[:demodulator_mode] = d
19
+ end
20
+
21
+ options.on('-sFREQ', '--start-freq=FREQ', '<Optional - Frequency to Set when Scanning Begins (Defaults to last known frequency)>') do |s|
18
22
  opts[:start_freq] = s
19
23
  end
20
24
 
@@ -32,44 +36,71 @@ if opts.empty?
32
36
  exit 1
33
37
  end
34
38
 
35
- def jump_to_freq(opts = {})
39
+ def gqrx_cmd(opts = {})
40
+ # f - Get frequency [Hz]
41
+ # F - Set frequency [Hz]
42
+ # m - Get demodulator mode
43
+ # M - Set demodulator mode (OFF, RAW, AM, FM, WFM, WFM_ST,
44
+ # WFM_ST_OIRT, LSB, USB, CW, CWL, CWU)
45
+ # l STRENGTH - Get signal strength [dBFS]
46
+ # l SQL - Get squelch threshold [dBFS]
47
+ # L SQL <sql> - Set squelch threshold to <sql> [dBFS]
48
+ # u RECORD - Get status of audio recorder
49
+ # U RECORD <status> - Set status of audio recorder to <status>
50
+ # c - Close connection
51
+ # AOS - Acquisition of signal (AOS) event, start audio recording
52
+ # LOS - Loss of signal (LOS) event, stop audio recording
53
+ # \dump_state - Dump state (only usable for compatibility)
36
54
  gqrx_sock = opts[:gqrx_sock]
37
- freq = opts[:freq]
55
+ cmd = opts[:cmd]
38
56
 
39
- gqrx_sock.write("F #{freq}\n")
57
+ gqrx_sock.write("#{cmd}\n")
40
58
  does_respond = gqrx_sock.wait_readable
41
- gqrx_sock.readline.chomp
42
-
43
- gqrx_sock.write("f\n")
44
- does_respond = gqrx_sock.wait_readable
45
- reached_freq = gqrx_sock.readline.chomp
46
- puts "Reached #{reached_freq}..."
59
+ gqrx_sock.readline.chomp if does_respond
47
60
  end
48
61
 
49
62
  begin
50
63
  pwn_provider = 'ruby-gem'
51
- # pwn_provider = ENV.fetch('PWN_PROVIDER') if ENV.keys.select { |s| s == 'PWN_PROVIDER' }.any?
52
64
  pwn_provider = ENV.fetch('PWN_PROVIDER') if ENV.keys.any? { |s| s == 'PWN_PROVIDER' }
53
65
 
66
+ demodulator_mode = opts[:demodulator_mode] ||= 'AM'
67
+ 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
+
69
+ puts "Setting demodulator mode to #{demodulator_mode}..."
70
+ demod_resp = gqrx_cmd(gqrx_sock: gqrx_sock, cmd: "M #{demodulator_mode}")
71
+ puts demod_resp
72
+
54
73
  start_freq = opts[:start_freq].to_i
74
+ start_freq = gqrx_cmd(gqrx_sock: gqrx_sock, cmd: 'f').to_i if start_freq.zero?
75
+
55
76
  end_freq = opts[:end_freq].to_i
77
+ raise 'ERROR: Invalid end frequency' if end_freq.zero?
78
+
79
+ puts "Scanning from #{start_freq} to #{end_freq}..."
80
+
56
81
  host = opts[:host] ||= '127.0.0.1'
57
82
  port = opts[:port] ||= 7356
83
+ puts "Connecting to GQRX at #{host}:#{port}..."
58
84
 
59
85
  gqrx_sock = PWN::Plugins::Sock.connect(target: host, port: port)
60
86
  # If start value is greater than end value, go in reverse
61
87
  if start_freq > end_freq
62
88
  end_freq.downto(start_freq) do |freq|
63
- jump_to_freq(gqrx_sock: gqrx_sock, freq: freq)
89
+ gqrx_cmd(gqrx_sock: gqrx_sock, cmd: "F #{freq}")
90
+ resp = gqrx_cmd(gqrx_sock: gqrx_sock, cmd: 'f')
91
+ puts "Reached #{resp}..."
64
92
  end
65
93
  else
66
94
  (start_freq..end_freq).each do |freq|
67
95
  puts "Scanning #{freq}..."
68
- jump_to_freq(gqrx_sock: gqrx_sock, freq: 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}..."
69
99
  end
70
100
  end
71
101
  rescue SystemExit, Interrupt
72
102
  puts "\nGoodbye."
73
103
  ensure
104
+ resp = gqrx_cmd(gqrx_sock: gqrx_sock, cmd: 'c')
74
105
  gqrx_sock = PWN::Plugins::Sock.disconnect(sock_obj: gqrx_sock)
75
106
  end
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.46'
4
+ VERSION = '0.5.47'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pwn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.46
4
+ version: 0.5.47
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.