pwn 0.5.47 → 0.5.49
Sign up to get free protection for your applications and to get access to all the features.
- 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: 762e3e9a589e677f3d31eed1bb5cf88d6fab392788bb8de661c97c456fab0e0f
|
4
|
+
data.tar.gz: 92ea685fb1fe3e1b324ef1e335712ed2893925b38f3c439f323c500173f98d84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de71a313a7d068ad6ca1f004c72d1a94ecdb81baec5bdd485010ba605d4c7b065a98e9df1bdb52775a08982627291ddd728720589c84274ad846af77a9e208c5
|
7
|
+
data.tar.gz: 73279b4428584ef92547dcb2661e4ead52957066addae20381260cc4f8c804029c6b42c969f063a1ea3137aafe63d561bb3c48e24da72fcb9b54218b2fa0f766
|
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.49]: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.
|
55
|
+
pwn[v0.5.49]: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.49]: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 - Time to Sleep Between Hops (Defaults to 0.01)>') 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.01
|
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