pwn 0.4.618 → 0.4.620

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: 46b245ad4f639c970cf5840e137c9d55deb5d6d79d46b423a9cec6c84048237d
4
- data.tar.gz: '082bff94ad45ee0891caaab8ce17b0e17e9f95180eacfaedb7ea8f62800e901b'
3
+ metadata.gz: fafd153cff40ac71671f4350a1b00459b355b9648797f013c206272d42fa1d7e
4
+ data.tar.gz: 1915f04c0ee44c2e71a3b90208e3bffed04a2445a2bba3151900fb36fd46ad6c
5
5
  SHA512:
6
- metadata.gz: 6aadac951190c38f228965ccff85b3af1c7e87053173ba0965ed39df4a96143ec398a45eeaad9cfc5ba1a064dab349a0f6965c6e1a2d4cdc0593df95662aa374
7
- data.tar.gz: e0b8483c95d6c1717dcce9127f5575aabd88aeb5bfad5760a920f559f0b50cc7135c358da2e827db7b6e8ff16cbfec702e09cd21488e597db16101a0185598dd
6
+ metadata.gz: ff8533d123cd6ba697cd452d8526d11c82bed093f28cb2d5146396ebbf4df8b56ffffe343e32770f36cd9a12627b7a174d8b6bac8cc4ca4c569039a60e7c7dba
7
+ data.tar.gz: c4d482bd29938edf14ca98510ebc3885563f55000127c8a01d252a744dc6b671d4419bf89876dd3bafcfc8779c92b925785faeb605139d22b5c5ddb8501afbf3
data/Gemfile CHANGED
@@ -11,7 +11,7 @@ gemspec
11
11
  # In some circumstances custom flags are passed to gems in order
12
12
  # to build appropriately. Defer to ./reinstall_pwn_gemset.sh
13
13
  # to review these custom flags (e.g. pg, serialport, etc).
14
- gem 'activesupport', '7.0.4.2'
14
+ gem 'activesupport', '7.0.4.3'
15
15
  gem 'anemone', '0.7.2'
16
16
  gem 'authy', '3.0.1'
17
17
  gem 'aws-sdk', '3.1.0'
data/README.md CHANGED
@@ -37,7 +37,7 @@ $ rvm use ruby-ruby-3.2.1@pwn
37
37
  $ rvm list gemsets
38
38
  $ gem install --verbose pwn
39
39
  $ pwn
40
- pwn[v0.4.618]:001 >>> PWN.help
40
+ pwn[v0.4.620]: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-ruby-3.2.1@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.4.618]:001 >>> PWN.help
55
+ pwn[v0.4.620]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
@@ -91,33 +91,55 @@ module PWN
91
91
  end
92
92
 
93
93
  # Supported Method Parameters::
94
- # response = PWN::Plugins::OpenAI.default_chat(
94
+ # response = PWN::Plugins::OpenAI.chat(
95
95
  # token: 'required - Bearer token',
96
96
  # request: 'required - message to ChatGPT'
97
- # model: 'optional - model to use for text generation (defaults to text-davinci-003)',
97
+ # model: 'optional - model to use for text generation (defaults to gpt-3.5-turbo)',
98
98
  # temp: 'optional - creative response float (deafults to 0)',
99
99
  # max_tokens: 'optional - integer (defaults to 4_097 - request.length || 300)'
100
100
  # )
101
101
 
102
- public_class_method def self.default_chat(opts = {})
102
+ public_class_method def self.chat(opts = {})
103
103
  token = opts[:token]
104
104
  request = opts[:request]
105
105
  model = opts[:model]
106
- model ||= 'text-davinci-003'
106
+ model ||= 'gpt-3.5-turbo'
107
+ # model ||= 'text-davinci-003'
107
108
  temp = opts[:temp].to_f
108
109
  temp = 0 unless temp.positive?
109
110
  max_tokens = opts[:max_tokens].to_i
110
111
  max_tokens = 4_097 - request.to_s.length
111
112
  max_tokens = 300 unless max_tokens.positive?
112
113
 
113
- rest_call = 'completions'
114
-
115
- http_body = {
116
- model: model,
117
- prompt: request,
118
- temperature: temp,
119
- max_tokens: max_tokens
120
- }
114
+ case model
115
+ when 'text-davinci-002',
116
+ 'text-davinci-003'
117
+
118
+ rest_call = 'completions'
119
+
120
+ http_body = {
121
+ model: model,
122
+ prompt: request,
123
+ temperature: temp,
124
+ max_tokens: max_tokens
125
+ }
126
+ when 'gpt-3.5-turbo',
127
+ 'gpt-4'
128
+
129
+ rest_call = 'chat/completions'
130
+
131
+ http_body = {
132
+ model: model,
133
+ messages: [
134
+ role: 'system',
135
+ content: request
136
+ ],
137
+ temperature: temp,
138
+ max_tokens: max_tokens
139
+ }
140
+ else
141
+ raise "ERROR: #{model} not supported."
142
+ end
121
143
 
122
144
  response = open_ai_rest_call(
123
145
  http_method: :post,
@@ -179,11 +201,11 @@ module PWN
179
201
 
180
202
  public_class_method def self.help
181
203
  puts "USAGE:
182
- response = #{self}.default_chat(
204
+ response = #{self}.chat(
183
205
  token: 'required - Bearer token',
184
206
  request: 'required - message to ChatGPT',
185
- model: 'optional - model to use for text generation (defaults to text-davinci-003)',
186
- temp: 'optional - creative response float (deafults to 0)',
207
+ model: 'optional - model to use for text generation (defaults to gpt-3.5-turbo)',
208
+ temp: 'optional - creative response float (defaults to 0)',
187
209
  max_tokens: 'optional - integer (deafults to 4_097 - request.length || 300)'
188
210
  )
189
211
 
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.618'
4
+ VERSION = '0.4.620'
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.4.618
4
+ version: 0.4.620
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-13 00:00:00.000000000 Z
11
+ date: 2023-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 7.0.4.2
19
+ version: 7.0.4.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 7.0.4.2
26
+ version: 7.0.4.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: anemone
29
29
  requirement: !ruby/object:Gem::Requirement