pwn 0.4.579 → 0.4.580

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d181dae55d856276bc9f3d3e83797df02376a943e09a152024527671374d493
4
- data.tar.gz: 3120b47b6792bd382adc4fce24ce5e72e081fa5ee8de85ace1485cfbca204ce6
3
+ metadata.gz: 6ae4532b1dee1229394edd0a05c463f5564b2a60c6b074a03ec620718135213e
4
+ data.tar.gz: 274d7dcceae01727cd707806aad455e78f178866baf571795d3c4044817a3bc1
5
5
  SHA512:
6
- metadata.gz: 30d2874d74536443b569f228e437e3151189ec77948446d94893cb8bf7321597e68774a00b6136a7f9b0f5a6f23ae2204c22ee4319a7f146d70bac4e7de84d7d
7
- data.tar.gz: 2e9b95f76c2e28c4c48c90ded5ca7e1700b9fc8be3a28402fbdc779e812a8ef6a1f0abe5943ba93a70f9045043e4ed7d06343fccf0674682eadd8906ee80cc49
6
+ metadata.gz: 77ede4cbcb57adc8949eeffd331c0f5b0c8404ae6dd80941a51ed6ef747d309d3f682544022982752581db9df207d6af490fddbf1dd8a2e70577cc43fff401ac
7
+ data.tar.gz: 9ce69103a872bbe97d8479b087e92a2f17f6df8f095058f4be39948c04b811b75650f4f6b052f9a6c5af1a5b1f4a284cb27dbab0bde79ad37cb93657dca97075
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.579]:001 >>> PWN.help
40
+ pwn[v0.4.580]: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.579]:001 >>> PWN.help
55
+ pwn[v0.4.580]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
@@ -6,8 +6,8 @@ module PWN
6
6
  module Plugins
7
7
  # This plugin is used for interacting w/ OpenAI's REST API using
8
8
  # the 'rest' browser type of PWN::Plugins::TransparentBrowser.
9
- # This is based on the following OpenAI API Specification:
10
- # https://developer.shodan.io/api
9
+ # This is based on the following OpenAI API Specification:
10
+ # https://api.openai.com/v1
11
11
  module OpenAI
12
12
  @@logger = PWN::Plugins::PWNLogger.create
13
13
 
@@ -95,14 +95,20 @@ module PWN
95
95
  # response = PWN::Plugins::OpenAI.chat_gpt(
96
96
  # token: 'required - Bearer token',
97
97
  # request: 'required - message to ChatGPT'
98
+ # model: 'optional - model to use for text generation (defaults to text-davinci-003)',
99
+ # alt_response: 'optional boolean to generate a more creative response (defaults to false)'
98
100
  # )
99
101
 
100
102
  public_class_method def self.chat_gpt(opts = {})
101
103
  token = opts[:token]
102
104
  request = opts[:request]
105
+ model = opts[:model]
106
+ model ||= 'text-davinci-003'
107
+ rest_call = 'completions'
108
+ rest_call = 'text-generations' if opts[:alt_response]
103
109
 
104
110
  http_body = {
105
- model: 'text-davinci-003',
111
+ model: model,
106
112
  prompt: request,
107
113
  temperature: 0,
108
114
  max_tokens: 1024
@@ -111,7 +117,7 @@ module PWN
111
117
  response = open_ai_rest_call(
112
118
  http_method: :post,
113
119
  token: token,
114
- rest_call: 'completions',
120
+ rest_call: rest_call,
115
121
  http_body: http_body.to_json
116
122
  )
117
123
 
@@ -132,9 +138,11 @@ module PWN
132
138
 
133
139
  public_class_method def self.help
134
140
  puts "USAGE:
135
- response #{self}.chat_gpt(
141
+ response = #{self}.chat_gpt(
136
142
  token: 'required - Bearer token',
137
- request: 'required - message to ChatGPT'
143
+ request: 'required - message to ChatGPT',
144
+ model: 'optional - model to use for text generation (defaults to text-davinci-003)',
145
+ alt_response: 'optional boolean to generate a more creative response (defaults to false)'
138
146
  )
139
147
 
140
148
  #{self}.authors
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.579'
4
+ VERSION = '0.4.580'
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.579
4
+ version: 0.4.580
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-28 00:00:00.000000000 Z
11
+ date: 2022-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport