ronin-web 1.0.1 → 1.0.2

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: 6b06c9dc8b62562796e3075d979eb732e3de726942e3a33998e0c19a74cbe9d8
4
- data.tar.gz: e3cb8dc314f28ca3f93184136a1d978d4b21233c3756b5fa9043ed7179fe7b4f
3
+ metadata.gz: d74a1711d3d63c034cb9a4e37f765c27cc1dd4b7e5cbf21154fc936a1db02e02
4
+ data.tar.gz: 06b58a6806d23dd2a201942978349cedfd57341f9acd9c9c687dcf1c41ec95bc
5
5
  SHA512:
6
- metadata.gz: 2c993ca1329a69b7bff73b6f7b52f111d65362fc539205b236f62d1a9211d996c9564efaf6f86c2ae157e346c5c740249b70cc00ac1603e2389137204044f214
7
- data.tar.gz: 7fb586226ee4c84048a0ebae55097f86514a83bea52825a4f88237464bb56af31c56849a9bd72ec1ca2f0ea705b06e72b96443fb2666fa022bb3eebec31da170
6
+ metadata.gz: be61036695c8a3ec44f095008352ab9d7fbc741218ca202f3dfbea9fd235bbb7a38ddc3d79896d62d349512f17085473ac2ac73aff7ae2bad4e2d7fda013c49a
7
+ data.tar.gz: 2ea04d21c0cd5dbdee6ffe714ffd94f89a4b2c8f2dceefeafd9daba0908f890da0b78a78b9df302ae14b39b44ca51e674c262b5fd470671382d9786f3904b6af
data/README.md CHANGED
@@ -57,6 +57,247 @@ Commands:
57
57
  spider
58
58
  ```
59
59
 
60
+ Open the `ronin-web` Ruby REPL:
61
+
62
+ ```shell
63
+ $ ronin-web irb
64
+ ```
65
+
66
+ Diff two HTML files:
67
+
68
+ ```shell
69
+ $ ronin-web diff index1.html index2.html
70
+ +
71
+
72
+ + <div>hax</div>
73
+ ```
74
+
75
+ Diff two URLs:
76
+
77
+ ```shell
78
+ $ ronin-web diff http://example.com/index.html http://example.com/index2.html
79
+ ```
80
+
81
+ Perform an XPath query on an HTML file:
82
+
83
+ ```shell
84
+ $ ronin-web html --xpath //meta index.html
85
+ <meta charset="utf-8">
86
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
87
+ <meta name="viewport" content="width=device-width, initial-scale=1">
88
+ ```
89
+
90
+ Perform an XPath query on a URL:
91
+
92
+ ```shell
93
+ $ ronin-web html --xpath //meta https://example.com/
94
+ <meta charset="utf-8">
95
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
96
+ <meta name="viewport" content="width=device-width, initial-scale=1">
97
+ ```
98
+
99
+ Dump all links from a web page:
100
+
101
+ ```shell
102
+ $ ronin-web html --links https://www.google.com/
103
+ https://www.google.com/imghp?hl=en&tab=wi
104
+ https://maps.google.com/maps?hl=en&tab=wl
105
+ https://play.google.com/?hl=en&tab=w8
106
+ https://www.youtube.com/?tab=w1
107
+ https://news.google.com/?tab=wn
108
+ https://mail.google.com/mail/?tab=wm
109
+ https://drive.google.com/?tab=wo
110
+ https://www.google.com/intl/en/about/products?tab=wh
111
+ http://www.google.com/history/optout?hl=en
112
+ /preferences?hl=en
113
+ https://accounts.google.com/ServiceLogin?hl=en&passive=true&continue=https://www.google.com/&ec=GAZAAQ
114
+ /advanced_search?hl=en&authuser=0
115
+ https://www.google.com/url?q=https://blog.google/products/search/google-search-new-fact-checking-misinformation/&source=hpp&id=19034203&ct=3&usg=AOvVaw3UxG35a-5UX1Rl8M_VwPbd&sa=X&ved=0ahUKEwjM4Iq--JD-AhVtGTQIHXMBBaYQ8IcBCAU
116
+ /intl/en/ads/
117
+ /services/
118
+ /intl/en/about.html
119
+ /intl/en/policies/privacy/
120
+ /intl/en/policies/terms/
121
+ ```
122
+
123
+ Spiders a host and print all visited URLs:
124
+
125
+ ```shell
126
+ $ ronin-web spider --host www.ruby-lang.org
127
+ http://www.ruby-lang.org/
128
+ http://www.ruby-lang.org/en/
129
+ http://www.ruby-lang.org/en/downloads/
130
+ http://www.ruby-lang.org/en/documentation/
131
+ http://www.ruby-lang.org/en/libraries/
132
+ http://www.ruby-lang.org/en/community/
133
+ https://www.ruby-lang.org/en/news/
134
+ https://www.ruby-lang.org/en/security/
135
+ https://www.ruby-lang.org/en/about/
136
+ ...
137
+ ```
138
+
139
+ Spiders the domain and sub-domains and print every visited URL:
140
+
141
+ ```shell
142
+ $ ronin-web spider --domain ruby-lang.org
143
+ http://ruby-lang.org/
144
+ https://www.ruby-lang.org/
145
+ https://www.ruby-lang.org/en/
146
+ https://www.ruby-lang.org/en/downloads/
147
+ https://www.ruby-lang.org/en/documentation/
148
+ https://www.ruby-lang.org/en/libraries/
149
+ https://www.ruby-lang.org/en/community/
150
+ https://www.ruby-lang.org/en/news/
151
+ https://www.ruby-lang.org/en/security/
152
+ https://www.ruby-lang.org/en/about/
153
+ ...
154
+ ```
155
+
156
+ Spiders a specific web-site and print every visited URL:
157
+
158
+ ```shell
159
+ $ ronin-web spider --site https://www.ruby-lang.org/
160
+ https://www.ruby-lang.org/
161
+ https://www.ruby-lang.org/en/
162
+ https://www.ruby-lang.org/en/downloads/
163
+ https://www.ruby-lang.org/en/documentation/
164
+ https://www.ruby-lang.org/en/libraries/
165
+ https://www.ruby-lang.org/en/community/
166
+ https://www.ruby-lang.org/en/news/
167
+ https://www.ruby-lang.org/en/security/
168
+ https://www.ruby-lang.org/en/about/
169
+ ...
170
+ ```
171
+
172
+ Spider a host and print the response statuses:
173
+
174
+ ```shell
175
+ 200 http://www.ruby-lang.org/
176
+ 200 http://www.ruby-lang.org/en/
177
+ 200 http://www.ruby-lang.org/en/downloads/
178
+ 200 http://www.ruby-lang.org/en/documentation/
179
+ 200 http://www.ruby-lang.org/en/libraries/
180
+ 200 http://www.ruby-lang.org/en/community/
181
+ 200 http://www.ruby-lang.org/en/news/
182
+ 200 http://www.ruby-lang.org/en/security/
183
+ 200 http://www.ruby-lang.org/en/about/
184
+ ...
185
+ ```
186
+
187
+ Spider a host and print the response status and headers:
188
+
189
+ ```shell
190
+ ronin-web spider --print-headers --host www.ruby-lang.org
191
+ 200 http://www.ruby-lang.org/
192
+ Connection: close
193
+ Content-Length: 887
194
+ Server: Cowboy
195
+ Strict-Transport-Security: max-age=31536000
196
+ Content-Type: text/html
197
+ Etag: W/"496ac7fab29a6094e490da28025c5857"
198
+ X-Frame-Options: SAMEORIGIN
199
+ Via: 1.1 vegur, 1.1 varnish
200
+ Accept-Ranges: bytes
201
+ Date: Tue, 04 Apr 2023 19:42:51 GMT
202
+ Age: 155
203
+ X-Served-By: cache-pdx12330-PDX
204
+ X-Cache: HIT
205
+ X-Cache-Hits: 1
206
+ X-Timer: S1680637372.808609,VS0,VE1
207
+ Vary: Accept-Encoding
208
+ ...
209
+ ```
210
+
211
+ Start a debug web server on http://localhost:8000/:
212
+
213
+ ```shell
214
+ $ ronin-web server
215
+ [2023-04-04 12:26:59] INFO WEBrick 1.7.0
216
+ [2023-04-04 12:26:59] INFO ruby 3.1.3 (2022-11-24) [x86_64-linux]
217
+ == Sinatra (v3.0.4) has taken the stage on 8000 for development with backup from WEBrick
218
+ [2023-04-04 12:26:59] INFO WEBrick::HTTPServer#start: pid=8966 port=8000
219
+ ```
220
+
221
+ Start a debug web server on a different address and port:
222
+
223
+ ```shell
224
+ $ ronin-web server --host 0.0.0.0 --port 1337
225
+ ```
226
+
227
+ Host the files in a directory on http://localhost:8000/:
228
+
229
+ ```shell
230
+ $ ronin-web server --root .
231
+ ```
232
+
233
+ Mount a specific file at a specific HTTP path:
234
+
235
+ ```shell
236
+ $ ronin-web server --dir /dir/index.html:./index.html
237
+ ```
238
+
239
+ Mount a specific directory at a specific HTTP path:
240
+
241
+ ```shell
242
+ $ ronin-web server --dir /dir:.
243
+ ```
244
+
245
+ Add a redirect to the web server:
246
+
247
+ ```shell
248
+ $ ronin-web server --redirect /redirect:https://example.com/
249
+ ```
250
+
251
+ Start a HTTP reverse proxy that rewrites HTTP responses on http://localhost:8080:
252
+
253
+ ```shell
254
+ $ ronin-web reverse-proxy --rewrite-response Example:Hax
255
+ ```
256
+
257
+ Test the reverse proxy:
258
+
259
+ ```shell
260
+ $ curl -H "Host: example.com" http://localhost:8080/
261
+ ```
262
+
263
+ Generate a new Ruby script for parsing HTML/XML:
264
+
265
+ ```shell
266
+ $ ronin-web new nokogiri parse.rb
267
+ erb nokogiri.rb.erb parse.rb
268
+ chmod parse.rb
269
+ ```
270
+
271
+ Generate a new web spider script:
272
+
273
+ ```shell
274
+ $ ronin-web new spider --host=www.example.com spider.rb
275
+ erb spider.rb.erb spider.rb
276
+ chmod spider.rb
277
+ ```
278
+
279
+ Generate a new web server script:
280
+
281
+ ```shell
282
+ $ ronin-web new server server.rb
283
+ erb server.rb.erb server.rb
284
+ chmod server.rb
285
+ ```
286
+
287
+ Generate a new web app:
288
+
289
+ ```shell
290
+ $ ronin-web new webapp app
291
+ mkdir app
292
+ mkdir app/lib
293
+ mkdir app/views
294
+ mkdir app/public
295
+ erb .ruby-version.erb app/.ruby-version
296
+ cp Gemfile app
297
+ erb app.rb.erb app/app.rb
298
+ cp config.ru app
299
+ ```
300
+
60
301
  ## Examples
61
302
 
62
303
  Get a web-page:
@@ -58,7 +58,7 @@ module Ronin
58
58
  default: 'localhost'
59
59
  },
60
60
  desc: 'Host name or IP to bind to' do |host|
61
- App.host = host
61
+ App.bind = host
62
62
  end
63
63
 
64
64
  option :port, short: '-p',
@@ -144,7 +144,7 @@ module Ronin
144
144
  end
145
145
  end
146
146
 
147
- log_info "Starting web server listening on #{App.host}:#{App.port} ..."
147
+ log_info "Starting web server listening on #{App.bind}:#{App.port} ..."
148
148
  begin
149
149
  App.run!
150
150
  rescue Errno::EADDRINUSE => error
@@ -390,7 +390,7 @@ module Ronin
390
390
  },
391
391
  desc: 'Spiders the website, starting at the URL'
392
392
 
393
- option :print_stauts, desc: 'Print the status codes for each URL'
393
+ option :print_status, desc: 'Print the status codes for each URL'
394
394
 
395
395
  option :print_headers, desc: 'Print response headers for each URL'
396
396
 
@@ -32,7 +32,9 @@ module Ronin
32
32
  class Mechanize < ::Mechanize
33
33
 
34
34
  #
35
- # Creates a new [Mechanize](http://mechanize.rubyforge.org/) Agent.
35
+ # Creates a new [Mechanize] Agent.
36
+ #
37
+ # [Mechanize]: https://github.com/sparklemotion/mechanize#readme
36
38
  #
37
39
  # @param [Network::HTTP::Proxy, Hash, String] proxy
38
40
  # Proxy information.
@@ -21,6 +21,6 @@
21
21
  module Ronin
22
22
  module Web
23
23
  # ronin-web Version
24
- VERSION = '1.0.1'
24
+ VERSION = '1.0.2'
25
25
  end
26
26
  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.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Postmodern
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-02 00:00:00.000000000 Z
11
+ date: 2023-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri