Skip to content

Commit

Permalink
added status command; added --sausage to scan command
Browse files Browse the repository at this point in the history
  • Loading branch information
epi052 authored Feb 5, 2020
1 parent 7a24d85 commit 3ea2cc7
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
15 changes: 14 additions & 1 deletion recon-pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import selectors
import threading
import subprocess
import webbrowser
from pathlib import Path

# fix up the PYTHONPATH so we can simply execute the shell from wherever in the filesystem
Expand All @@ -20,7 +21,7 @@
from cmd2.ansi import style # noqa: E402

# project's module imports
from recon import get_scans, tools, scan_parser, install_parser # noqa: F401,E402
from recon import get_scans, tools, scan_parser, install_parser, status_parser # noqa: F401,E402

# select loop, handles async stdout/stderr processing of subprocesses
selector = selectors.DefaultSelector()
Expand Down Expand Up @@ -157,6 +158,13 @@ def do_scan(self, args):

command.extend(args.__statement__.arg_list)

if args.sausage:
# sausage is not a luigi option, need to remove it
# name for the option came from @AlphaRingo
command.pop(command.index("--sausage"))

webbrowser.open("localhost:8082") # hard-coded here, can specify different with the status command

if args.verbose:
# verbose is not a luigi option, need to remove it
command.pop(command.index("--verbose"))
Expand Down Expand Up @@ -267,6 +275,11 @@ def do_install(self, args):
# store any tool installs/failures (back) to disk
pickle.dump(tools, persistent_tool_dict.open("wb"))

@cmd2.with_argparser(status_parser)
def do_status(self, args):
""" Open a web browser to Luigi's central scheduler's visualization site """
webbrowser.open(f"{args.host}:{args.port}")


if __name__ == "__main__":
rs = ReconShell(persistent_history_file="~/.reconshell_history", persistent_history_length=10000)
Expand Down
19 changes: 19 additions & 0 deletions recon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,20 @@ def get_scans():
install_parser.add_argument("tool", help="which tool to install", choices=list(tools.keys()) + ["all"])


# options for ReconShell's 'status' command
status_parser = cmd2.Cmd2ArgumentParser()
status_parser.add_argument(
"--port",
help="port on which the luigi central scheduler's visualization site is running (default: 8082)",
default="8082",
)
status_parser.add_argument(
"--host",
help="host on which the luigi central scheduler's visualization site is running (default: localhost)",
default="localhost",
)


# options for ReconShell's 'scan' command
scan_parser = cmd2.Cmd2ArgumentParser()
scan_parser.add_argument("scantype", choices_function=get_scans)
Expand Down Expand Up @@ -178,6 +192,11 @@ def get_scans():
scan_parser.add_argument("--scan-timeout", help="scan timeout for aquatone")
scan_parser.add_argument("--proxy", help="proxy for gobuster if desired (ex. 127.0.0.1:8080)")
scan_parser.add_argument("--extensions", help="list of extensions for gobuster (ex. asp,html,aspx)")
scan_parser.add_argument(
"--sausage",
action="store_true",
help="ppen a web browser to Luigi's central scheduler's visualization site (see how the sausage is made!)",
)
scan_parser.add_argument(
"--local-scheduler", action="store_true", help="use the local scheduler instead of the central scheduler (luigid)",
)
Expand Down

0 comments on commit 3ea2cc7

Please sign in to comment.