ronin-web 1.0.0.beta1 → 1.0.0.beta2

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: 2a91db6a2aad829cf40f611b9ab3991f94271787f547cdc67e4975a41df917cb
4
- data.tar.gz: 3dab913f02dd5c3e6770ef722acd43ab7dbf0ec3cd3df3587043effd9c815f33
3
+ metadata.gz: 67b858bfc218967ff56b0f90ccc1a3abc78c707cd160c3b2800731882df26066
4
+ data.tar.gz: 533b6cbdbd94ad449e404985b649f07903ae62f560d5887173dfafc8d9f6cad4
5
5
  SHA512:
6
- metadata.gz: b389c9fd229fc6433964e0cdb7f758e62290e8f9bcc8a56760cafa0875db56ec0c9d6561d6e3fc3283c869051fc80508df161bd060721bd5f5c928fd6c835931
7
- data.tar.gz: ca1f736604f356b96b3bda61db85e29656fd1fafd67741593f8c968771a85d0e617b564fa493eee7ec8a74ce2b43fe662bfd22647bfc162dcb18c0d304635179
6
+ metadata.gz: e276c68bc6f0b6d7c6e7f8c267d08c16d92eb7dfd386a52537d7da8c87c74ad0a7ca5586ba522adca971a8269c20adea43ee7ae962c1cd09b5f90883a8f67842
7
+ data.tar.gz: bb3b259a383a2ce62b91fef94bb70493a267ede5dd24c26970ffaf9bb3b303fdeaafd376e90fecbbe0dff721d12dba69afcb1f2b019cae2f483f177cd23d6e7d
data/README.md CHANGED
@@ -12,8 +12,8 @@
12
12
 
13
13
  ## Description
14
14
 
15
- ronin-web is a collection of useful Web-related libraries, classes, and
16
- CLI commands.
15
+ ronin-web is a Ruby library that provides common web security commands and
16
+ additional libraries.
17
17
 
18
18
  ronin-web is part of the [ronin-rb] project, a [Ruby] toolkit for security
19
19
  research and development.
@@ -26,7 +26,7 @@ research and development.
26
26
  * Supports diffing HTML/XML documents using [nokogiri-diff].
27
27
  * Automated Web Browsing using [Mechanize][mechanize].
28
28
  * Supports random `User-Agent` generation using [ronin-web-user_agents].
29
- * Provides an easy to use [Sinatra][sintra] based web server using
29
+ * Provides an easy to use [Sinatra][sinatra] based web server using
30
30
  [ronin-web-server].
31
31
  * Provides an easy to use web spider using [ronin-web-spider].
32
32
  * Provides a CLI for common web related tasks.
@@ -180,7 +180,7 @@ $ gem install ronin-web
180
180
 
181
181
  ronin-web - A collection of useful web helper methods and commands.
182
182
 
183
- Copyright (c) 2006-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
183
+ Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
184
184
 
185
185
  ronin-web is free software: you can redistribute it and/or modify
186
186
  it under the terms of the GNU General Public License as published by
@@ -211,3 +211,4 @@ along with ronin-web. If not, see <https://www.gnu.org/licenses/>.
211
211
  [ronin-web-spider]: https://github.com/ronin-rb/ronin-web-spider#readme
212
212
  [ronin-web-user_agents]: https://github.com/ronin-rb/ronin-web-user_agents#readme
213
213
  [ronin]: https://github.com/ronin-rb/ronin#readme
214
+ [sinatra]: https://sinatrarb.com/
@@ -4,7 +4,7 @@ require 'nokogiri'
4
4
  require 'open-uri'
5
5
 
6
6
  <%- if @url -%>
7
- doc = Nokogiri::HTML(URI.open(<%= @url -%>))
7
+ doc = Nokogiri::HTML(URI.open(<%= @url.inspect -%>))
8
8
  <%- else -%>
9
9
  doc = Nokogiri::HTML(URI.open(ARGV[0]))
10
10
  <%- end -%>
@@ -19,7 +19,7 @@ Ronin::Web::Spider.<%= entry_point_method -%>(<%= entry_point_argument -%>) do |
19
19
  <%- end -%>
20
20
  <%- end -%>
21
21
  <%- else -%>
22
- agent.ever_page do |page|
22
+ agent.every_page do |page|
23
23
  puts page.url
24
24
  end
25
25
  <%- end -%>
data/gemspec.yml CHANGED
@@ -1,11 +1,8 @@
1
1
  name: ronin-web
2
- summary:
3
- A Ruby library that provides support for web scraping and
4
- spidering functionality.
5
-
2
+ summary: A collection of common web security commands and libraries.
6
3
  description:
7
- ronin-web is a Ruby library that provides support for web scraping and
8
- spidering functionality.
4
+ ronin-web is a Ruby library that provides common web security commands and
5
+ additional libraries.
9
6
 
10
7
  license: GPL-3.0
11
8
  authors: Postmodern
@@ -15,6 +12,13 @@ has_yard: true
15
12
 
16
13
  required_ruby_version: ">= 3.0.0"
17
14
 
15
+ metadata:
16
+ documentation_uri: https://ronin-rb.dev/docs/ronin-web
17
+ source_code_uri: https://github.com/ronin-rb/ronin-web
18
+ bug_tracker_uri: https://github.com/ronin-rb/ronin-web/issues
19
+ changelog_uri: https://github.com/ronin-rb/ronin-web/blob/main/ChangeLog.md
20
+ rubygems_mfa_required: 'true'
21
+
18
22
  generated_files:
19
23
  - man/ronin-web.1
20
24
  - man/ronin-web-diff.1
@@ -36,7 +40,7 @@ dependencies:
36
40
  mechanize: ~> 2.0
37
41
  open_namespace: ~> 0.4
38
42
  # Ronin dependencies:
39
- ronin-support: ~> 1.0.0.beta1
43
+ ronin-support: ~> 1.0.0.beta2
40
44
  ronin-web-server: ~> 0.1.0.beta1
41
45
  ronin-web-spider: ~> 0.1.0.beta2
42
46
  ronin-web-user_agents: ~> 0.1.0.beta1
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-web - A collection of useful web helper methods and commands.
3
3
  #
4
- # Copyright (c) 2006-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # ronin-web is free software: you can redistribute it and/or modify
7
7
  # it under the terms of the GNU General Public License as published by
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-web - A collection of useful web helper methods and commands.
3
3
  #
4
- # Copyright (c) 2006-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # ronin-web is free software: you can redistribute it and/or modify
7
7
  # it under the terms of the GNU General Public License as published by
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-web - A collection of useful web helper methods and commands.
3
3
  #
4
- # Copyright (c) 2006-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # ronin-web is free software: you can redistribute it and/or modify
7
7
  # it under the terms of the GNU General Public License as published by
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-web - A collection of useful web helper methods and commands.
3
3
  #
4
- # Copyright (c) 2006-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # ronin-web is free software: you can redistribute it and/or modify
7
7
  # it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2006-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-web is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2006-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-web is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2006-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-web is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2006-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-web is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2006-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-web is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU General Public License as published by
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-web - A collection of useful web helper methods and commands.
3
3
  #
4
- # Copyright (c) 2006-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # ronin-web is free software: you can redistribute it and/or modify
7
7
  # it under the terms of the GNU General Public License as published by
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-web - A collection of useful web helper methods and commands.
3
3
  #
4
- # Copyright (c) 2006-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # ronin-web is free software: you can redistribute it and/or modify
7
7
  # it under the terms of the GNU General Public License as published by
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-web - A collection of useful web helper methods and commands.
3
3
  #
4
- # Copyright (c) 2006-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # ronin-web is free software: you can redistribute it and/or modify
7
7
  # it under the terms of the GNU General Public License as published by
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-web - A collection of useful web helper methods and commands.
3
3
  #
4
- # Copyright (c) 2006-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # ronin-web is free software: you can redistribute it and/or modify
7
7
  # it under the terms of the GNU General Public License as published by
data/lib/ronin/web/cli.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-web - A collection of useful web helper methods and commands.
3
3
  #
4
- # Copyright (c) 2006-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # ronin-web is free software: you can redistribute it and/or modify
7
7
  # it under the terms of the GNU General Public License as published by
@@ -17,8 +17,11 @@
17
17
  # along with ronin-web. If not, see <https://www.gnu.org/licenses/>.
18
18
  #
19
19
 
20
+ require 'ronin/web/version'
21
+
20
22
  require 'command_kit/commands'
21
23
  require 'command_kit/commands/auto_load'
24
+ require 'command_kit/options/version'
22
25
 
23
26
  module Ronin
24
27
  module Web
@@ -36,8 +39,10 @@ module Ronin
36
39
  dir: "#{__dir__}/cli/commands",
37
40
  namespace: "#{self}::Commands"
38
41
  )
42
+ include CommandKit::Options::Version
39
43
 
40
44
  command_name 'ronin-web'
45
+ version Ronin::Web::VERSION
41
46
 
42
47
  end
43
48
  end
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-web - A collection of useful web helper methods and commands.
3
3
  #
4
- # Copyright (c) 2006-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # ronin-web is free software: you can redistribute it and/or modify
7
7
  # it under the terms of the GNU General Public License as published by
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-web - A collection of useful web helper methods and commands.
3
3
  #
4
- # Copyright (c) 2006-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # ronin-web is free software: you can redistribute it and/or modify
7
7
  # it under the terms of the GNU General Public License as published by
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-web - A collection of useful web helper methods and commands.
3
3
  #
4
- # Copyright (c) 2006-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # ronin-web is free software: you can redistribute it and/or modify
7
7
  # it under the terms of the GNU General Public License as published by
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-web - A collection of useful web helper methods and commands.
3
3
  #
4
- # Copyright (c) 2006-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # ronin-web is free software: you can redistribute it and/or modify
7
7
  # it under the terms of the GNU General Public License as published by
@@ -20,6 +20,6 @@
20
20
  module Ronin
21
21
  module Web
22
22
  # ronin-web Version
23
- VERSION = '1.0.0.beta1'
23
+ VERSION = '1.0.0.beta2'
24
24
  end
25
25
  end
data/lib/ronin/web/xml.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-web - A collection of useful web helper methods and commands.
3
3
  #
4
- # Copyright (c) 2006-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # ronin-web is free software: you can redistribute it and/or modify
7
7
  # it under the terms of the GNU General Public License as published by
data/lib/ronin/web.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-web - A collection of useful web helper methods and commands.
3
3
  #
4
- # Copyright (c) 2006-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # ronin-web is free software: you can redistribute it and/or modify
7
7
  # it under the terms of the GNU General Public License as published by
@@ -195,15 +195,15 @@ module Ronin
195
195
  #
196
196
  # @api public
197
197
  #
198
- def self.open(url, proxy: Web.proxy,
199
- user_agent: Web.user_agent,
198
+ def self.open(url, proxy: Support::Network::HTTP.proxy,
199
+ user_agent: Support::Network::HTTP.user_agent,
200
200
  referer: nil,
201
201
  cookie: nil,
202
202
  **kwargs)
203
- headers = {}
203
+ options = {proxy: proxy, **kwargs}
204
204
 
205
205
  if user_agent
206
- headers['User-Agent'] = case user_agent
206
+ options['User-Agent'] = case user_agent
207
207
  when Symbol
208
208
  Support::Network::HTTP::UserAgents[user_agent]
209
209
  else
@@ -211,10 +211,10 @@ module Ronin
211
211
  end
212
212
  end
213
213
 
214
- headers['Referer'] = referer if referer
215
- headers['Cookie'] = cookie if cookie
214
+ options['Referer'] = referer if referer
215
+ options['Cookie'] = cookie if cookie
216
216
 
217
- return URI.open(url, headers, proxy: proxy, **kwargs)
217
+ return URI.open(url,options)
218
218
  end
219
219
 
220
220
  #
data/spec/web_spec.rb CHANGED
@@ -2,8 +2,7 @@ require 'spec_helper'
2
2
  require 'ronin/web'
3
3
 
4
4
  describe Ronin::Web do
5
- let(:url) { 'https://ronin-rb.dev/' }
6
- let(:title) { 'Ronin' }
5
+ let(:url) { 'https://example.com/' }
7
6
 
8
7
  it "should have a VERSION constant" do
9
8
  expect(subject.const_defined?('VERSION')).to eq(true)
@@ -61,10 +60,11 @@ describe Ronin::Web do
61
60
  end
62
61
 
63
62
  describe ".open", :network do
64
- it "should open URLs as temporary files" do
63
+ it "must open URLs as temporary files" do
65
64
  file = subject.open(url)
66
65
 
67
- expect(file.read).to include(title)
66
+ expect(file).to be_kind_of(StringIO)
67
+ expect(file.read).to include("Example Domain")
68
68
  end
69
69
  end
70
70
 
@@ -83,7 +83,7 @@ describe Ronin::Web do
83
83
  page = subject.get(url)
84
84
 
85
85
  expect(page.class).to eq(Mechanize::Page)
86
- expect(page.at('title').inner_text).to include(title)
86
+ expect(page.uri).to eq(URI(url))
87
87
  end
88
88
  end
89
89
 
@@ -91,7 +91,7 @@ describe Ronin::Web do
91
91
  it "should be able to get the bodies of Mechanize pages" do
92
92
  body = subject.get_body(url)
93
93
 
94
- expect(body).to include(title)
94
+ expect(body).to include("Example Domain")
95
95
  end
96
96
  end
97
97
  end
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.0.beta1
4
+ version: 1.0.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Postmodern
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-01 00:00:00.000000000 Z
11
+ date: 2023-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 1.0.0.beta1
89
+ version: 1.0.0.beta2
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 1.0.0.beta1
96
+ version: 1.0.0.beta2
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: ronin-web-server
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -164,8 +164,8 @@ dependencies:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
166
  version: '2.0'
167
- description: ronin-web is a Ruby library that provides support for web scraping and
168
- spidering functionality.
167
+ description: ronin-web is a Ruby library that provides common web security commands
168
+ and additional libraries.
169
169
  email: postmodern.mod3@gmail.com
170
170
  executables:
171
171
  - ronin-web
@@ -273,7 +273,7 @@ requirements: []
273
273
  rubygems_version: 3.3.26
274
274
  signing_key:
275
275
  specification_version: 4
276
- summary: A Ruby library that provides support for web scraping and spidering functionality.
276
+ summary: A collection of common web security commands and libraries.
277
277
  test_files:
278
278
  - spec/cli/ruby_shell_spec.rb
279
279
  - spec/html_spec.rb