pwn 0.4.588 → 0.4.592
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/Gemfile +1 -1
- data/README.md +2 -2
- data/bin/pwn_phone +7 -1
- data/lib/pwn/plugins/baresip.rb +19 -2
- data/lib/pwn/plugins/open_ai.rb +50 -6
- data/lib/pwn/reports/phone.rb +8 -2
- data/lib/pwn/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1f08337726b9d0bbbccfb3b37b509cd65cf77047a6c214c25a5d2e6590833c32
|
|
4
|
+
data.tar.gz: d2254cd3d25c1287ab5d36c0c490b064eeeeebb8efe20f75423d5d3d82b4d459
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e79367004da9d02f6d31280f539dabf8210165f9bb47fa21851ca60fa731c0636d8a290c4e2fde72a6dc808cddca841d4a0e1e670dcb33d562073fab4d4c67ee
|
|
7
|
+
data.tar.gz: 73cf22e32388593e1d2de56b16974d48bfe1d4157edd2eff1159936071aa614031d9c4a9f3a9cc07b2e63d07c9a0506f4467eea2f12703550649be73d63dae82
|
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -37,7 +37,7 @@ $ rvm use ruby-3.1.3@pwn
|
|
|
37
37
|
$ rvm list gemsets
|
|
38
38
|
$ gem install --verbose pwn
|
|
39
39
|
$ pwn
|
|
40
|
-
pwn[v0.4.
|
|
40
|
+
pwn[v0.4.592]:001 >>> PWN.help
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
[](https://youtu.be/G7iLUY4FzsI)
|
|
@@ -52,7 +52,7 @@ $ rvm use ruby-3.1.3@pwn
|
|
|
52
52
|
$ gem uninstall --all --executables pwn
|
|
53
53
|
$ gem install --verbose pwn
|
|
54
54
|
$ pwn
|
|
55
|
-
pwn[v0.4.
|
|
55
|
+
pwn[v0.4.592]:001 >>> PWN.help
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
|
data/bin/pwn_phone
CHANGED
|
@@ -46,6 +46,10 @@ OptionParser.new do |options|
|
|
|
46
46
|
opts[:start_reporting_server] = s
|
|
47
47
|
end
|
|
48
48
|
|
|
49
|
+
options.on('-X', '--[no-]speech-to-text', '<Optional - Speech to Text from Audio Recordings>') do |x|
|
|
50
|
+
opts[:speech_to_text] = x
|
|
51
|
+
end
|
|
52
|
+
|
|
49
53
|
options.on('-xRULES', '--source-num-rules=RULES', '<Optional - Comma-delimited list of rules for src_num format (i.e. XXXXXXXXXX, self, same_country, same_area, and/or same_prefix [Defaults to random src_num w/ same length as target_num])>') do |x|
|
|
50
54
|
opts[:src_num_rules] = x
|
|
51
55
|
end
|
|
@@ -77,6 +81,7 @@ begin
|
|
|
77
81
|
# Optional Flag Variables
|
|
78
82
|
randomize = opts[:randomize]
|
|
79
83
|
start_reporting_server = opts[:start_reporting_server]
|
|
84
|
+
speech_to_text = opts[:speech_to_text]
|
|
80
85
|
src_num_rules = opts[:src_num_rules]
|
|
81
86
|
|
|
82
87
|
# Initiallize Phone Reconaissance
|
|
@@ -87,7 +92,8 @@ begin
|
|
|
87
92
|
randomize: randomize,
|
|
88
93
|
src_num_rules: src_num_rules,
|
|
89
94
|
seconds_to_record: seconds_to_record,
|
|
90
|
-
sox_bin: sox_bin
|
|
95
|
+
sox_bin: sox_bin,
|
|
96
|
+
speech_to_text: speech_to_text
|
|
91
97
|
)
|
|
92
98
|
|
|
93
99
|
# Generate HTML Report
|
data/lib/pwn/plugins/baresip.rb
CHANGED
|
@@ -356,7 +356,7 @@ module PWN
|
|
|
356
356
|
end
|
|
357
357
|
|
|
358
358
|
# Supported Method Parameters::
|
|
359
|
-
# PWN::Plugins::BareSIP.
|
|
359
|
+
# PWN::Plugins::BareSIP.dial_target_in_list(
|
|
360
360
|
# )
|
|
361
361
|
|
|
362
362
|
public_class_method def self.dial_target_in_list(opts = {})
|
|
@@ -380,6 +380,9 @@ module PWN
|
|
|
380
380
|
sox_bin = opts[:sox_bin] if File.exist?(opts[:sox_bin].to_s)
|
|
381
381
|
sox_bin ||= '/usr/bin/sox'
|
|
382
382
|
|
|
383
|
+
speech_to_text = true if opts[:speech_to_text]
|
|
384
|
+
speech_to_text ||= false
|
|
385
|
+
|
|
383
386
|
waveform_bin = 'waveform'
|
|
384
387
|
|
|
385
388
|
# Intialize empty baresip obj for ensure block below
|
|
@@ -566,6 +569,18 @@ module PWN
|
|
|
566
569
|
)
|
|
567
570
|
puts 'complete.'
|
|
568
571
|
call_resp_hash[:waveform] = relative_waveform
|
|
572
|
+
|
|
573
|
+
call_resp_hash[:speech_to_text] = 'N/A'
|
|
574
|
+
if speech_to_text
|
|
575
|
+
absolute_speech_to_text = "#{absolute_recording}.txt"
|
|
576
|
+
PWN::Plugins::OpenAI.speech_to_text(
|
|
577
|
+
audio_file_path: absolute_recording,
|
|
578
|
+
output_dir: target_num_root
|
|
579
|
+
)
|
|
580
|
+
print "Generating Speech-to-Text for #{absolute_recording}..."
|
|
581
|
+
puts 'complete.'
|
|
582
|
+
call_resp_hash[:speech_to_text] = File.read(absolute_speech_to_text)
|
|
583
|
+
end
|
|
569
584
|
puts end_of_color
|
|
570
585
|
end
|
|
571
586
|
|
|
@@ -605,6 +620,7 @@ module PWN
|
|
|
605
620
|
seconds_to_record = 60 if seconds_to_record.zero?
|
|
606
621
|
sox_bin = opts[:sox_bin] if File.exist?(opts[:sox_bin].to_s)
|
|
607
622
|
sox_bin ||= '/usr/bin/sox'
|
|
623
|
+
speech_to_text = opts[:speech_to_text]
|
|
608
624
|
|
|
609
625
|
target_range = parse_target_file(
|
|
610
626
|
target_file: target_file,
|
|
@@ -633,7 +649,8 @@ module PWN
|
|
|
633
649
|
randomize: randomize,
|
|
634
650
|
src_num_rules: src_num_rules,
|
|
635
651
|
seconds_to_record: seconds_to_record,
|
|
636
|
-
sox_bin: sox_bin
|
|
652
|
+
sox_bin: sox_bin,
|
|
653
|
+
speech_to_text: speech_to_text
|
|
637
654
|
)
|
|
638
655
|
|
|
639
656
|
# Push Call Results to results_hash[:data]
|
data/lib/pwn/plugins/open_ai.rb
CHANGED
|
@@ -95,7 +95,7 @@ module PWN
|
|
|
95
95
|
# token: 'required - Bearer token',
|
|
96
96
|
# request: 'required - message to ChatGPT'
|
|
97
97
|
# model: 'optional - model to use for text generation (defaults to text-davinci-003)',
|
|
98
|
-
# temp: 'optional -
|
|
98
|
+
# temp: 'optional - creative response float (deafults to 0)',
|
|
99
99
|
# max_tokens: 'optional - integer (deafults to 1024)'
|
|
100
100
|
# )
|
|
101
101
|
|
|
@@ -104,7 +104,7 @@ module PWN
|
|
|
104
104
|
request = opts[:request]
|
|
105
105
|
model = opts[:model]
|
|
106
106
|
model ||= 'text-davinci-003'
|
|
107
|
-
temp = opts[:temp].
|
|
107
|
+
temp = opts[:temp].to_f
|
|
108
108
|
temp = 0 unless temp.positive?
|
|
109
109
|
max_tokens = opts[:max_tokens].to_i
|
|
110
110
|
max_tokens = 1024 unless max_tokens.positive?
|
|
@@ -134,9 +134,8 @@ module PWN
|
|
|
134
134
|
# response = PWN::Plugins::OpenAI.img_gen(
|
|
135
135
|
# token: 'required - Bearer token',
|
|
136
136
|
# request: 'required - message to ChatGPT'
|
|
137
|
-
#
|
|
138
|
-
#
|
|
139
|
-
# max_tokens: 'optional - integer (deafults to 1024)'
|
|
137
|
+
# n: 'optional - number of images to generate (defaults to 1)',
|
|
138
|
+
# size: 'optional - size of image (defaults to "1024x1024")'
|
|
140
139
|
# )
|
|
141
140
|
|
|
142
141
|
public_class_method def self.img_gen(opts = {})
|
|
@@ -167,6 +166,37 @@ module PWN
|
|
|
167
166
|
raise e
|
|
168
167
|
end
|
|
169
168
|
|
|
169
|
+
# Supported Method Parameters::
|
|
170
|
+
# response = PWN::Plugins::OpenAI.speech_to_text(
|
|
171
|
+
# audio_file_path: 'required - path to audio file',
|
|
172
|
+
# whisper_path: 'optional - path to OpenAI whisper application (defaults to /usr/local/bin/whisper)',
|
|
173
|
+
# model: 'optional - transcribe model to use (defaults to tiny)',
|
|
174
|
+
# output_dir: 'optional - directory to output results (defaults to .)'
|
|
175
|
+
# )
|
|
176
|
+
|
|
177
|
+
public_class_method def self.speech_to_text(opts = {})
|
|
178
|
+
audio_file_path = opts[:audio_file_path]
|
|
179
|
+
whisper_path = opts[:whisper_path]
|
|
180
|
+
whisper_path ||= '/usr/local/bin/whisper'
|
|
181
|
+
model = opts[:model]
|
|
182
|
+
model ||= 'tiny'
|
|
183
|
+
output_dir = opts[:output_dir]
|
|
184
|
+
output_dir ||= '.'
|
|
185
|
+
|
|
186
|
+
raise "Speech-to-Text Engine Not Found: #{whisper_path}" unless File.exist?(whisper_path)
|
|
187
|
+
|
|
188
|
+
system(
|
|
189
|
+
whisper_path,
|
|
190
|
+
audio_file_path,
|
|
191
|
+
'--model',
|
|
192
|
+
model,
|
|
193
|
+
'--output_dir',
|
|
194
|
+
output_dir
|
|
195
|
+
)
|
|
196
|
+
rescue StandardError => e
|
|
197
|
+
raise e
|
|
198
|
+
end
|
|
199
|
+
|
|
170
200
|
# Author(s):: 0day Inc. <request.pentest@0dayinc.com>
|
|
171
201
|
|
|
172
202
|
public_class_method def self.authors
|
|
@@ -183,10 +213,24 @@ module PWN
|
|
|
183
213
|
token: 'required - Bearer token',
|
|
184
214
|
request: 'required - message to ChatGPT',
|
|
185
215
|
model: 'optional - model to use for text generation (defaults to text-davinci-003)',
|
|
186
|
-
temp: 'optional -
|
|
216
|
+
temp: 'optional - creative response float (deafults to 0)',
|
|
187
217
|
max_tokens: 'optional - integer (deafults to 1024)'
|
|
188
218
|
)
|
|
189
219
|
|
|
220
|
+
response = #{self}.img_gen(
|
|
221
|
+
token: 'required - Bearer token',
|
|
222
|
+
request: 'required - message to ChatGPT'
|
|
223
|
+
n: 'optional - number of images to generate (defaults to 1)',
|
|
224
|
+
size: 'optional - size of image (defaults to \"1024x1024\")'
|
|
225
|
+
)
|
|
226
|
+
|
|
227
|
+
response = #{self}.speech_to_text(
|
|
228
|
+
audio_file_path: 'required - path to audio file',
|
|
229
|
+
whisper_path: 'optional - path to OpenAI whisper application (defaults to /usr/local/bin/whisper)',
|
|
230
|
+
model: 'optional - transcribe model to use (defaults to tiny)',
|
|
231
|
+
output_dir: 'optional - directory to output results (defaults to .)'
|
|
232
|
+
)
|
|
233
|
+
|
|
190
234
|
#{self}.authors
|
|
191
235
|
"
|
|
192
236
|
end
|
data/lib/pwn/reports/phone.rb
CHANGED
|
@@ -106,8 +106,9 @@ module PWN
|
|
|
106
106
|
<a class="toggle-vis" data-column="7" href="#">Reason</a>
|
|
107
107
|
<a class="toggle-vis" data-column="8" href="#">Screenlog</a> |
|
|
108
108
|
<a class="toggle-vis" data-column="9" href="#">Recording</a> |
|
|
109
|
-
<a class="toggle-vis" data-column="10" href="#">
|
|
110
|
-
<a class="toggle-vis" data-column="11" href="#">
|
|
109
|
+
<a class="toggle-vis" data-column="10" href="#">Speech to Text</a> |
|
|
110
|
+
<a class="toggle-vis" data-column="11" href="#">Spectrogram</a> |
|
|
111
|
+
<a class="toggle-vis" data-column="12" href="#">Waveform</a>
|
|
111
112
|
</div>
|
|
112
113
|
<br /><br />
|
|
113
114
|
|
|
@@ -125,6 +126,7 @@ module PWN
|
|
|
125
126
|
<th>Reason Stopped</th>
|
|
126
127
|
<th>Screenlog</th>
|
|
127
128
|
<th>Recording</th>
|
|
129
|
+
<th>Speech to Text</th>
|
|
128
130
|
<th>Spectrogram</th>
|
|
129
131
|
<th>Waveform</th>
|
|
130
132
|
</tr>
|
|
@@ -218,6 +220,10 @@ module PWN
|
|
|
218
220
|
}
|
|
219
221
|
}
|
|
220
222
|
},
|
|
223
|
+
{
|
|
224
|
+
"data": "speech_to_text",
|
|
225
|
+
"render": $.fn.dataTable.render.text()
|
|
226
|
+
},
|
|
221
227
|
{
|
|
222
228
|
"data": "spectrogram",
|
|
223
229
|
"render": function (data, type, row, meta) {
|
data/lib/pwn/version.rb
CHANGED
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.4.
|
|
4
|
+
version: 0.4.592
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- 0day Inc.
|
|
@@ -926,14 +926,14 @@ dependencies:
|
|
|
926
926
|
requirements:
|
|
927
927
|
- - '='
|
|
928
928
|
- !ruby/object:Gem::Version
|
|
929
|
-
version: 7.2.
|
|
929
|
+
version: 7.2.2
|
|
930
930
|
type: :runtime
|
|
931
931
|
prerelease: false
|
|
932
932
|
version_requirements: !ruby/object:Gem::Requirement
|
|
933
933
|
requirements:
|
|
934
934
|
- - '='
|
|
935
935
|
- !ruby/object:Gem::Version
|
|
936
|
-
version: 7.2.
|
|
936
|
+
version: 7.2.2
|
|
937
937
|
- !ruby/object:Gem::Dependency
|
|
938
938
|
name: waveform
|
|
939
939
|
requirement: !ruby/object:Gem::Requirement
|