WIP: added tools command; closes #44 (#60)

* added tools command with placeholders for un/reinstall along with placeholder tests

* added missing docs build dependency

* updated documentation to reflect tools vs install

* refactored some code for DRY, fixed up prior merge with master

* fixed broken tests in test_recon_pipeline_shell

* existing tests all passing

* added tools list command

* added tools list command

* added tools reinstall

* removed lint

* fixed reinstall test

* fixed install go test

* fixed go install test again
This commit is contained in:
epi052
2020-06-27 21:23:16 -05:00
committed by GitHub
parent 1ad3adca82
commit 9d5cac6b34
12 changed files with 288 additions and 118 deletions

View File

@@ -6,16 +6,19 @@ from .masscan import MasscanScan, ParseMasscanOutput
from .nmap import ThreadedNmapScan, SearchsploitScan
from .config import top_udp_ports, top_tcp_ports, defaults, web_ports
from .parsers import (
install_parser,
uninstall_parser,
scan_parser,
view_parser,
tools_parser,
status_parser,
database_parser,
db_attach_parser,
db_delete_parser,
db_detach_parser,
db_list_parser,
view_parser,
tools_list_parser,
tools_install_parser,
tools_uninstall_parser,
tools_reinstall_parser,
target_results_parser,
endpoint_results_parser,
nmap_results_parser,

View File

@@ -6,14 +6,6 @@ from .config import defaults
from .helpers import get_scans
from ..tools import tools
# options for ReconShell's 'install' command
install_parser = cmd2.Cmd2ArgumentParser()
install_parser.add_argument("tool", help="which tool to install", choices=list(tools.keys()) + ["all"])
# options for ReconShell's 'uninstall' command
uninstall_parser = cmd2.Cmd2ArgumentParser()
uninstall_parser.add_argument("tool", help="which tool to uninstall", choices=list(tools.keys()) + ["all"])
# options for ReconShell's 'status' command
status_parser = cmd2.Cmd2ArgumentParser()
status_parser.add_argument(
@@ -110,6 +102,24 @@ db_delete_parser = database_subparsers.add_parser("delete", help="Delete the sel
db_attach_parser = database_subparsers.add_parser("attach", help="Attach to the selected database")
db_detach_parser = database_subparsers.add_parser("detach", help="Detach from the currently attached database")
# top level and subparsers for ReconShell's tools command
tools_parser = cmd2.Cmd2ArgumentParser()
tools_subparsers = tools_parser.add_subparsers(
title="subcommands", help="Manage tool actions (install/uninstall/reinstall)"
)
tools_install_parser = tools_subparsers.add_parser(
"install", help="Install any/all of the libraries/tools necessary to make the recon-pipeline function"
)
tools_install_parser.add_argument("tool", help="which tool to install", choices=list(tools.keys()) + ["all"])
tools_uninstall_parser = tools_subparsers.add_parser("uninstall", help="Remove the already installed tool")
tools_uninstall_parser.add_argument("tool", help="which tool to uninstall", choices=list(tools.keys()) + ["all"])
tools_reinstall_parser = tools_subparsers.add_parser("reinstall", help="Uninstall and then Install a given tool")
tools_reinstall_parser.add_argument("tool", help="which tool to reinstall", choices=list(tools.keys()) + ["all"])
tools_list_parser = tools_subparsers.add_parser("list", help="Show status of pipeline tools")
# ReconShell's view command
view_parser = cmd2.Cmd2ArgumentParser()