pwn 0.4.588 → 0.4.590

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: d02a210883d31e979073ec66d9c797340d661f0860cc92ec9738f41635ec5574
4
- data.tar.gz: 1d99380219818a393cc8fab1c9472b91c3e0e5fcabe290e2d036903c5ce7a842
3
+ metadata.gz: 1dffde9b271e9ce35652fc2c872116bc0caab715eef4a4436477e886f55fc40f
4
+ data.tar.gz: 37a00f3cd641512de58e4422eaa71cc381a7cbf3c090d2a52eff727d8aac6676
5
5
  SHA512:
6
- metadata.gz: b6a6061b68bbdd89bc27fa837e50cfbb4c1d37ced7bc81a45d7ff2f0bac7e4e9ef3302b7b469adf5c48dd2a8db91c889eb01d9c81d3069123d2feee5e8d9c6e9
7
- data.tar.gz: a6d4b1a91baaeb11447e7551c492aba1e3d34047ea6332ee9016c9d9e64de2ffd89962a740d3378dcfa78fd57f36168f0a1afbcb380df6e80174eafd720fd1e0
6
+ metadata.gz: 251ca7eca3490cc370f652844de2ab8298c2e68ff208e2f321756031a998250afbfc78b5d823d6cb31d45c018fa9f0c3fa7456b534caee1910a212f4e61e04c2
7
+ data.tar.gz: 9c58d27022ce2375f1b1685b21f3058e77f30be95771c5c7a1c545d380585cf1a636eec6bdb82d5beaad38fb77e2b426d75b8a3b56e547750442a60a2a3aa74f
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.588]:001 >>> PWN.help
40
+ pwn[v0.4.590]: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.1.3@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.4.588]:001 >>> PWN.help
55
+ pwn[v0.4.590]: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
@@ -356,7 +356,7 @@ module PWN
356
356
  end
357
357
 
358
358
  # Supported Method Parameters::
359
- # PWN::Plugins::BareSIP.recon(
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
+ # TODO: Get thos block working
574
+ if speech_to_text
575
+ absolute_speech_to_text = "#{absolute_recording}-speech_to_text.txt"
576
+ relative_speech_to_text = "#{relative_recording}-speech_to_text.txt"
577
+ PWN::Plugins::OpenAI.speech_to_text(
578
+ audio_file_path: absolute_recording
579
+ )
580
+ print "Generating Speech-to-Text for #{absolute_recording}..."
581
+ puts 'complete.'
582
+ call_resp_hash[:speech_to_text] = relative_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]
@@ -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 - integer (deafults to 0)',
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].to_i
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
- # model: 'optional - model to use for text generation (defaults to text-davinci-003)',
138
- # temp: 'optional - integer (deafults to 0)',
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 - integer (deafults to 0)',
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/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PWN
4
- VERSION = '0.4.588'
4
+ VERSION = '0.4.590'
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.4.588
4
+ version: 0.4.590
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.