pwn 0.4.579 → 0.4.581
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/README.md +2 -2
- data/lib/pwn/plugins/open_ai.rb +22 -8
- data/lib/pwn/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 90a0815621e483ea69c20792de75ef779b6bdd4a6030d9b2b0845d8376ab894c
|
|
4
|
+
data.tar.gz: d48c4d3cd5654d2cc19c340ff9bd687d74d1a59030d7dc555622236b2fa52829
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4c3bfe5b72312f6e4e231eb5628fe132da69ca9ef6b0af8d5d7b8a193205d2b335f1ab729ce53ac43d599cf9ab62884ae7fa342fd2cd6bc55d2f35e4b77cc430
|
|
7
|
+
data.tar.gz: 684f0707eea5e31f69073eed72d0fb98eb9e183ee6d0fddff46a4e342c7fd0f54b72a82ff4d39939e3e2bdd97cb24ecfcb67865b5d41332dbe39e7d309ad050b
|
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.581]: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.581]:001 >>> PWN.help
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
|
data/lib/pwn/plugins/open_ai.rb
CHANGED
|
@@ -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
|
-
#
|
|
10
|
-
# https://
|
|
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,23 +95,34 @@ 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
|
+
# temp: 'optional - integer (deafults to 0)',
|
|
100
|
+
# max_tokens: 'optional - integer (deafults to 1024)'
|
|
98
101
|
# )
|
|
99
102
|
|
|
100
103
|
public_class_method def self.chat_gpt(opts = {})
|
|
101
104
|
token = opts[:token]
|
|
102
105
|
request = opts[:request]
|
|
106
|
+
model = opts[:model]
|
|
107
|
+
model ||= 'text-davinci-003'
|
|
108
|
+
temp = opts[:temp].to_i
|
|
109
|
+
temp ||= 0
|
|
110
|
+
max_tokens = opts[:max_tokens].to_i
|
|
111
|
+
max_tokens ||= 1024
|
|
112
|
+
|
|
113
|
+
rest_call = 'completions'
|
|
103
114
|
|
|
104
115
|
http_body = {
|
|
105
|
-
model:
|
|
116
|
+
model: model,
|
|
106
117
|
prompt: request,
|
|
107
|
-
temperature:
|
|
108
|
-
max_tokens:
|
|
118
|
+
temperature: temp,
|
|
119
|
+
max_tokens: max_tokens
|
|
109
120
|
}
|
|
110
121
|
|
|
111
122
|
response = open_ai_rest_call(
|
|
112
123
|
http_method: :post,
|
|
113
124
|
token: token,
|
|
114
|
-
rest_call:
|
|
125
|
+
rest_call: rest_call,
|
|
115
126
|
http_body: http_body.to_json
|
|
116
127
|
)
|
|
117
128
|
|
|
@@ -132,9 +143,12 @@ module PWN
|
|
|
132
143
|
|
|
133
144
|
public_class_method def self.help
|
|
134
145
|
puts "USAGE:
|
|
135
|
-
response #{self}.chat_gpt(
|
|
146
|
+
response = #{self}.chat_gpt(
|
|
136
147
|
token: 'required - Bearer token',
|
|
137
|
-
request: 'required - message to ChatGPT'
|
|
148
|
+
request: 'required - message to ChatGPT',
|
|
149
|
+
model: 'optional - model to use for text generation (defaults to text-davinci-003)',
|
|
150
|
+
temp: 'optional - integer (deafults to 0)',
|
|
151
|
+
max_tokens: 'optional - integer (deafults to 1024)'
|
|
138
152
|
)
|
|
139
153
|
|
|
140
154
|
#{self}.authors
|
data/lib/pwn/version.rb
CHANGED
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.
|
|
4
|
+
version: 0.4.581
|
|
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-
|
|
11
|
+
date: 2022-12-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|