Skip to content

Commit

Permalink
Added --print-js-relative-path-strings option to ronin-web spider (
Browse files Browse the repository at this point in the history
…closes #94).
  • Loading branch information
postmodern committed Jun 23, 2024
1 parent 64d5075 commit 8bf60a4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/ronin/web/cli/commands/spider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions man/ronin-web-spider.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 8bf60a4

Please sign in to comment.