pwn 0.4.585 → 0.4.586

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: b544200c367ae8482617151dc6d4f4448489713e9aae3377aec3b9f70d149cf0
4
- data.tar.gz: d5298d12a15d8c791a910c6010943a2ca67071b59fbe97fbf238948996f89abc
3
+ metadata.gz: e349e13e832434e95d19686c672915f3a841f0fefa288a3fb10d415ae8caec3b
4
+ data.tar.gz: 67fd415056ef09d43646bbe8f8092509795ce0ceed3f2aae0d7f61773ac66495
5
5
  SHA512:
6
- metadata.gz: 1ba49576c14cd2f10599f15890be9f044ce83ca435dfc9130bfb9c12ccbc94b8e03ad10232dcd9cb776c00e6903bb678f3eb23ebcb6146fa0d0de2ff598ee0b1
7
- data.tar.gz: 0f27f859b6342d23efa84e07917477a28b2732f1ec8adb75ee8b205940a8be908bc8936b2018dd2e9f86277258acbfe9602490653853fc754c5f243077897a69
6
+ metadata.gz: 9ab1d37b1985de8260dcb4b9042ebe01a860d1ba1f6f931b48dde412bc9ec9afb5e2ab6566c0c0e9ffbdcca8ddad0488900089dbe9b6a3b6cc3d53b1bbeb913f
7
+ data.tar.gz: a95774ba0295a9458cde265a3328703183debf41e043e38034c8f2bcd26d4deb83521dbdbec67ba6746d50266b06c5b97a4553d36376cb2d95a5301e5c64fcd5
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.585]:001 >>> PWN.help
40
+ pwn[v0.4.586]: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.585]:001 >>> PWN.help
55
+ pwn[v0.4.586]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PWN
4
- VERSION = '0.4.585'
4
+ VERSION = '0.4.586'
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.4.585
4
+ version: 0.4.586
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.1
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