ronin-web 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +14 -0
- data/.rubocop.yml +20 -0
- data/ChangeLog.md +6 -1
- data/Gemfile +12 -8
- data/Rakefile +1 -1
- data/bin/ronin-web +6 -7
- data/data/new/webapp/Gemfile +2 -2
- data/data/new/webapp/config.ru +0 -2
- data/gemspec.yml +1 -1
- data/lib/ronin/web/cli/command.rb +4 -0
- data/lib/ronin/web/cli/commands/diff.rb +2 -1
- data/lib/ronin/web/cli/commands/html.rb +3 -2
- data/lib/ronin/web/cli/commands/irb.rb +1 -0
- data/lib/ronin/web/cli/commands/new/spider.rb +3 -4
- data/lib/ronin/web/cli/commands/reverse_proxy.rb +5 -4
- data/lib/ronin/web/cli/commands/server.rb +2 -1
- data/lib/ronin/web/cli/commands/spider.rb +73 -71
- data/lib/ronin/web/cli/ruby_shell.rb +1 -0
- data/lib/ronin/web/cli.rb +1 -0
- data/lib/ronin/web/html.rb +1 -0
- data/lib/ronin/web/mechanize.rb +3 -0
- data/lib/ronin/web/root.rb +1 -0
- data/lib/ronin/web/version.rb +2 -1
- data/lib/ronin/web/xml.rb +1 -0
- data/lib/ronin/web.rb +7 -2
- data/ronin-web.gemspec +6 -5
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b06c9dc8b62562796e3075d979eb732e3de726942e3a33998e0c19a74cbe9d8
|
4
|
+
data.tar.gz: e3cb8dc314f28ca3f93184136a1d978d4b21233c3756b5fa9043ed7179fe7b4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c993ca1329a69b7bff73b6f7b52f111d65362fc539205b236f62d1a9211d996c9564efaf6f86c2ae157e346c5c740249b70cc00ac1603e2389137204044f214
|
7
|
+
data.tar.gz: 7fb586226ee4c84048a0ebae55097f86514a83bea52825a4f88237464bb56af31c56849a9bd72ec1ca2f0ea705b06e72b96443fb2666fa022bb3eebec31da170
|
data/.github/workflows/ruby.yml
CHANGED
@@ -26,3 +26,17 @@ jobs:
|
|
26
26
|
run: bundle install --jobs 4 --retry 3
|
27
27
|
- name: Run tests
|
28
28
|
run: bundle exec rake test
|
29
|
+
|
30
|
+
# rubocop linting
|
31
|
+
rubocop:
|
32
|
+
runs-on: ubuntu-latest
|
33
|
+
steps:
|
34
|
+
- uses: actions/checkout@v2
|
35
|
+
- name: Set up Ruby
|
36
|
+
uses: ruby/setup-ruby@v1
|
37
|
+
with:
|
38
|
+
ruby-version: 3.0
|
39
|
+
- name: Install dependencies
|
40
|
+
run: bundle install --jobs 4 --retry 3
|
41
|
+
- name: Run rubocop
|
42
|
+
run: bundle exec rubocop --parallel
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
AllCops:
|
2
|
+
NewCops: enable
|
3
|
+
SuggestExtensions: false
|
4
|
+
TargetRubyVersion: 3.1
|
5
|
+
|
6
|
+
inherit_gem:
|
7
|
+
rubocop-ronin: rubocop.yml
|
8
|
+
|
9
|
+
#
|
10
|
+
# ronin-web specific exceptions
|
11
|
+
#
|
12
|
+
|
13
|
+
Style/FrozenStringLiteralComment:
|
14
|
+
Exclude:
|
15
|
+
- 'data/new/**/*'
|
16
|
+
|
17
|
+
Lint/ShadowingOuterLocalVariable:
|
18
|
+
Exclude:
|
19
|
+
- 'lib/ronin/web/cli/commands/reverse_proxy.rb'
|
20
|
+
- 'lib/ronin/web/cli/commands/spider.rb'
|
data/ChangeLog.md
CHANGED
@@ -1,4 +1,9 @@
|
|
1
|
-
### 1.0.
|
1
|
+
### 1.0.1 / 2023-03-01
|
2
|
+
|
3
|
+
* Require `ronin-web-server` ~> 0.1, >= 0.1.1.
|
4
|
+
* Disable SSL/TLS verification by default in {Ronin::Web::Mechanize}.
|
5
|
+
|
6
|
+
### 1.0.0 / 2023-02-01
|
2
7
|
|
3
8
|
* Added [nokogiri-ext] ~> 0.1 as a dependency.
|
4
9
|
* Added [nokogiri-diff] ~> 0.1 as a dependency.
|
data/Gemfile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
source 'https://rubygems.org'
|
2
4
|
|
3
5
|
gemspec
|
@@ -16,21 +18,21 @@ end
|
|
16
18
|
# gem 'rack', '~> 1.2', github: 'rack/rack'
|
17
19
|
# gem 'sinatra', '~> 1.2', github: 'sinatra/sinatra'
|
18
20
|
|
19
|
-
# gem 'command_kit',
|
20
|
-
#
|
21
|
+
# gem 'command_kit', '~> 0.4', github: 'postmodern/command_kit.rb',
|
22
|
+
# branch: '0.4.0'
|
21
23
|
|
22
24
|
# gem 'spidr', '~> 0.7', github: 'postmodern/spidr'
|
23
25
|
|
24
26
|
# Ronin dependencies
|
25
|
-
# gem 'ronin-support',
|
27
|
+
# gem 'ronin-support', '~> 1.0', github: "ronin-rb/ronin-support",
|
26
28
|
# branch: 'main'
|
27
|
-
# gem 'ronin-web-server',
|
29
|
+
# gem 'ronin-web-server', '~> 0.1', github: "ronin-rb/ronin-web-server",
|
28
30
|
# branch: 'main'
|
29
|
-
# gem 'ronin-web-spider',
|
31
|
+
# gem 'ronin-web-spider', '~> 0.1', github: "ronin-rb/ronin-web-spider",
|
30
32
|
# branch: 'main'
|
31
33
|
# gem 'ronin-web-user_agents', '~> 0.1', github: "ronin-rb/ronin-web-user_agents",
|
32
34
|
# branch: 'main'
|
33
|
-
# gem 'ronin-core',
|
35
|
+
# gem 'ronin-core', '~> 0.1', github: "ronin-rb/ronin-core",
|
34
36
|
# branch: 'main'
|
35
37
|
|
36
38
|
group :development do
|
@@ -49,6 +51,8 @@ group :development do
|
|
49
51
|
gem 'kramdown-man', '~> 0.1'
|
50
52
|
|
51
53
|
gem 'dead_end', require: false
|
52
|
-
gem 'sord', require: false
|
53
|
-
gem 'stackprof', require: false
|
54
|
+
gem 'sord', require: false, platform: :mri
|
55
|
+
gem 'stackprof', require: false, platform: :mri
|
56
|
+
gem 'rubocop', require: false, platform: :mri
|
57
|
+
gem 'rubocop-ronin', require: false, platform: :mri
|
54
58
|
end
|
data/Rakefile
CHANGED
data/bin/ronin-web
CHANGED
@@ -1,17 +1,16 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
require 'rubygems'
|
4
5
|
|
5
6
|
root = File.expand_path(File.join(File.dirname(__FILE__),'..'))
|
6
7
|
if File.directory?(File.join(root,'.git'))
|
7
8
|
Dir.chdir(root) do
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
exit -1
|
14
|
-
end
|
9
|
+
require 'bundler/setup'
|
10
|
+
rescue LoadError => e
|
11
|
+
warn e.message
|
12
|
+
warn "Run `gem install bundler` to install Bundler"
|
13
|
+
exit(-1)
|
15
14
|
end
|
16
15
|
end
|
17
16
|
|
data/data/new/webapp/Gemfile
CHANGED
@@ -2,5 +2,5 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
gem 'puma', '~> 6.0'
|
4
4
|
|
5
|
-
# gem 'ronin-support', '~> 1.0'
|
6
|
-
gem 'ronin-web-server', '~> 0.1'
|
5
|
+
# gem 'ronin-support', '~> 1.0' # , github: 'ronin-rb/ronin-support'
|
6
|
+
gem 'ronin-web-server', '~> 0.1' # , github: 'ronin-rb/ronin-web-server'
|
data/data/new/webapp/config.ru
CHANGED
data/gemspec.yml
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# ronin-web - A collection of useful web helper methods and commands.
|
3
4
|
#
|
@@ -24,6 +25,9 @@ require 'ronin/core/cli/command'
|
|
24
25
|
module Ronin
|
25
26
|
module Web
|
26
27
|
class CLI
|
28
|
+
#
|
29
|
+
# Base class for all `ronin-web` commands.
|
30
|
+
#
|
27
31
|
class Command < Core::CLI::Command
|
28
32
|
|
29
33
|
man_dir File.join(ROOT,'man')
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# ronin-web - A collection of useful web helper methods and commands.
|
3
4
|
#
|
@@ -42,7 +43,7 @@ module Ronin
|
|
42
43
|
# ## Options
|
43
44
|
#
|
44
45
|
# -h, --help Print help information
|
45
|
-
#
|
46
|
+
#
|
46
47
|
class Diff < Command
|
47
48
|
|
48
49
|
include CommandKit::Terminal
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# ronin-web - A collection of useful web helper methods and commands.
|
3
4
|
#
|
@@ -56,7 +57,7 @@ module Ronin
|
|
56
57
|
class Html < Command
|
57
58
|
|
58
59
|
usage '[options] {URL | FILE} [XPATH | CSS-path]'
|
59
|
-
|
60
|
+
|
60
61
|
option :xpath, short: '-X',
|
61
62
|
value: {type: String, usage: 'XPATH'},
|
62
63
|
desc: 'XPath query' do |xpath|
|
@@ -136,7 +137,7 @@ module Ronin
|
|
136
137
|
def run(source,query=@query)
|
137
138
|
unless query
|
138
139
|
print_error "must specify --xpath, --css-path, or an XPath/CSS-path argument"
|
139
|
-
exit
|
140
|
+
exit(-1)
|
140
141
|
end
|
141
142
|
|
142
143
|
doc = Nokogiri::HTML(read(source))
|
@@ -104,10 +104,9 @@ module Ronin
|
|
104
104
|
required: false
|
105
105
|
},
|
106
106
|
desc: 'Spiders a domain' do |value|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
107
|
+
@entry_point_method = :domain
|
108
|
+
@entry_point_argument = value
|
109
|
+
end
|
111
110
|
|
112
111
|
option :site, equals: true,
|
113
112
|
value: {
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# ronin-web - A collection of useful web helper methods and commands.
|
3
4
|
#
|
@@ -181,19 +182,19 @@ module Ronin
|
|
181
182
|
# @return [(Regexp, String), (String, String)]
|
182
183
|
#
|
183
184
|
def parse_rewrite_rule(value)
|
184
|
-
if
|
185
|
+
if (index = value.rindex('/:'))
|
185
186
|
regexp = Regexp.new(value[1...index])
|
186
|
-
replace = value[index+2..]
|
187
|
+
replace = value[(index + 2)..]
|
187
188
|
|
188
189
|
return [regexp, replace]
|
189
190
|
elsif (index = value.rindex(':'))
|
190
191
|
string = value[0...index]
|
191
|
-
replace = value[(index+1)..]
|
192
|
+
replace = value[(index + 1)..]
|
192
193
|
|
193
194
|
return [string, replace]
|
194
195
|
end
|
195
196
|
end
|
196
|
-
|
197
|
+
|
197
198
|
#
|
198
199
|
# Rewrites a request or response body.
|
199
200
|
#
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# ronin-web - A collection of useful web helper methods and commands.
|
3
4
|
#
|
@@ -42,7 +43,7 @@ module Ronin
|
|
42
43
|
# -r, --root DIR Root directory to serve
|
43
44
|
# -R, --redirect /PATH:URL Registers a 302 Found redirect at the given PATH
|
44
45
|
# -h, --help Print help information
|
45
|
-
#
|
46
|
+
#
|
46
47
|
class Server < Command
|
47
48
|
|
48
49
|
include Core::CLI::Logging
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# ronin-web - A collection of useful web helper methods and commands.
|
3
4
|
#
|
@@ -119,18 +120,18 @@ module Ronin
|
|
119
120
|
desc: 'Sets the read timeout'
|
120
121
|
|
121
122
|
option :ssl_timeout, value: {
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
123
|
+
type: Integer,
|
124
|
+
usage: 'SECS',
|
125
|
+
default: Spidr.ssl_timeout
|
126
|
+
},
|
127
|
+
desc: 'Sets the SSL connection timeout'
|
127
128
|
|
128
129
|
option :continue_timeout, value: {
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
130
|
+
type: Integer,
|
131
|
+
usage: 'SECS',
|
132
|
+
default: Spidr.continue_timeout
|
133
|
+
},
|
134
|
+
desc: 'Sets the continue timeout'
|
134
135
|
|
135
136
|
option :keep_alive_timeout, value: {
|
136
137
|
type: Integer,
|
@@ -168,14 +169,14 @@ module Ronin
|
|
168
169
|
end
|
169
170
|
|
170
171
|
option :user_agent, value: {
|
171
|
-
type:
|
172
|
+
type: String,
|
172
173
|
usage: 'USER-AGENT'
|
173
174
|
},
|
174
175
|
desc: 'Sets the User-Agent string'
|
175
176
|
|
176
177
|
option :user_agent_string, short: '-U',
|
177
178
|
value: {
|
178
|
-
type:
|
179
|
+
type: String,
|
179
180
|
usage: 'STRING'
|
180
181
|
},
|
181
182
|
desc: 'The User-Agent string to use' do |ua|
|
@@ -184,11 +185,9 @@ module Ronin
|
|
184
185
|
|
185
186
|
option :user_agent, short: '-u',
|
186
187
|
value: {
|
187
|
-
type:
|
188
|
-
|
189
|
-
|
190
|
-
}
|
191
|
-
]
|
188
|
+
type: Support::Network::HTTP::UserAgents::ALIASES.transform_keys { |key|
|
189
|
+
key.to_s.tr('_','-')
|
190
|
+
}
|
192
191
|
},
|
193
192
|
desc: 'The User-Agent to use' do |name|
|
194
193
|
@user_agent = name
|
@@ -196,34 +195,34 @@ module Ronin
|
|
196
195
|
|
197
196
|
option :referer, short: '-R',
|
198
197
|
value: {
|
199
|
-
type:
|
198
|
+
type: String,
|
200
199
|
usage: 'URL'
|
201
200
|
},
|
202
201
|
desc: 'Sets the Referer URL'
|
203
202
|
|
204
203
|
option :delay, short: '-d',
|
205
204
|
value: {
|
206
|
-
type:
|
205
|
+
type: Numeric,
|
207
206
|
usage: 'SECS'
|
208
207
|
},
|
209
208
|
desc: 'Sets the delay in seconds between each request'
|
210
209
|
|
211
210
|
option :limit, short: '-l',
|
212
211
|
value: {
|
213
|
-
type:
|
212
|
+
type: Integer,
|
214
213
|
usage: 'COUNT'
|
215
214
|
},
|
216
215
|
desc: 'Only spiders up to COUNT pages'
|
217
216
|
|
218
217
|
option :max_depth, short: '-d',
|
219
218
|
value: {
|
220
|
-
type:
|
221
|
-
usage: 'DEPTH'
|
219
|
+
type: Integer,
|
220
|
+
usage: 'DEPTH'
|
222
221
|
},
|
223
222
|
desc: 'Only spiders up to max depth'
|
224
223
|
|
225
224
|
option :enqueue, value: {
|
226
|
-
type:
|
225
|
+
type: String,
|
227
226
|
usage: 'URL'
|
228
227
|
},
|
229
228
|
desc: 'Adds the URL to the queue' do |url|
|
@@ -231,7 +230,7 @@ module Ronin
|
|
231
230
|
end
|
232
231
|
|
233
232
|
option :visited, value: {
|
234
|
-
type:
|
233
|
+
type: String,
|
235
234
|
usage: 'URL'
|
236
235
|
},
|
237
236
|
desc: 'Marks the URL as previously visited' do |url|
|
@@ -243,7 +242,7 @@ module Ronin
|
|
243
242
|
option :strip_query, desc: 'Enables/disables stripping the query component of every URL'
|
244
243
|
|
245
244
|
option :visit_host, value: {
|
246
|
-
type:
|
245
|
+
type: String,
|
247
246
|
usage: 'HOST'
|
248
247
|
},
|
249
248
|
desc: 'Visit URLs with the matching host name' do |host|
|
@@ -267,15 +266,15 @@ module Ronin
|
|
267
266
|
end
|
268
267
|
|
269
268
|
option :ignore_hosts_like, value: {
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
269
|
+
type: Regexp,
|
270
|
+
usage: '/REGEX/'
|
271
|
+
},
|
272
|
+
desc: 'Ignore the host names matching the REGEX' do |regex|
|
273
|
+
@ignore_hosts << regex
|
274
|
+
end
|
276
275
|
|
277
276
|
option :visit_port, value: {
|
278
|
-
type:
|
277
|
+
type: Integer,
|
279
278
|
usage: 'PORT'
|
280
279
|
},
|
281
280
|
desc: 'Visit URLs with the matching port number' do |port|
|
@@ -299,15 +298,15 @@ module Ronin
|
|
299
298
|
end
|
300
299
|
|
301
300
|
option :ignore_ports_like, value: {
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
301
|
+
type: Regexp,
|
302
|
+
usage: '/REGEX/'
|
303
|
+
},
|
304
|
+
desc: 'Ignore the port numbers matching the REGEXP' do |regex|
|
305
|
+
@ignore_ports << regex
|
306
|
+
end
|
308
307
|
|
309
308
|
option :visit_link, value: {
|
310
|
-
type:
|
309
|
+
type: String,
|
311
310
|
usage: 'URL'
|
312
311
|
},
|
313
312
|
desc: 'Visit the URL' do |link|
|
@@ -331,36 +330,36 @@ module Ronin
|
|
331
330
|
end
|
332
331
|
|
333
332
|
option :ignore_links_like, value: {
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
333
|
+
type: Regexp,
|
334
|
+
usage: '/REGEX/'
|
335
|
+
},
|
336
|
+
desc: 'Ignore URLs matching the REGEX' do |regex|
|
337
|
+
@ignore_links << regex
|
338
|
+
end
|
340
339
|
|
341
340
|
option :visit_ext, value: {
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
341
|
+
type: String,
|
342
|
+
usage: 'FILE_EXT'
|
343
|
+
},
|
344
|
+
desc: 'Visit URLs with the matching file ext' do |ext|
|
345
|
+
@visit_exts << ext
|
346
|
+
end
|
348
347
|
|
349
348
|
option :visit_exts_like, value: {
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
349
|
+
type: Regexp,
|
350
|
+
usage: '/REGEX/'
|
351
|
+
},
|
352
|
+
desc: 'Visit URLs with file exts that match the REGEX' do |regex|
|
353
|
+
@visit_exts << regex
|
354
|
+
end
|
356
355
|
|
357
356
|
option :ignore_ext, value: {
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
357
|
+
type: String,
|
358
|
+
usage: 'FILE_EXT'
|
359
|
+
},
|
360
|
+
desc: 'Ignore the URLs with the file ext' do |ext|
|
361
|
+
@ignore_exts << ext
|
362
|
+
end
|
364
363
|
|
365
364
|
option :ignore_exts_like, value: {
|
366
365
|
type: Regexp,
|
@@ -374,19 +373,19 @@ module Ronin
|
|
374
373
|
desc: 'Specifies whether to honor robots.txt'
|
375
374
|
|
376
375
|
option :host, value: {
|
377
|
-
type:
|
376
|
+
type: String,
|
378
377
|
usage: 'HOST'
|
379
378
|
},
|
380
379
|
desc: 'Spiders the specific HOST'
|
381
380
|
|
382
381
|
option :domain, value: {
|
383
|
-
type:
|
384
|
-
usage: 'DOMAIN'
|
382
|
+
type: String,
|
383
|
+
usage: 'DOMAIN'
|
385
384
|
},
|
386
385
|
desc: 'Spiders the whole domain'
|
387
386
|
|
388
387
|
option :site, value: {
|
389
|
-
type:
|
388
|
+
type: String,
|
390
389
|
usage: 'URL'
|
391
390
|
},
|
392
391
|
desc: 'Spiders the website, starting at the URL'
|
@@ -396,25 +395,25 @@ module Ronin
|
|
396
395
|
option :print_headers, desc: 'Print response headers for each URL'
|
397
396
|
|
398
397
|
option :print_header, value: {
|
399
|
-
type:
|
398
|
+
type: String,
|
400
399
|
usage: 'NAME'
|
401
400
|
},
|
402
401
|
desc: 'Prints a specific header'
|
403
402
|
|
404
403
|
option :history, value: {
|
405
|
-
type:
|
404
|
+
type: String,
|
406
405
|
usage: 'FILE'
|
407
406
|
},
|
408
407
|
desc: 'The history file'
|
409
408
|
|
410
409
|
option :archive, value: {
|
411
|
-
type:
|
410
|
+
type: String,
|
412
411
|
usage: 'DIR'
|
413
412
|
},
|
414
413
|
desc: 'Archive every visited page to the DIR'
|
415
414
|
|
416
415
|
option :git_archive, value: {
|
417
|
-
type:
|
416
|
+
type: String,
|
418
417
|
usage: 'DIR'
|
419
418
|
},
|
420
419
|
desc: 'Archive every visited page to the git repository'
|
@@ -588,6 +587,8 @@ module Ronin
|
|
588
587
|
end
|
589
588
|
end
|
590
589
|
|
590
|
+
# post-spidering tasks
|
591
|
+
|
591
592
|
if options[:git_archive]
|
592
593
|
archive.commit "Updated #{Time.now}"
|
593
594
|
end
|
@@ -699,6 +700,7 @@ module Ronin
|
|
699
700
|
#
|
700
701
|
def agent_kwargs
|
701
702
|
kwargs = {}
|
703
|
+
|
702
704
|
kwargs[:proxy] = options[:proxy] if options[:proxy]
|
703
705
|
|
704
706
|
unless @default_headers.empty?
|
data/lib/ronin/web/cli.rb
CHANGED
data/lib/ronin/web/html.rb
CHANGED
data/lib/ronin/web/mechanize.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# ronin-web - A collection of useful web helper methods and commands.
|
3
4
|
#
|
@@ -56,6 +57,8 @@ module Ronin
|
|
56
57
|
user_agent: Support::Network::HTTP.user_agent)
|
57
58
|
super()
|
58
59
|
|
60
|
+
self.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
61
|
+
|
59
62
|
if proxy
|
60
63
|
proxy = URI(proxy)
|
61
64
|
|
data/lib/ronin/web/root.rb
CHANGED
data/lib/ronin/web/version.rb
CHANGED
data/lib/ronin/web/xml.rb
CHANGED
data/lib/ronin/web.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
#
|
2
3
|
# ronin-web - A collection of useful web helper methods and commands.
|
3
4
|
#
|
@@ -34,6 +35,9 @@ require 'nokogiri/diff'
|
|
34
35
|
require 'open_namespace'
|
35
36
|
|
36
37
|
module Ronin
|
38
|
+
#
|
39
|
+
# Top-level web helper methods.
|
40
|
+
#
|
37
41
|
module Web
|
38
42
|
include OpenNamespace
|
39
43
|
|
@@ -200,6 +204,7 @@ module Ronin
|
|
200
204
|
referer: nil,
|
201
205
|
cookie: nil,
|
202
206
|
**kwargs)
|
207
|
+
uri = URI(url)
|
203
208
|
options = {proxy: proxy, **kwargs}
|
204
209
|
|
205
210
|
if user_agent
|
@@ -214,7 +219,7 @@ module Ronin
|
|
214
219
|
options['Referer'] = referer if referer
|
215
220
|
options['Cookie'] = cookie if cookie
|
216
221
|
|
217
|
-
return
|
222
|
+
return uri.open(options)
|
218
223
|
end
|
219
224
|
|
220
225
|
#
|
@@ -344,7 +349,7 @@ module Ronin
|
|
344
349
|
# @api public
|
345
350
|
#
|
346
351
|
def self.post(url,query={},headers={},&block)
|
347
|
-
agent.post(url,query,headers
|
352
|
+
agent.post(url,query,headers,&block)
|
348
353
|
end
|
349
354
|
|
350
355
|
#
|
data/ronin-web.gemspec
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'yaml'
|
4
4
|
|
@@ -21,10 +21,10 @@ Gem::Specification.new do |gem|
|
|
21
21
|
gem.email = gemspec['email']
|
22
22
|
gem.homepage = gemspec['homepage']
|
23
23
|
|
24
|
-
glob =
|
24
|
+
glob = ->(patterns) { gem.files & Dir[*patterns] }
|
25
25
|
|
26
|
-
gem.files
|
27
|
-
gem.files
|
26
|
+
gem.files = `git ls-files`.split($/)
|
27
|
+
gem.files = glob[gemspec['files']] if gemspec['files']
|
28
28
|
gem.files += Array(gemspec['generated_files'])
|
29
29
|
# exclude test files from the packages gem
|
30
30
|
gem.files -= glob[gemspec['test_files'] || 'spec/{**/}*']
|
@@ -32,6 +32,7 @@ Gem::Specification.new do |gem|
|
|
32
32
|
gem.executables = gemspec.fetch('executables') do
|
33
33
|
glob['bin/*'].map { |path| File.basename(path) }
|
34
34
|
end
|
35
|
+
|
35
36
|
gem.default_executable = gem.executables.first if Gem::VERSION < '1.7.'
|
36
37
|
|
37
38
|
gem.extensions = glob[gemspec['extensions'] || 'ext/**/extconf.rb']
|
@@ -46,7 +47,7 @@ Gem::Specification.new do |gem|
|
|
46
47
|
gem.required_rubygems_version = gemspec['required_rubygems_version']
|
47
48
|
gem.post_install_message = gemspec['post_install_message']
|
48
49
|
|
49
|
-
split =
|
50
|
+
split = ->(string) { string.split(/,\s*/) }
|
50
51
|
|
51
52
|
if gemspec['dependencies']
|
52
53
|
gemspec['dependencies'].each do |name,versions|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ronin-web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Postmodern
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-02
|
11
|
+
date: 2023-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -101,6 +101,9 @@ dependencies:
|
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0.1'
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: 0.1.1
|
104
107
|
type: :runtime
|
105
108
|
prerelease: false
|
106
109
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -108,6 +111,9 @@ dependencies:
|
|
108
111
|
- - "~>"
|
109
112
|
- !ruby/object:Gem::Version
|
110
113
|
version: '0.1'
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: 0.1.1
|
111
117
|
- !ruby/object:Gem::Dependency
|
112
118
|
name: ronin-web-spider
|
113
119
|
requirement: !ruby/object:Gem::Requirement
|
@@ -181,6 +187,7 @@ files:
|
|
181
187
|
- ".gitignore"
|
182
188
|
- ".mailmap"
|
183
189
|
- ".rspec"
|
190
|
+
- ".rubocop.yml"
|
184
191
|
- ".ruby-version"
|
185
192
|
- ".yardopts"
|
186
193
|
- COPYING.txt
|