pwn 0.5.70 → 0.5.71

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: a7252c1a48d7fc6cf89352a2ae7452010d5e682be89de7dba0b12a2b6e8ddb8c
4
- data.tar.gz: 12b3b90c5a54cd920d0830d18db02aeccc3eb971828d809c37f8930935424011
3
+ metadata.gz: 677f7ef65de4483663672b6b2006281e018c9d9c91755f0d0d632bd35206ece1
4
+ data.tar.gz: d8210c6c330cd488410abb098809685ab68636b455d36779e6dd96d9247b1b6f
5
5
  SHA512:
6
- metadata.gz: ad965a67d10190a987cb5adf7ee73c24f15cca447a4ec24cdfc418a14e433524ac6784d74b9d2862cc3b1429ef0c9ed93a54991ded43175388d7c1947c655e69
7
- data.tar.gz: 22f71e17f9b6191d7952b764c25a35a8ac13d59e441dea07c35197e480cff0026ee2d983dc625aba82dc38bdbd8e7deddd21e2a3c5c314d28590b67a500ef509
6
+ metadata.gz: b4998737e42a14a97bb9abd13130fcd9dea70f32b061f22c895839a993545ad3703690de76507c0b01dcd952e1576cb9349aebaf2e9403af210b9bb7a0088ad3
7
+ data.tar.gz: 2145a9689d3174b5b3864ffb3079045e459e736f8594eae7667c56f35a81063b1c91b7ec6f504abaa9295ff1aeb3d25336273f7906b303a3fc310cd154538cef
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.70]:001 >>> PWN.help
40
+ pwn[v0.5.71]: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.70]:001 >>> PWN.help
55
+ pwn[v0.5.71]: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.70]:001 >>> PWN.help
65
+ pwn[v0.5.71]: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/etc/pwn.yaml.EXAMPLE CHANGED
@@ -3,10 +3,9 @@
3
3
  ai_engine: 'openai'
4
4
 
5
5
  openai:
6
- key: 'OPENAI API KEY'
6
+ key: 'OpenAI API Key'
7
7
 
8
8
  ollama:
9
9
  fqdn: 'FQDN for Open WebUI - e.g. https://ollama.local'
10
- user: 'Open WebUI username'
11
- pass: 'Open WebUI password'
10
+ key: 'Open WebUI API Key Under Settings >> Account >> JWT Token'
12
11
  model: 'Ollama model to use'
@@ -100,36 +100,6 @@ module PWN
100
100
  spinner.stop
101
101
  end
102
102
 
103
- # Supported Method Parameters::
104
- # response = PWN::Plugins::Ollama.get_key(
105
- # fqdn: 'required - base URI for the Ollama API',
106
- # user: 'required - ollama user',
107
- # pass: 'required - ollama password',
108
- # )
109
-
110
- public_class_method def self.get_key(opts = {})
111
- fqdn = opts[:fqdn]
112
- user = opts[:user]
113
- pass = opts[:pass]
114
-
115
- http_body = {
116
- email: user,
117
- password: pass
118
- }
119
-
120
- response = ollama_rest_call(
121
- fqdn: fqdn,
122
- http_method: :post,
123
- rest_call: 'api/v1/auths/signin',
124
- http_body: http_body
125
- )
126
-
127
- json_resp = JSON.parse(response, symbolize_names: true)
128
- json_resp[:token]
129
- rescue StandardError => e
130
- raise e
131
- end
132
-
133
103
  # Supported Method Parameters::
134
104
  # response = PWN::Plugins::Ollama.get_models(
135
105
  # token: 'required - Bearer token',
@@ -169,10 +139,10 @@ module PWN
169
139
  request = opts[:request]
170
140
 
171
141
  model = opts[:model]
172
- model ||= 'llama2:latest'
142
+ raise 'ERROR: Model is required. Call #get_models method for details' if model.nil?
173
143
 
174
144
  temp = opts[:temp].to_f
175
- temp = 0 unless temp.positive?
145
+ temp = 1 if temp.zero?
176
146
 
177
147
  rest_call = 'ollama/v1/chat/completions'
178
148
 
@@ -186,17 +186,9 @@ module PWN
186
186
  when :openai
187
187
  pi.config.pwn_ai_key = yaml_config[:openai][:key]
188
188
  when :ollama
189
- ollama_fqdn = yaml_config[:ollama][:fqdn]
190
- Pry.config.pwn_ai_fqdn = ollama_fqdn
191
-
192
- ollama_user = yaml_config[:ollama][:user]
193
- ollama_pass = yaml_config[:ollama][:pass]
194
- ollama_ai_key = PWN::Plugins::Ollama.get_key(
195
- fqdn: ollama_fqdn,
196
- user: ollama_user,
197
- pass: ollama_pass
198
- )
199
- pi.config.pwn_ai_key = ollama_ai_key
189
+ pi.config.pwn_ai_key = yaml_config[:ollama][:key]
190
+ Pry.config.pwn_ai_fqdn = yaml_config[:ollama][:fqdn]
191
+ Pry.config.pwn_ai_model = yaml_config[:ollama][:model]
200
192
  else
201
193
  raise "ERROR: Unsupported AI Engine: #{ai_engine} in #{yaml_config_path}"
202
194
  end
@@ -252,11 +244,13 @@ module PWN
252
244
  case ai_engine
253
245
  when :ollama
254
246
  fqdn = pi.config.pwn_ai_fqdn
247
+ model = pi.config.pwn_ai_model
248
+
255
249
  response = PWN::Plugins::Ollama.chat(
256
250
  fqdn: fqdn,
257
251
  token: ai_key,
252
+ model: model,
258
253
  request: request.chomp,
259
- temp: 1,
260
254
  response_history: response_history,
261
255
  speak_answer: speak_answer
262
256
  )
@@ -264,7 +258,6 @@ module PWN
264
258
  response = PWN::Plugins::OpenAI.chat(
265
259
  token: ai_key,
266
260
  request: request.chomp,
267
- temp: 1,
268
261
  response_history: response_history,
269
262
  speak_answer: speak_answer
270
263
  )
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.70'
4
+ VERSION = '0.5.71'
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.70
4
+ version: 0.5.71
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.