pwn 0.4.530 → 0.4.533

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 612f547ef710363dbb2354048dbae80679dc8153f74512d09847f8d43e29e90c
4
- data.tar.gz: ce2ef03d718183d5130749244cd0237774b3b58003e693b790c59abf21abbe5f
3
+ metadata.gz: 8807c949959dce31363a83a20bb3948204d6be996b8eb11c722cd89a1c79edba
4
+ data.tar.gz: 49cce1612c878b7efdff59889de8079f7888075c918d460981a626b7e81ba588
5
5
  SHA512:
6
- metadata.gz: 6fd3b7a65884a9551eb6b8cec0b34f1d96dd3211d2d511c144ef31a93ba5ca828327c7c768e42b694765f46af93cfd8b858275c5cf4b9b1065336c430edb1ce7
7
- data.tar.gz: 0bef199fc9669b712205d3dac1d30e50b24135dd389a28ceccc1a7e193c9fc01fbf33f578665f808d52f22e0d67d55fc72eccda2819b230317eaa7010b7b2f9e
6
+ metadata.gz: 563a4f4dc42433fe5d9663b56adce9c42d04bf313f0256585130c8897f74242904efe0a83b80e1ce94f986aa1bf64718b24d9487e39dd7a2e55b99b46cdd18f1
7
+ data.tar.gz: 3117a7944577b35453f50f06f1e07b3da2d7049280f0922d52d9efb6126082e7232508584703852a5675462f0231fb509b454f725d55a776de1261d8b51fb6ca
data/README.md CHANGED
@@ -37,7 +37,7 @@ $ rvm use ruby-3.1.2@pwn
37
37
  $ rvm list gemsets
38
38
  $ gem install --verbose pwn
39
39
  $ pwn
40
- pwn[v0.4.530]:001 >>> PWN.help
40
+ pwn[v0.4.533]: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.2@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.4.530]:001 >>> PWN.help
55
+ pwn[v0.4.533]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
@@ -21,6 +21,10 @@ OptionParser.new do |options|
21
21
  opts[:wordlist] = w
22
22
  end
23
23
 
24
+ options.on('-rHEADERS', '--request-headers=HEADERS', '<Optional - HTTP Request Headers in JSON Format)>') do |h|
25
+ opts[:http_request_headers] = h
26
+ end
27
+
24
28
  options.on('-tTHREADS', '--max-threads=THREADS', '<Optional # HTTP Requests to Run Simultaneously (Default 100)>') do |t|
25
29
  opts[:max_threads] = t
26
30
  end
@@ -53,6 +57,8 @@ begin
53
57
  wordlist = opts[:wordlist]
54
58
  raise "ERROR: #{wordlist} Does Not Exist." unless File.exist?(wordlist)
55
59
 
60
+ http_request_headers = opts[:http_request_headers]
61
+
56
62
  max_threads = opts[:max_threads]
57
63
  max_threads ||= 100
58
64
 
@@ -82,6 +88,7 @@ begin
82
88
 
83
89
  next if wordlist_line.match?(/^#/)
84
90
 
91
+ # http_methods = %i[CONNECT DELETE GET HEAD OPTIONS PATCH POST PUT TRACE]
85
92
  http_methods = %i[GET HEAD POST PUT DELETE OPTIONS TRACE]
86
93
  http_methods.each do |http_method|
87
94
  begin
@@ -89,9 +96,19 @@ begin
89
96
  http_uri = "#{target_url}/#{wordlist_line}"
90
97
  rest_client_resp_hash = {}
91
98
  rest_client = PWN::Plugins::TransparentBrowser.open(browser_type: :rest)::Request
99
+
100
+ headers = nil
101
+ if http_request_headers
102
+ headers = JSON.parse(
103
+ http_request_headers,
104
+ symbolize_names: true
105
+ )
106
+ end
107
+
92
108
  response = rest_client.execute(
93
109
  method: http_method,
94
110
  url: http_uri,
111
+ headers: headers,
95
112
  verify_ssl: false
96
113
  )
97
114
 
@@ -102,10 +119,12 @@ begin
102
119
  http_resp_code: response.code,
103
120
  http_resp: response.body[0..300]
104
121
  }
105
- rescue RestClient::Forbidden,
106
- RestClient::BadRequest,
122
+ rescue RestClient::BadRequest,
123
+ RestClient::Forbidden,
124
+ RestClient::GatewayTimeout,
107
125
  RestClient::MethodNotAllowed,
108
- RestClient::NotFound => e
126
+ RestClient::NotFound,
127
+ RestClient::ServiceUnavailable => e
109
128
 
110
129
  rest_client_resp_hash = {
111
130
  request_timestamp: Time.now.strftime('%Y-%m-%d_%H-%M-%S'),
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.530'
4
+ VERSION = '0.4.533'
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.530
4
+ version: 0.4.533
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-08-29 00:00:00.000000000 Z
11
+ date: 2022-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport