From 032be9787e5e27436a42bea294e91e2d0a206acc Mon Sep 17 00:00:00 2001 From: Postmodern Date: Mon, 19 Aug 2024 15:34:27 -0700 Subject: [PATCH] Renamed `ronin-recon test` to `ronin-recon run-worker` (closes #165). * Left behind an alias for `ronin-recon test` to `ronin-recon run-worker`. --- README.md | 2 +- data/templates/worker.rb.erb | 2 +- gemspec.yml | 2 +- lib/ronin/recon/cli.rb | 2 ++ .../cli/commands/{test.rb => run_worker.rb} | 12 +++++------ man/ronin-recon-irb.1.md | 2 +- ...-test.1.md => ronin-recon-run-worker.1.md} | 10 +++++----- man/ronin-recon-run.1.md | 4 ++-- man/ronin-recon.1.md | 4 ++-- spec/cli/commands/new_spec.rb | 20 +++++++++---------- .../{test_spec.rb => run_worker_spec.rb} | 4 ++-- 11 files changed, 33 insertions(+), 31 deletions(-) rename lib/ronin/recon/cli/commands/{test.rb => run_worker.rb} (89%) rename man/{ronin-recon-test.1.md => ronin-recon-run-worker.1.md} (69%) rename spec/cli/commands/{test_spec.rb => run_worker_spec.rb} (96%) diff --git a/README.md b/README.md index 3d79441..7ca8d31 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ Commands: irb new run - test + run-worker, test worker workers ``` diff --git a/data/templates/worker.rb.erb b/data/templates/worker.rb.erb index 56220ea..9691cc0 100644 --- a/data/templates/worker.rb.erb +++ b/data/templates/worker.rb.erb @@ -1,4 +1,4 @@ -#!/usr/bin/env -S ronin-recon test -f +#!/usr/bin/env -S ronin-recon run-worker -f require 'ronin/recon/<%= @worker_type[:file] -%>' diff --git a/gemspec.yml b/gemspec.yml index 4cba862..9ad8aef 100644 --- a/gemspec.yml +++ b/gemspec.yml @@ -31,7 +31,7 @@ generated_files: - man/ronin-recon-new.1 - man/ronin-recon-workers.1 - man/ronin-recon-worker.1 - - man/ronin-recon-test.1 + - man/ronin-recon-run-worker.1 - man/ronin-recon-run.1 - data/wordlists/subdomains-1000.txt.gz - data/wordlists/raft-small-directories.txt.gz diff --git a/lib/ronin/recon/cli.rb b/lib/ronin/recon/cli.rb index 5196435..2e8815f 100644 --- a/lib/ronin/recon/cli.rb +++ b/lib/ronin/recon/cli.rb @@ -46,6 +46,8 @@ class CLI command_name 'ronin-recon' version Ronin::Recon::VERSION + command_aliases['test'] = 'run-worker' + end end end diff --git a/lib/ronin/recon/cli/commands/test.rb b/lib/ronin/recon/cli/commands/run_worker.rb similarity index 89% rename from lib/ronin/recon/cli/commands/test.rb rename to lib/ronin/recon/cli/commands/run_worker.rb index 26d0134..e91f066 100644 --- a/lib/ronin/recon/cli/commands/test.rb +++ b/lib/ronin/recon/cli/commands/run_worker.rb @@ -31,11 +31,11 @@ module Recon class CLI module Commands # - # Loads an individual worker and tests it. + # Loads an individual worker and runs it. # # ## Usage # - # ronin-recon test [options] {--file FILE | NAME} {IP | IP-range | DOMAIN | HOST | WILDCARD | WEBSITE} + # ronin-recon run-worker [options] {--file FILE | NAME} {IP | IP-range | DOMAIN | HOST | WILDCARD | WEBSITE} # # ## Options # @@ -47,7 +47,7 @@ module Commands # # IP|IP-range|DOMAIN|HOST|WILDCARD|WEBSITE An initial recon value. # - class Test < WorkerCommand + class RunWorker < WorkerCommand include DebugOption include Printing @@ -60,12 +60,12 @@ class Test < WorkerCommand usage: 'IP|IP-range|DOMAIN|HOST|WILDCARD|WEBSITE', desc: 'The initial recon value' - description 'Loads an individual worker and tests it' + description 'Loads an individual worker and runs it' - man_page 'ronin-recon-test.1' + man_page 'ronin-recon-run-worker.1' # - # Runs the `ronin-recon test` command. + # Runs the `ronin-recon run-worker` command. # # @param [String, nil] name # The optional worker name to load and print metadata for. diff --git a/man/ronin-recon-irb.1.md b/man/ronin-recon-irb.1.md index 7dd572c..2c704d1 100644 --- a/man/ronin-recon-irb.1.md +++ b/man/ronin-recon-irb.1.md @@ -23,4 +23,4 @@ Postmodern ## SEE ALSO -[ronin-recon-workers](ronin-recon-workers.1.md) [ronin-recon-worker](ronin-recon-worker.1.md) [ronin-recon-run](ronin-recon-run.1.md) [ronin-recon-test](ronin-recon-test.1.md) +[ronin-recon-workers](ronin-recon-workers.1.md) [ronin-recon-worker](ronin-recon-worker.1.md) [ronin-recon-run](ronin-recon-run.1.md) [ronin-recon-run-worker](ronin-recon-run-worker.1.md) diff --git a/man/ronin-recon-test.1.md b/man/ronin-recon-run-worker.1.md similarity index 69% rename from man/ronin-recon-test.1.md rename to man/ronin-recon-run-worker.1.md index 377a4d0..76ee04d 100644 --- a/man/ronin-recon-test.1.md +++ b/man/ronin-recon-run-worker.1.md @@ -1,16 +1,16 @@ -# ronin-recon-test 1 "2023-05-01" Ronin "User Manuals" +# ronin-recon-run-worker 1 "2023-05-01" Ronin "User Manuals" ## NAME -ronin-recon-test - Loads an individual worker and tests it +ronin-recon-run-worker - Loads an individual worker and runs it ## SYNOPSIS -`ronin-recon test` [*options*] {`--file` *FILE* \| *NAME*} {*IP* \| *IP-range* \| *DOMAIN* \| *HOST* \| *WILDCARD* \| *WEBSITE*} +`ronin-recon run-worker` [*options*] {`--file` *FILE* \| *NAME*} {*IP* \| *IP-range* \| *DOMAIN* \| *HOST* \| *WILDCARD* \| *WEBSITE*} ## DESCRIPTION -Loads an individual worker and tests it with an input value.. +Loads an individual worker and runs it with an input value.. ## ARGUMENTS @@ -52,4 +52,4 @@ Postmodern ## SEE ALSO -[ronin-recon-workers](ronin-recon-workers.1.md) [ronin-recon-run](ronin-recon-run.1.md) \ No newline at end of file +[ronin-recon-workers](ronin-recon-workers.1.md) [ronin-recon-run](ronin-recon-run.1.md) diff --git a/man/ronin-recon-run.1.md b/man/ronin-recon-run.1.md index e0dc595..91da395 100644 --- a/man/ronin-recon-run.1.md +++ b/man/ronin-recon-run.1.md @@ -1,4 +1,4 @@ -# ronin-recon-test 1 "2023-05-01" Ronin "User Manuals" +# ronin-recon-run-worker 1 "2023-05-01" Ronin "User Manuals" ## NAME @@ -112,4 +112,4 @@ Postmodern ## SEE ALSO -[ronin-recon-workers](ronin-recon-workers.1.md) [ronin-recon-worker](ronin-recon-worker.1.md) [ronin-recon-test](ronin-recon-test.1.md) +[ronin-recon-workers](ronin-recon-workers.1.md) [ronin-recon-worker](ronin-recon-worker.1.md) [ronin-recon-run-worker](ronin-recon-run-worker.1.md) diff --git a/man/ronin-recon.1.md b/man/ronin-recon.1.md index e7429cc..fa7410d 100644 --- a/man/ronin-recon.1.md +++ b/man/ronin-recon.1.md @@ -42,8 +42,8 @@ Runs a `ronin-recon` *COMMAND*. *run* : Runs the recon engine with one or more initial values. -*test* -: Loads an individual worker and tests it. +*run-worker*, *test* +: Loads an individual worker and runs it. *worker* : Prints information about a recon worker. diff --git a/spec/cli/commands/new_spec.rb b/spec/cli/commands/new_spec.rb index a95ee13..8f8fa5f 100644 --- a/spec/cli/commands/new_spec.rb +++ b/spec/cli/commands/new_spec.rb @@ -78,7 +78,7 @@ it "must generate a new file containing a new Ronin::Recon::Worker class" do expect(File.read(path)).to eq( <<~RUBY - #!/usr/bin/env -S ronin-recon test -f + #!/usr/bin/env -S ronin-recon run-worker -f require 'ronin/recon/worker' @@ -131,7 +131,7 @@ def process(value) it "must add a boilerplate `author` metadata attribute" do expect(File.read(path)).to eq( <<~RUBY - #!/usr/bin/env -S ronin-recon test -f + #!/usr/bin/env -S ronin-recon run-worker -f require 'ronin/recon/worker' @@ -173,7 +173,7 @@ def process(value) it "must override the author name in the `author ...` metadata attribute with the '--author' name" do expect(File.read(path)).to eq( <<~RUBY - #!/usr/bin/env -S ronin-recon test -f + #!/usr/bin/env -S ronin-recon run-worker -f require 'ronin/recon/worker' @@ -214,7 +214,7 @@ def process(value) it "must override the author email in the `author ...` metadata attribute with the '--author-email' email" do expect(File.read(path)).to eq( <<~RUBY - #!/usr/bin/env -S ronin-recon test -f + #!/usr/bin/env -S ronin-recon run-worker -f require 'ronin/recon/worker' @@ -257,7 +257,7 @@ def process(value) it "must fill in the `summary ...` metadata attribute with the '--summary' text" do expect(File.read(path)).to eq( <<~RUBY - #!/usr/bin/env -S ronin-recon test -f + #!/usr/bin/env -S ronin-recon run-worker -f require 'ronin/recon/worker' @@ -299,7 +299,7 @@ def process(value) it "must fill in the `description ...` metadata attribute with the '--description' text" do expect(File.read(path)).to eq( <<~RUBY - #!/usr/bin/env -S ronin-recon test -f + #!/usr/bin/env -S ronin-recon run-worker -f require 'ronin/recon/worker' @@ -344,7 +344,7 @@ def process(value) it "must fill in the `references [...]` metadata attribute containing the '--reference' URLs" do expect(File.read(path)).to eq( <<~RUBY - #!/usr/bin/env -S ronin-recon test -f + #!/usr/bin/env -S ronin-recon run-worker -f require 'ronin/recon/worker' @@ -391,7 +391,7 @@ def process(value) it "must set the `accepts ...` metadata attribute in the worker class with the '--accepts' value classes" do expect(File.read(path)).to eq( <<~RUBY - #!/usr/bin/env -S ronin-recon test -f + #!/usr/bin/env -S ronin-recon run-worker -f require 'ronin/recon/worker' @@ -438,7 +438,7 @@ def process(value) it "must set the `outputs ...` metadata attribute in the worker class with the '--outputs' value classes" do expect(File.read(path)).to eq( <<~RUBY - #!/usr/bin/env -S ronin-recon test -f + #!/usr/bin/env -S ronin-recon run-worker -f require 'ronin/recon/worker' @@ -480,7 +480,7 @@ def process(value) it "must add the `intensity :level` metadata attribute to the worker class using the '--intensity' level" do expect(File.read(path)).to eq( <<~RUBY - #!/usr/bin/env -S ronin-recon test -f + #!/usr/bin/env -S ronin-recon run-worker -f require 'ronin/recon/worker' diff --git a/spec/cli/commands/test_spec.rb b/spec/cli/commands/run_worker_spec.rb similarity index 96% rename from spec/cli/commands/test_spec.rb rename to spec/cli/commands/run_worker_spec.rb index fc69953..39a5d8c 100644 --- a/spec/cli/commands/test_spec.rb +++ b/spec/cli/commands/run_worker_spec.rb @@ -1,9 +1,9 @@ require 'spec_helper' -require 'ronin/recon/cli/commands/test' +require 'ronin/recon/cli/commands/run_worker' require 'fixtures/test_worker' -describe Ronin::Recon::CLI::Commands::Test do +describe Ronin::Recon::CLI::Commands::RunWorker do describe "#run" do let(:name) { 'test_worker' } let(:value) { 'example.com' }