pwn 0.4.585 → 0.4.587
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/pwn/plugins/char.rb +2 -2
- data/lib/pwn/plugins.rb +0 -1
- data/lib/pwn/version.rb +1 -1
- metadata +2 -3
- data/lib/pwn/plugins/chat_sonic.rb +0 -146
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edbd3e039b05f4edfa899e87b7de61684e938d845744ea9e64a298310ad1f814
|
4
|
+
data.tar.gz: 2edc89df9b6c1ba30a48ea0bade2906a124a6c933dcc8edc2529b42a828788a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 196749c434149d59b04f937875f06e6f8288c4125b1fb446f975ca2cac7dd4c7857e949470da43aa627e579c92df0fcc88e5a69e004a6a9f2ed8a40cb888ceff
|
7
|
+
data.tar.gz: a2c64ebab3da4037466a52f0e6af5690c08e3ad28ebae3187784dab2b3a6931fb82e003a642d18e53619d0c52a922d4a5ddd8db782c5ac17b287cfd4b74ac58d
|
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.587]: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.
|
55
|
+
pwn[v0.4.587]:001 >>> PWN.help
|
56
56
|
```
|
57
57
|
|
58
58
|
|
data/lib/pwn/plugins/char.rb
CHANGED
@@ -368,7 +368,7 @@ module PWN
|
|
368
368
|
end
|
369
369
|
end
|
370
370
|
|
371
|
-
if File.read(this_file).
|
371
|
+
if File.read(this_file).empty?
|
372
372
|
File.unlink(this_file)
|
373
373
|
else
|
374
374
|
print '.'
|
@@ -376,7 +376,7 @@ module PWN
|
|
376
376
|
rescue StandardError => e
|
377
377
|
puts "FILE GENERATION ATTEMPT OF: #{this_file} RESULTED THE FOLLOWING ERROR:"
|
378
378
|
puts "#{e.class}: #{e.message}\n#{e.backtrace}\n\n\n"
|
379
|
-
File.unlink(this_file) if File.read(this_file).
|
379
|
+
File.unlink(this_file) if File.read(this_file).empty?
|
380
380
|
next
|
381
381
|
end
|
382
382
|
print "\n"
|
data/lib/pwn/plugins.rb
CHANGED
@@ -14,7 +14,6 @@ module PWN
|
|
14
14
|
autoload :BurpSuite, 'pwn/plugins/burp_suite'
|
15
15
|
autoload :BusPirate, 'pwn/plugins/bus_pirate'
|
16
16
|
autoload :Char, 'pwn/plugins/char'
|
17
|
-
autoload :ChatSonic, 'pwn/plugins/chat_sonic'
|
18
17
|
autoload :CreditCard, 'pwn/plugins/credit_card'
|
19
18
|
autoload :PWNLogger, 'pwn/plugins/pwn_logger'
|
20
19
|
autoload :DAOLDAP, 'pwn/plugins/dao_ldap'
|
data/lib/pwn/version.rb
CHANGED
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.4.
|
4
|
+
version: 0.4.587
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 0day Inc.
|
@@ -1566,7 +1566,6 @@ files:
|
|
1566
1566
|
- lib/pwn/plugins/burp_suite.rb
|
1567
1567
|
- lib/pwn/plugins/bus_pirate.rb
|
1568
1568
|
- lib/pwn/plugins/char.rb
|
1569
|
-
- lib/pwn/plugins/chat_sonic.rb
|
1570
1569
|
- lib/pwn/plugins/credit_card.rb
|
1571
1570
|
- lib/pwn/plugins/dao_ldap.rb
|
1572
1571
|
- lib/pwn/plugins/dao_mongo.rb
|
@@ -2034,7 +2033,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
2034
2033
|
- !ruby/object:Gem::Version
|
2035
2034
|
version: '0'
|
2036
2035
|
requirements: []
|
2037
|
-
rubygems_version: 3.4.
|
2036
|
+
rubygems_version: 3.4.2
|
2038
2037
|
signing_key:
|
2039
2038
|
specification_version: 4
|
2040
2039
|
summary: Automated Security Testing for CI/CD Pipelines & Beyond
|
@@ -1,146 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'json'
|
4
|
-
|
5
|
-
module PWN
|
6
|
-
module Plugins
|
7
|
-
# This plugin is used for interacting w/ ChatSonic's REST API using
|
8
|
-
# the 'rest' browser type of PWN::Plugins::TransparentBrowser.
|
9
|
-
# This is based on the following ChatSonic API Specification:
|
10
|
-
# https://docs.writesonic.com/reference/chatsonic_v2businesscontentchatsonic_post-1
|
11
|
-
module ChatSonic
|
12
|
-
@@logger = PWN::Plugins::PWNLogger.create
|
13
|
-
|
14
|
-
# Supported Method Parameters::
|
15
|
-
# chat_sonic_rest_call(
|
16
|
-
# apu_key: 'required - chat_sonic api_key',
|
17
|
-
# http_method: 'optional HTTP method (defaults to GET)
|
18
|
-
# rest_call: 'required rest call to make per the schema',
|
19
|
-
# params: 'optional params passed in the URI or HTTP Headers',
|
20
|
-
# http_body: 'optional HTTP body sent in HTTP methods that support it e.g. POST'
|
21
|
-
# )
|
22
|
-
|
23
|
-
private_class_method def self.chat_sonic_rest_call(opts = {})
|
24
|
-
http_method = if opts[:http_method].nil?
|
25
|
-
:get
|
26
|
-
else
|
27
|
-
opts[:http_method].to_s.scrub.to_sym
|
28
|
-
end
|
29
|
-
rest_call = opts[:rest_call].to_s.scrub
|
30
|
-
params = opts[:params]
|
31
|
-
http_body = opts[:http_body].to_s.scrub
|
32
|
-
base_chat_sonic_api_uri = 'https://api.writesonic.com/v2/business/content'
|
33
|
-
api_key = opts[:api_key]
|
34
|
-
|
35
|
-
rest_client = PWN::Plugins::TransparentBrowser.open(browser_type: :rest)::Request
|
36
|
-
|
37
|
-
case http_method
|
38
|
-
when :get
|
39
|
-
response = rest_client.execute(
|
40
|
-
method: :get,
|
41
|
-
url: "#{base_chat_sonic_api_uri}/#{rest_call}",
|
42
|
-
headers: {
|
43
|
-
accept: 'application/json',
|
44
|
-
content_type: 'application/json; charset=UTF-8',
|
45
|
-
x_api_key: api_key,
|
46
|
-
params: params
|
47
|
-
},
|
48
|
-
verify_ssl: false
|
49
|
-
)
|
50
|
-
|
51
|
-
when :post
|
52
|
-
response = rest_client.execute(
|
53
|
-
method: :post,
|
54
|
-
url: "#{base_chat_sonic_api_uri}/#{rest_call}",
|
55
|
-
headers: {
|
56
|
-
accept: 'application/json',
|
57
|
-
content_type: 'application/json; charset=UTF-8',
|
58
|
-
x_api_key: api_key,
|
59
|
-
params: params
|
60
|
-
},
|
61
|
-
payload: http_body,
|
62
|
-
verify_ssl: false
|
63
|
-
)
|
64
|
-
|
65
|
-
else
|
66
|
-
raise @@logger.error("Unsupported HTTP Method #{http_method} for #{self} Plugin")
|
67
|
-
end
|
68
|
-
response
|
69
|
-
rescue StandardError => e
|
70
|
-
case e.message
|
71
|
-
when '400 Bad Request', '404 Resource Not Found'
|
72
|
-
"#{e.message}: #{e.response}"
|
73
|
-
else
|
74
|
-
raise e
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
# Supported Method Parameters::
|
79
|
-
# response = PWN::Plugins::ChatSonic.chat(
|
80
|
-
# api_key: 'required - ChatSonic API Key',
|
81
|
-
# input_text: 'required - message to ChatSonic'
|
82
|
-
# enable_google_results: 'optional - use Google to answer (default to true)',
|
83
|
-
# enable_memory: 'optional - try to continue previous conversation (default to false)',
|
84
|
-
# )
|
85
|
-
|
86
|
-
public_class_method def self.chat(opts = {})
|
87
|
-
api_key = opts[:api_key]
|
88
|
-
input_text = opts[:input_text]
|
89
|
-
|
90
|
-
enable_google_results = opts[:enable_google_results]
|
91
|
-
enable_google_results ||= true
|
92
|
-
|
93
|
-
enable_memory = opts[:enable_memory]
|
94
|
-
enable_memory ||= false
|
95
|
-
|
96
|
-
params = opts[:params]
|
97
|
-
params ||= {}
|
98
|
-
|
99
|
-
rest_call = 'chatsonic'
|
100
|
-
|
101
|
-
params[:engine] = 'premium'
|
102
|
-
|
103
|
-
http_body = {
|
104
|
-
enable_google_results: enable_google_results,
|
105
|
-
enable_memory: enable_memory,
|
106
|
-
input_text: input_text
|
107
|
-
}
|
108
|
-
|
109
|
-
response = chat_sonic_rest_call(
|
110
|
-
http_method: :post,
|
111
|
-
api_key: api_key,
|
112
|
-
rest_call: rest_call,
|
113
|
-
params: params,
|
114
|
-
http_body: http_body.to_json
|
115
|
-
)
|
116
|
-
|
117
|
-
JSON.parse(response, symbolize_names: true)
|
118
|
-
rescue StandardError => e
|
119
|
-
raise e
|
120
|
-
end
|
121
|
-
|
122
|
-
# Author(s):: 0day Inc. <request.pentest@0dayinc.com>
|
123
|
-
|
124
|
-
public_class_method def self.authors
|
125
|
-
"AUTHOR(S):
|
126
|
-
0day Inc. <request.pentest@0dayinc.com>
|
127
|
-
"
|
128
|
-
end
|
129
|
-
|
130
|
-
# Display Usage for this Module
|
131
|
-
|
132
|
-
public_class_method def self.help
|
133
|
-
puts "USAGE:
|
134
|
-
response = #{self}.chat(
|
135
|
-
api_key: 'required - ChatSonic API Key',
|
136
|
-
input_text: 'required - message to ChatSonic'
|
137
|
-
enable_google_results: 'optional - use Google to answer (default to true)',
|
138
|
-
enable_memory: 'optional - try to continue previous conversation (default to false)',
|
139
|
-
)
|
140
|
-
|
141
|
-
#{self}.authors
|
142
|
-
"
|
143
|
-
end
|
144
|
-
end
|
145
|
-
end
|
146
|
-
end
|