ronin-web 1.0.0.beta3 → 1.0.0.beta4
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/.github/workflows/ruby.yml +1 -0
- data/README.md +1 -0
- data/lib/ronin/web/cli/commands/spider.rb +67 -35
- data/lib/ronin/web/version.rb +1 -1
- data/lib/ronin/web.rb +2 -2
- data/man/ronin-web-new-webapp.1 +1 -1
- data/man/ronin-web-new-webapp.1.md +1 -1
- data/man/ronin-web-spider.1 +4 -0
- data/man/ronin-web-spider.1.md +3 -0
- 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: 37043413378124ed9793dc5393fe121be29e770f55e0cf93db3bbf91b59927d0
|
4
|
+
data.tar.gz: 5a77f64778e370b2d8f8c0f2df6838aa62719551a2021c6a0bbd5a9a4ba15ef1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b03fec155874e2c399db5991d03089a15c1c2193c3af3ba7c501c1c26ccd48c8fc6baaa650cda1c53508e43c5bbaed757cc7223279d494e635553f369202777e
|
7
|
+
data.tar.gz: 1a163daa3263ef36c36baa1d867a7add8678742743fb5a830ba10cbfbfcb05bd9c18b97d186538220f599298bc81c3a0b7861dabb4f9a69c1813ca34b0701936
|
data/.github/workflows/ruby.yml
CHANGED
data/README.md
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
[](https://github.com/ronin-rb/ronin-web/actions/workflows/ruby.yml)
|
4
4
|
[](https://codeclimate.com/github/ronin-rb/ronin-web)
|
5
|
+
[](https://badge.fury.io/rb/ronin-web)
|
5
6
|
|
6
7
|
* [Source](https://github.com/ronin-rb/ronin-web)
|
7
8
|
* [Issues](https://github.com/ronin-rb/ronin-web/issues)
|
@@ -83,6 +83,7 @@ module Ronin
|
|
83
83
|
# --print-status Print the status codes for each URL
|
84
84
|
# --print-headers Print response headers for each URL
|
85
85
|
# --print-header NAME Prints a specific header
|
86
|
+
# --history FILE The history file
|
86
87
|
# --archive DIR Archive every visited page to the DIR
|
87
88
|
# --git-archive DIR Archive every visited page to the git repository
|
88
89
|
# -X, --xpath XPATH Evaluates the XPath on each HTML page
|
@@ -390,7 +391,7 @@ module Ronin
|
|
390
391
|
},
|
391
392
|
desc: 'Spiders the website, starting at the URL'
|
392
393
|
|
393
|
-
option :
|
394
|
+
option :print_stauts, desc: 'Print the status codes for each URL'
|
394
395
|
|
395
396
|
option :print_headers, desc: 'Print response headers for each URL'
|
396
397
|
|
@@ -400,6 +401,12 @@ module Ronin
|
|
400
401
|
},
|
401
402
|
desc: 'Prints a specific header'
|
402
403
|
|
404
|
+
option :history, value: {
|
405
|
+
type: String,
|
406
|
+
usage: 'FILE'
|
407
|
+
},
|
408
|
+
desc: 'The history file'
|
409
|
+
|
403
410
|
option :archive, value: {
|
404
411
|
type: String,
|
405
412
|
usage: 'DIR'
|
@@ -552,6 +559,10 @@ module Ronin
|
|
552
559
|
Web::Spider::GitArchive.open(options[:git_archive])
|
553
560
|
end
|
554
561
|
|
562
|
+
history_file = if options[:history]
|
563
|
+
File.open(options[:history],'w')
|
564
|
+
end
|
565
|
+
|
555
566
|
agent = new_agent do |agent|
|
556
567
|
agent.every_page do |page|
|
557
568
|
print_page(page)
|
@@ -561,39 +572,12 @@ module Ronin
|
|
561
572
|
print_verbose "failed to request #{url}"
|
562
573
|
end
|
563
574
|
|
564
|
-
|
565
|
-
agent.every_host do |host|
|
566
|
-
print_verbose "spidering new host #{host}"
|
567
|
-
end
|
568
|
-
end
|
569
|
-
|
570
|
-
if options[:print_certs]
|
571
|
-
agent.every_cert do |cert|
|
572
|
-
print_verbose "encountered new certificate for #{cert.subject.common_name}"
|
573
|
-
end
|
574
|
-
end
|
575
|
-
|
576
|
-
if options[:print_js_strings]
|
577
|
-
agent.every_js_string do |string|
|
578
|
-
print_content string
|
579
|
-
end
|
580
|
-
end
|
581
|
-
|
582
|
-
if options[:print_html_comments]
|
583
|
-
agent.every_html_comment do |comment|
|
584
|
-
print_content comment
|
585
|
-
end
|
586
|
-
end
|
575
|
+
define_printing_callbacks(agent)
|
587
576
|
|
588
|
-
if
|
589
|
-
agent.
|
590
|
-
|
591
|
-
|
592
|
-
end
|
593
|
-
|
594
|
-
if options[:print_comments]
|
595
|
-
agent.every_comment do |comment|
|
596
|
-
print_content comment
|
577
|
+
if history_file
|
578
|
+
agent.every_page do |page|
|
579
|
+
history_file.puts(page.url)
|
580
|
+
history_file.flush
|
597
581
|
end
|
598
582
|
end
|
599
583
|
|
@@ -630,6 +614,54 @@ module Ronin
|
|
630
614
|
puts
|
631
615
|
end
|
632
616
|
end
|
617
|
+
ensure
|
618
|
+
if options[:history]
|
619
|
+
history_file.close
|
620
|
+
end
|
621
|
+
end
|
622
|
+
|
623
|
+
#
|
624
|
+
# Defines callbacks that print information.
|
625
|
+
#
|
626
|
+
# @param [Ronin::Web::Spider::Agent] agent
|
627
|
+
# The newly created agent.
|
628
|
+
#
|
629
|
+
def define_printing_callbacks(agent)
|
630
|
+
if options[:print_hosts]
|
631
|
+
agent.every_host do |host|
|
632
|
+
print_verbose "spidering new host #{host}"
|
633
|
+
end
|
634
|
+
end
|
635
|
+
|
636
|
+
if options[:print_certs]
|
637
|
+
agent.every_cert do |cert|
|
638
|
+
print_verbose "encountered new certificate for #{cert.subject.common_name}"
|
639
|
+
end
|
640
|
+
end
|
641
|
+
|
642
|
+
if options[:print_js_strings]
|
643
|
+
agent.every_js_string do |string|
|
644
|
+
print_content string
|
645
|
+
end
|
646
|
+
end
|
647
|
+
|
648
|
+
if options[:print_html_comments]
|
649
|
+
agent.every_html_comment do |comment|
|
650
|
+
print_content comment
|
651
|
+
end
|
652
|
+
end
|
653
|
+
|
654
|
+
if options[:print_js_comments]
|
655
|
+
agent.every_js_comment do |comment|
|
656
|
+
print_content comment
|
657
|
+
end
|
658
|
+
end
|
659
|
+
|
660
|
+
if options[:print_comments]
|
661
|
+
agent.every_comment do |comment|
|
662
|
+
print_content comment
|
663
|
+
end
|
664
|
+
end
|
633
665
|
end
|
634
666
|
|
635
667
|
#
|
@@ -717,7 +749,7 @@ module Ronin
|
|
717
749
|
# @param [Spidr::Page] page
|
718
750
|
# A spidered page.
|
719
751
|
#
|
720
|
-
def
|
752
|
+
def print_status(page)
|
721
753
|
if page.code < 300
|
722
754
|
print "#{colors.bright_green(page.code)} "
|
723
755
|
elsif page.code < 400
|
@@ -754,7 +786,7 @@ module Ronin
|
|
754
786
|
# A spidered page.
|
755
787
|
#
|
756
788
|
def print_page(page)
|
757
|
-
|
789
|
+
print_status(page) if options[:print_status]
|
758
790
|
print_url(page)
|
759
791
|
|
760
792
|
if options[:print_headers]
|
data/lib/ronin/web/version.rb
CHANGED
data/lib/ronin/web.rb
CHANGED
@@ -240,7 +240,7 @@ module Ronin
|
|
240
240
|
# @param [Array, Hash] parameters
|
241
241
|
# Additional parameters for the GET request.
|
242
242
|
#
|
243
|
-
# param [Hash] headers
|
243
|
+
# @param [Hash] headers
|
244
244
|
# Additional headers for the GET request.
|
245
245
|
#
|
246
246
|
# @yield [page]
|
@@ -282,7 +282,7 @@ module Ronin
|
|
282
282
|
# @param [Array, Hash] parameters
|
283
283
|
# Additional parameters for the GET request.
|
284
284
|
#
|
285
|
-
# param [Hash] headers
|
285
|
+
# @param [Hash] headers
|
286
286
|
# Additional headers for the GET request.
|
287
287
|
#
|
288
288
|
# @yield [body]
|
data/man/ronin-web-new-webapp.1
CHANGED
@@ -22,7 +22,7 @@ The project directory to create\.
|
|
22
22
|
.LP
|
23
23
|
.TP
|
24
24
|
\fB--port\fR \fIPORT\fP
|
25
|
-
The port the
|
25
|
+
The port the webapp will listen on by default\. Defaults to \fB3000\fR\.
|
26
26
|
.LP
|
27
27
|
.TP
|
28
28
|
\fB--ruby-version\fR \fIVERSION\fP
|
@@ -16,7 +16,7 @@ Generates a new `ronin-web-server` based webapp.
|
|
16
16
|
## OPTIONS
|
17
17
|
|
18
18
|
`--port` *PORT*
|
19
|
-
The port the
|
19
|
+
The port the webapp will listen on by default. Defaults to `3000`.
|
20
20
|
|
21
21
|
`--ruby-version` *VERSION*
|
22
22
|
The desired ruby version for the project Defaults to the current ruby version.
|
data/man/ronin-web-spider.1
CHANGED
@@ -179,6 +179,10 @@ Print response headers for each URL\.
|
|
179
179
|
Prints a specific header\.
|
180
180
|
.LP
|
181
181
|
.TP
|
182
|
+
\fB--history\fR \fIFILE\fP
|
183
|
+
Sets the history file to write every visited URL to\.
|
184
|
+
.LP
|
185
|
+
.TP
|
182
186
|
\fB--archive\fR \fIDIR\fP
|
183
187
|
Archive every visited page to the \fIDIR\fP\.
|
184
188
|
.LP
|
data/man/ronin-web-spider.1.md
CHANGED
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.
|
4
|
+
version: 1.0.0.beta4
|
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-
|
11
|
+
date: 2023-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|