From 8bf60a46d647f190297d7f55ceb50d7c60457104 Mon Sep 17 00:00:00 2001 From: Postmodern Date: Sun, 23 Jun 2024 00:47:00 -0700 Subject: [PATCH] Added `--print-js-relative-path-strings` option to `ronin-web spider` (closes #94). --- lib/ronin/web/cli/commands/spider.rb | 10 ++++++++++ man/ronin-web-spider.1.md | 3 +++ 2 files changed, 13 insertions(+) diff --git a/lib/ronin/web/cli/commands/spider.rb b/lib/ronin/web/cli/commands/spider.rb index 667566c..7f0afd8 100644 --- a/lib/ronin/web/cli/commands/spider.rb +++ b/lib/ronin/web/cli/commands/spider.rb @@ -100,6 +100,8 @@ module Commands # --print-js-strings Print all JavaScript strings # --print-js-url-strings Print URL strings found in JavaScript # --print-js-path-strings Print path strings found in JavaScript + # --print-js-relative-path-strings + # Only print relative path strings found in JavaScript # --print-html-comments Print HTML comments # --print-js-comments Print JavaScript comments # --print-comments Print all HTML and JavaScript comments @@ -174,6 +176,8 @@ class Spider < Command option :print_js_path_strings, desc: 'Print path strings found in JavaScript' + option :print_js_relative_path_strings, desc: 'Only print relative path strings found in JavaScript' + option :print_html_comments, desc: 'Print HTML comments' option :print_js_comments, desc: 'Print JavaScript comments' @@ -300,6 +304,12 @@ def define_printing_callbacks(agent) end end + if options[:print_js_relative_path_strings] + agent.every_js_relative_path_string do |path| + print_content path + end + end + if options[:print_html_comments] agent.every_html_comment do |comment| print_content comment diff --git a/man/ronin-web-spider.1.md b/man/ronin-web-spider.1.md index 741071d..949043e 100644 --- a/man/ronin-web-spider.1.md +++ b/man/ronin-web-spider.1.md @@ -182,6 +182,9 @@ Spiders a website. `--print-js-path-strings` : Print path strings found in JavaScript. +`--print-js-relative-path-strings` +: Only print relative path strings found in JavaScript. + `--print-html-comments` : Print HTML comments.