pwn 0.5.439 → 0.5.440
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 +3 -3
- data/bin/pwn +1 -1
- data/lib/pwn/ai/grok.rb +36 -27
- data/lib/pwn/ai/ollama.rb +36 -27
- data/lib/pwn/ai/open_ai.rb +36 -27
- data/lib/pwn/config.rb +1 -0
- data/lib/pwn/version.rb +1 -1
- data/lib/pwn.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c78cac3acda55f478eb71b17ab1a06d87b1b37c8e5cc260235043e505e8718d7
|
4
|
+
data.tar.gz: 2d852f2059b20e1cf732596d1e7860dfa7f6f1c40187bb3ab83518f24ea87364
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bf4baa2a80ca243341ca004aeaf0646abb8c334f1c5002950d094f96144fcd8d7c840a8f8875a68fe596604c7233eb8676a1a9f2d911d24efb04ea4d39db15f
|
7
|
+
data.tar.gz: f8acd123df9bbc1f055c70d8433717686ed8cd0ae467ba970b1d1594140e8112a7e6de5508d409215a3085816ab5f7af9123573ea24b25cbcae1415e22f88fe3
|
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.
|
40
|
+
pwn[v0.5.440]:001 >>> PWN.help
|
41
41
|
```
|
42
42
|
|
43
43
|
[](https://youtu.be/G7iLUY4FzsI)
|
@@ -52,7 +52,7 @@ $ rvm use ruby-3.4.4@pwn
|
|
52
52
|
$ gem uninstall --all --executables pwn
|
53
53
|
$ gem install --verbose pwn
|
54
54
|
$ pwn
|
55
|
-
pwn[v0.5.
|
55
|
+
pwn[v0.5.440]: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.4.4@pwn
|
|
62
62
|
$ rvmsudo gem uninstall --all --executables pwn
|
63
63
|
$ rvmsudo gem install --verbose pwn
|
64
64
|
$ pwn
|
65
|
-
pwn[v0.5.
|
65
|
+
pwn[v0.5.440]: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/bin/pwn
CHANGED
data/lib/pwn/ai/grok.rb
CHANGED
@@ -55,44 +55,53 @@ module PWN
|
|
55
55
|
spin.auto_spin
|
56
56
|
end
|
57
57
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
url: "#{base_uri}/#{rest_call}",
|
64
|
-
headers: headers,
|
65
|
-
verify_ssl: false,
|
66
|
-
timeout: timeout
|
67
|
-
)
|
68
|
-
|
69
|
-
when :post
|
70
|
-
if http_body.key?(:multipart)
|
71
|
-
headers[:content_type] = 'multipart/form-data'
|
72
|
-
|
58
|
+
retry_count = 0
|
59
|
+
begin
|
60
|
+
case http_method
|
61
|
+
when :delete, :get
|
62
|
+
headers[:params] = params
|
73
63
|
response = rest_client.execute(
|
74
64
|
method: http_method,
|
75
65
|
url: "#{base_uri}/#{rest_call}",
|
76
66
|
headers: headers,
|
77
|
-
payload: http_body,
|
78
67
|
verify_ssl: false,
|
79
68
|
timeout: timeout
|
80
69
|
)
|
70
|
+
|
71
|
+
when :post
|
72
|
+
if http_body.key?(:multipart)
|
73
|
+
headers[:content_type] = 'multipart/form-data'
|
74
|
+
|
75
|
+
response = rest_client.execute(
|
76
|
+
method: http_method,
|
77
|
+
url: "#{base_uri}/#{rest_call}",
|
78
|
+
headers: headers,
|
79
|
+
payload: http_body,
|
80
|
+
verify_ssl: false,
|
81
|
+
timeout: timeout
|
82
|
+
)
|
83
|
+
else
|
84
|
+
response = rest_client.execute(
|
85
|
+
method: http_method,
|
86
|
+
url: "#{base_uri}/#{rest_call}",
|
87
|
+
headers: headers,
|
88
|
+
payload: http_body.to_json,
|
89
|
+
verify_ssl: false,
|
90
|
+
timeout: timeout
|
91
|
+
)
|
92
|
+
end
|
81
93
|
else
|
82
|
-
|
83
|
-
method: http_method,
|
84
|
-
url: "#{base_uri}/#{rest_call}",
|
85
|
-
headers: headers,
|
86
|
-
payload: http_body.to_json,
|
87
|
-
verify_ssl: false,
|
88
|
-
timeout: timeout
|
89
|
-
)
|
94
|
+
raise @@logger.error("Unsupported HTTP Method #{http_method} for #{self} Plugin")
|
90
95
|
end
|
91
96
|
|
92
|
-
|
93
|
-
|
97
|
+
response
|
98
|
+
rescue RestClient::TooManyRequests => e
|
99
|
+
retry_after = e.response.headers[:retry_after]&.to_i ||= (0.5 * (retry_count + 1))
|
100
|
+
sleep(retry_after + rand(0.3..5.0))
|
101
|
+
retry_count += 1
|
102
|
+
|
103
|
+
retry
|
94
104
|
end
|
95
|
-
response
|
96
105
|
rescue RestClient::ExceptionWithResponse => e
|
97
106
|
puts "ERROR: #{e.message}: #{e.response}"
|
98
107
|
rescue StandardError => e
|
data/lib/pwn/ai/ollama.rb
CHANGED
@@ -56,44 +56,53 @@ module PWN
|
|
56
56
|
spin.auto_spin
|
57
57
|
end
|
58
58
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
url: "#{base_uri}/#{rest_call}",
|
65
|
-
headers: headers,
|
66
|
-
verify_ssl: false,
|
67
|
-
timeout: timeout
|
68
|
-
)
|
69
|
-
|
70
|
-
when :post
|
71
|
-
if http_body.key?(:multipart)
|
72
|
-
headers[:content_type] = 'multipart/form-data'
|
73
|
-
|
59
|
+
retry_count = 0
|
60
|
+
begin
|
61
|
+
case http_method
|
62
|
+
when :delete, :get
|
63
|
+
headers[:params] = params
|
74
64
|
response = rest_client.execute(
|
75
65
|
method: http_method,
|
76
66
|
url: "#{base_uri}/#{rest_call}",
|
77
67
|
headers: headers,
|
78
|
-
payload: http_body,
|
79
68
|
verify_ssl: false,
|
80
69
|
timeout: timeout
|
81
70
|
)
|
71
|
+
|
72
|
+
when :post
|
73
|
+
if http_body.key?(:multipart)
|
74
|
+
headers[:content_type] = 'multipart/form-data'
|
75
|
+
|
76
|
+
response = rest_client.execute(
|
77
|
+
method: http_method,
|
78
|
+
url: "#{base_uri}/#{rest_call}",
|
79
|
+
headers: headers,
|
80
|
+
payload: http_body,
|
81
|
+
verify_ssl: false,
|
82
|
+
timeout: timeout
|
83
|
+
)
|
84
|
+
else
|
85
|
+
response = rest_client.execute(
|
86
|
+
method: http_method,
|
87
|
+
url: "#{base_uri}/#{rest_call}",
|
88
|
+
headers: headers,
|
89
|
+
payload: http_body.to_json,
|
90
|
+
verify_ssl: false,
|
91
|
+
timeout: timeout
|
92
|
+
)
|
93
|
+
end
|
94
|
+
|
82
95
|
else
|
83
|
-
|
84
|
-
method: http_method,
|
85
|
-
url: "#{base_uri}/#{rest_call}",
|
86
|
-
headers: headers,
|
87
|
-
payload: http_body.to_json,
|
88
|
-
verify_ssl: false,
|
89
|
-
timeout: timeout
|
90
|
-
)
|
96
|
+
raise @@logger.error("Unsupported HTTP Method #{http_method} for #{self} Plugin")
|
91
97
|
end
|
98
|
+
response
|
99
|
+
rescue RestClient::TooManyRequests => e
|
100
|
+
retry_after = e.response.headers[:retry_after]&.to_i ||= (0.5 * (retry_count + 1))
|
101
|
+
sleep(retry_after + rand(0.3..5.0))
|
102
|
+
retry_count += 1
|
92
103
|
|
93
|
-
|
94
|
-
raise @@logger.error("Unsupported HTTP Method #{http_method} for #{self} Plugin")
|
104
|
+
retry
|
95
105
|
end
|
96
|
-
response
|
97
106
|
rescue RestClient::ExceptionWithResponse => e
|
98
107
|
puts "ERROR: #{e.message}: #{e.response}"
|
99
108
|
rescue StandardError => e
|
data/lib/pwn/ai/open_ai.rb
CHANGED
@@ -56,44 +56,53 @@ module PWN
|
|
56
56
|
spin.auto_spin
|
57
57
|
end
|
58
58
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
url: "#{base_uri}/#{rest_call}",
|
65
|
-
headers: headers,
|
66
|
-
verify_ssl: false,
|
67
|
-
timeout: timeout
|
68
|
-
)
|
69
|
-
|
70
|
-
when :post
|
71
|
-
if http_body.key?(:multipart)
|
72
|
-
headers[:content_type] = 'multipart/form-data'
|
73
|
-
|
59
|
+
retry_count = 0
|
60
|
+
begin
|
61
|
+
case http_method
|
62
|
+
when :delete, :get
|
63
|
+
headers[:params] = params
|
74
64
|
response = rest_client.execute(
|
75
65
|
method: http_method,
|
76
66
|
url: "#{base_uri}/#{rest_call}",
|
77
67
|
headers: headers,
|
78
|
-
payload: http_body,
|
79
68
|
verify_ssl: false,
|
80
69
|
timeout: timeout
|
81
70
|
)
|
71
|
+
|
72
|
+
when :post
|
73
|
+
if http_body.key?(:multipart)
|
74
|
+
headers[:content_type] = 'multipart/form-data'
|
75
|
+
|
76
|
+
response = rest_client.execute(
|
77
|
+
method: http_method,
|
78
|
+
url: "#{base_uri}/#{rest_call}",
|
79
|
+
headers: headers,
|
80
|
+
payload: http_body,
|
81
|
+
verify_ssl: false,
|
82
|
+
timeout: timeout
|
83
|
+
)
|
84
|
+
else
|
85
|
+
response = rest_client.execute(
|
86
|
+
method: http_method,
|
87
|
+
url: "#{base_uri}/#{rest_call}",
|
88
|
+
headers: headers,
|
89
|
+
payload: http_body.to_json,
|
90
|
+
verify_ssl: false,
|
91
|
+
timeout: timeout
|
92
|
+
)
|
93
|
+
end
|
94
|
+
|
82
95
|
else
|
83
|
-
|
84
|
-
method: http_method,
|
85
|
-
url: "#{base_uri}/#{rest_call}",
|
86
|
-
headers: headers,
|
87
|
-
payload: http_body.to_json,
|
88
|
-
verify_ssl: false,
|
89
|
-
timeout: timeout
|
90
|
-
)
|
96
|
+
raise @@logger.error("Unsupported HTTP Method #{http_method} for #{self} Plugin")
|
91
97
|
end
|
98
|
+
response
|
99
|
+
rescue RestClient::TooManyRequests => e
|
100
|
+
retry_after = e.response.headers[:retry_after]&.to_i ||= (0.5 * (retry_count + 1))
|
101
|
+
sleep(retry_after + rand(0.3..5.0))
|
102
|
+
retry_count += 1
|
92
103
|
|
93
|
-
|
94
|
-
raise @@logger.error("Unsupported HTTP Method #{http_method} for #{self} Plugin")
|
104
|
+
retry
|
95
105
|
end
|
96
|
-
response
|
97
106
|
rescue RestClient::ExceptionWithResponse => e
|
98
107
|
puts "ERROR: #{e.message}: #{e.response}"
|
99
108
|
rescue StandardError => e
|
data/lib/pwn/config.rb
CHANGED
data/lib/pwn/version.rb
CHANGED
data/lib/pwn.rb
CHANGED
@@ -29,7 +29,7 @@ module PWN
|
|
29
29
|
# PWN::Env is the constant that stores the configuration data
|
30
30
|
# Only call this if the program name is not pwn
|
31
31
|
driver = File.basename($PROGRAM_NAME)
|
32
|
-
PWN::Config.refresh_env
|
32
|
+
PWN::Config.refresh_env
|
33
33
|
rescue StandardError => e
|
34
34
|
puts e.backtrace
|
35
35
|
raise e
|