-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
33a5d69
commit 0e198d4
Showing
25 changed files
with
1,571 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# frozen_string_literal: true | ||
# | ||
# ronin-recon - A micro-framework and tool for performing reconnaissance. | ||
# | ||
# Copyright (c) 2023-2024 Hal Brodigan (postmodern.mod3@gmail.com) | ||
# | ||
# ronin-recon is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Lesser General Public License as published | ||
# by the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# ronin-recon is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public License | ||
# along with ronin-recon. If not, see <https://www.gnu.org/licenses/>. | ||
# | ||
|
||
require_relative '../command' | ||
|
||
require 'command_kit/commands/auto_load' | ||
|
||
module Ronin | ||
module Recon | ||
class CLI | ||
module Commands | ||
# | ||
# Get and set ronin-recon configuration. | ||
# | ||
# ## Usage | ||
# | ||
# ronin-recon config [options] [COMMAND [ARGS...]] | ||
# | ||
# ## Options | ||
# | ||
# -h, --help Print help information | ||
# | ||
# ## Arguments | ||
# | ||
# [COMMAND] The command name to run | ||
# [ARGS ...] Additional arguments for the command | ||
# | ||
# ## Commands | ||
# | ||
# disable | ||
# enable | ||
# get | ||
# help | ||
# list | ||
# set | ||
# unset | ||
# | ||
# ## Examples | ||
# | ||
# ronin-recon config list | ||
# ronin-recon config enable api/hunter_io | ||
# ronin-recon config disable api/hunter_io | ||
# ronin-recon config set --param api/hunter_io.api_key=... | ||
# ronin-recon config set --concurrency web/spider=10 | ||
# ronin-recon config unset --param web/spider.proxy | ||
# ronin-recon config unset --concurrency web/spider | ||
# | ||
# @since 0.2.0 | ||
# | ||
class Config < Command | ||
|
||
include CommandKit::Commands::AutoLoad.new( | ||
dir: "#{__dir__}/config", | ||
namespace: "#{self}" | ||
) | ||
|
||
examples [ | ||
'list', | ||
'enable api/hunter_io', | ||
'disable api/hunter_io', | ||
'set --param api/hunter_io.api_key=...', | ||
'set --concurrency web/spider=10', | ||
'unset --param web/spider.proxy', | ||
'unset --concurrency web/spider' | ||
] | ||
|
||
description 'Get and set ronin-recon configuration' | ||
|
||
man_page 'ronin-recon-config.1' | ||
|
||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# frozen_string_literal: true | ||
# | ||
# ronin-recon - A micro-framework and tool for performing reconnaissance. | ||
# | ||
# Copyright (c) 2023-2024 Hal Brodigan (postmodern.mod3@gmail.com) | ||
# | ||
# ronin-recon is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Lesser General Public License as published | ||
# by the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# ronin-recon is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public License | ||
# along with ronin-recon. If not, see <https://www.gnu.org/licenses/>. | ||
# | ||
|
||
require_relative '../../config_command' | ||
|
||
module Ronin | ||
module Recon | ||
class CLI | ||
module Commands | ||
class Config < Command | ||
# | ||
# Disables a worker in the configuration file. | ||
# | ||
# ## Usage | ||
# | ||
# ronin-recon config disable [options] WORKER | ||
# | ||
# ## Options | ||
# | ||
# -C, --config-file FILE Loads the configuration file | ||
# -h, --help Print help information | ||
# | ||
# ## Arguments | ||
# | ||
# WORKER The worker ID to disable | ||
# | ||
# @since 0.2.0 | ||
# | ||
class Disable < ConfigCommand | ||
|
||
argument :worker, required: true, | ||
desc: 'The worker ID to disable' | ||
|
||
description "Disables a worker in the configuration file" | ||
|
||
man_page 'ronin-recon-config-disable.1' | ||
|
||
# | ||
# Runs the `ronin-recon config disable` command. | ||
# | ||
# @param [String] worker | ||
# The worker ID to disable. | ||
# | ||
def run(worker) | ||
load_config | ||
|
||
@config.workers.delete(worker) | ||
|
||
save_config | ||
end | ||
|
||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# frozen_string_literal: true | ||
# | ||
# ronin-recon - A micro-framework and tool for performing reconnaissance. | ||
# | ||
# Copyright (c) 2023-2024 Hal Brodigan (postmodern.mod3@gmail.com) | ||
# | ||
# ronin-recon is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Lesser General Public License as published | ||
# by the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# ronin-recon is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public License | ||
# along with ronin-recon. If not, see <https://www.gnu.org/licenses/>. | ||
# | ||
|
||
require_relative '../../config_command' | ||
|
||
module Ronin | ||
module Recon | ||
class CLI | ||
module Commands | ||
class Config < Command | ||
# | ||
# Enables a worker in the configuration file. | ||
# | ||
# ## Usage | ||
# | ||
# ronin-recon config enable [options] WORKER | ||
# | ||
# ## Options | ||
# | ||
# -C, --config-file FILE Loads the configuration file | ||
# -h, --help Print help information | ||
# | ||
# ## Arguments | ||
# | ||
# WORKER The worker ID to enable | ||
# | ||
# @since 0.2.0 | ||
# | ||
class Enable < ConfigCommand | ||
|
||
argument :worker, required: true, | ||
desc: 'The worker ID to enable' | ||
|
||
description "Enables a worker in the configuration file" | ||
|
||
man_page 'ronin-recon-config-enable.1' | ||
|
||
# | ||
# Runs the `ronin-recon config enable` command. | ||
# | ||
# @param [String] worker | ||
# | ||
def run(worker) | ||
load_config | ||
|
||
@config.workers.add(worker) | ||
|
||
save_config | ||
end | ||
|
||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.