pwn 0.4.545 → 0.4.546
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/bin/pwn_www_uri_buster +78 -66
- 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: fb5cb201bcb76d6d206fb20e15fe749eb46837aea978fe0480c172a7926ac034
|
4
|
+
data.tar.gz: 7e9e2b80e4762619251c1be2d4cf844c0849f1e71ad5b11e90736324884072a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06b1809a5b8f8a106c5bf84cda440a3a6943b900c417a6f6994b93727b5314fae5bb89d40a4983307606d853223fdb1b09cc464d54ea12aa5068d70c1bd21a3d
|
7
|
+
data.tar.gz: 36eea59775283c86e6ceda33860ff75c6486a9ed2c0314c632804661d791e6467e00414ae473e275510eb6bc5f3d1554f542273f2594f180fd7adb6eea829f56
|
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.
|
40
|
+
pwn[v0.4.546]:001 >>> PWN.help
|
41
41
|
```
|
42
42
|
|
43
43
|
[](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.
|
55
|
+
pwn[v0.4.546]:001 >>> PWN.help
|
56
56
|
```
|
57
57
|
|
58
58
|
|
data/bin/pwn_www_uri_buster
CHANGED
@@ -51,6 +51,76 @@ if opts.empty?
|
|
51
51
|
exit 1
|
52
52
|
end
|
53
53
|
|
54
|
+
def request_path(opts = {})
|
55
|
+
target_url = opts[:target_url]
|
56
|
+
proxy = opts[:proxy]
|
57
|
+
wordlist_line = opts[:wordlist_line]
|
58
|
+
|
59
|
+
http_methods = %i[DELETE GET HEAD OPTIONS PATCH POST PUT TRACE]
|
60
|
+
http_methods.each do |http_method|
|
61
|
+
begin
|
62
|
+
print '.'
|
63
|
+
http_uri = "#{target_url}/#{wordlist_line}"
|
64
|
+
rest_client_resp_hash = {}
|
65
|
+
if proxy
|
66
|
+
rest_client = PWN::Plugins::TransparentBrowser.open(
|
67
|
+
browser_type: :rest,
|
68
|
+
proxy: proxy
|
69
|
+
)::Request
|
70
|
+
else
|
71
|
+
rest_client = PWN::Plugins::TransparentBrowser.open(
|
72
|
+
browser_type: :rest
|
73
|
+
)::Request
|
74
|
+
end
|
75
|
+
|
76
|
+
headers = nil
|
77
|
+
if http_request_headers
|
78
|
+
headers = JSON.parse(
|
79
|
+
http_request_headers,
|
80
|
+
symbolize_names: true
|
81
|
+
)
|
82
|
+
end
|
83
|
+
|
84
|
+
response = rest_client.execute(
|
85
|
+
method: http_method,
|
86
|
+
url: http_uri,
|
87
|
+
headers: headers,
|
88
|
+
verify_ssl: false
|
89
|
+
)
|
90
|
+
|
91
|
+
rest_client_resp_hash = {
|
92
|
+
request_timestamp: Time.now.strftime('%Y-%m-%d_%H-%M-%S'),
|
93
|
+
http_uri: http_uri,
|
94
|
+
http_method: http_method,
|
95
|
+
http_resp_code: response.code,
|
96
|
+
http_resp_length: response.body.length,
|
97
|
+
http_resp: "#{response.body[0..300]}..."
|
98
|
+
}
|
99
|
+
rescue RestClient::ExceptionWithResponse,
|
100
|
+
RestClient::ServerBrokeConnection => e
|
101
|
+
rest_client_resp_hash = {
|
102
|
+
request_timestamp: Time.now.strftime('%Y-%m-%d_%H-%M-%S'),
|
103
|
+
http_uri: http_uri,
|
104
|
+
http_method: http_method,
|
105
|
+
http_resp_code: e.response.code,
|
106
|
+
http_resp_length: e.response.body.length,
|
107
|
+
http_resp: "#{e.response.body[0..300]}..."
|
108
|
+
}
|
109
|
+
next
|
110
|
+
rescue URI::InvalidURIError
|
111
|
+
url_encoded_wordlist_arr = []
|
112
|
+
wordlist_line.split('/').each do |path|
|
113
|
+
url_encoded_wordlist_arr.push(CGI.escape(path))
|
114
|
+
end
|
115
|
+
wordlist_line = url_encoded_wordlist_arr.join('/')
|
116
|
+
|
117
|
+
retry
|
118
|
+
rescue RestClient::TooManyRequests
|
119
|
+
sleep 60
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
54
124
|
begin
|
55
125
|
pwn_provider = ENV.fetch('PWN_PROVIDER') if ENV.fetch('PWN_PROVIDER')
|
56
126
|
$stdout.sync = true
|
@@ -94,73 +164,15 @@ begin
|
|
94
164
|
|
95
165
|
next if wordlist_line.match?(/^#/)
|
96
166
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
rest_client_resp_hash = {}
|
104
|
-
if proxy
|
105
|
-
rest_client = PWN::Plugins::TransparentBrowser.open(
|
106
|
-
browser_type: :rest,
|
107
|
-
proxy: proxy
|
108
|
-
)::Request
|
109
|
-
else
|
110
|
-
rest_client = PWN::Plugins::TransparentBrowser.open(
|
111
|
-
browser_type: :rest
|
112
|
-
)::Request
|
113
|
-
end
|
114
|
-
|
115
|
-
headers = nil
|
116
|
-
if http_request_headers
|
117
|
-
headers = JSON.parse(
|
118
|
-
http_request_headers,
|
119
|
-
symbolize_names: true
|
120
|
-
)
|
121
|
-
end
|
122
|
-
|
123
|
-
response = rest_client.execute(
|
124
|
-
method: http_method,
|
125
|
-
url: http_uri,
|
126
|
-
headers: headers,
|
127
|
-
verify_ssl: false
|
128
|
-
)
|
167
|
+
rest_client_resp_hash = request_path(
|
168
|
+
target_url: target_url,
|
169
|
+
http_request_headers: http_request_headers,
|
170
|
+
proxy: proxy,
|
171
|
+
wordlist_line: wordlist_line
|
172
|
+
)
|
129
173
|
|
130
|
-
|
131
|
-
|
132
|
-
http_uri: http_uri,
|
133
|
-
http_method: http_method,
|
134
|
-
http_resp_code: response.code,
|
135
|
-
http_resp_length: response.body.length,
|
136
|
-
http_resp: "#{response.body[0..300]}..."
|
137
|
-
}
|
138
|
-
rescue RestClient::ExceptionWithResponse,
|
139
|
-
RestClient::ServerBrokeConnection => e
|
140
|
-
rest_client_resp_hash = {
|
141
|
-
request_timestamp: Time.now.strftime('%Y-%m-%d_%H-%M-%S'),
|
142
|
-
http_uri: http_uri,
|
143
|
-
http_method: http_method,
|
144
|
-
http_resp_code: e.response.code,
|
145
|
-
http_resp_length: e.response.body.length,
|
146
|
-
http_resp: "#{e.response.body[0..300]}..."
|
147
|
-
}
|
148
|
-
next
|
149
|
-
rescue URI::InvalidURIError
|
150
|
-
url_encoded_wordlist_arr = []
|
151
|
-
wordlist_line.split('/').each do |path|
|
152
|
-
url_encoded_wordlist_arr.push(CGI.escape(path))
|
153
|
-
end
|
154
|
-
wordlist_line = url_encoded_wordlist_arr.join('/')
|
155
|
-
|
156
|
-
retry
|
157
|
-
rescue RestClient::TooManyRequests
|
158
|
-
sleep 60
|
159
|
-
ensure
|
160
|
-
mutex.synchronize do
|
161
|
-
results_hash[:data].push(rest_client_resp_hash)
|
162
|
-
end
|
163
|
-
end
|
174
|
+
mutex.synchronize do
|
175
|
+
results_hash[:data].push(rest_client_resp_hash)
|
164
176
|
end
|
165
177
|
end
|
166
178
|
|
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.546
|
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-09-
|
11
|
+
date: 2022-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|