From 04ae261d9da6ffb22dc31c6c9720be5290b3eb02 Mon Sep 17 00:00:00 2001 From: epi052 Date: Thu, 23 Jan 2020 19:56:32 -0600 Subject: [PATCH] update README --- README.md | 8 +++++++- recon-pipeline.py | 20 ++++++++++++++++---- recon/__init__.py | 48 ++++++++++++++++++++++++++++++++++++----------- 3 files changed, 60 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 4a00f9f..a0391ce 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Automated Reconnaissance Pipeline -![version](https://img.shields.io/badge/version-0.7.0-informational?style=for-the-badge) +![version](https://img.shields.io/badge/version-0.7.2-informational?style=for-the-badge) ![python](https://img.shields.io/badge/python-3.7-informational?style=for-the-badge) ![luigi](https://img.shields.io/badge/luigi-2.8.11-yellowgreen?style=for-the-badge) ![cmd2](https://img.shields.io/badge/cmd2-0.9.23-yellowgreen?style=for-the-badge) @@ -72,5 +72,11 @@ and running easily. The other option is to add `--local-scheduler` to your `scan` command from within the `recon-pipeline` shell. +## Special Thanks + +- @aringo for his help on the precursor to this tool +- @kernelsndrs for identifying a few bugs after initial launch + + diff --git a/recon-pipeline.py b/recon-pipeline.py index fa6a523..4c68237 100755 --- a/recon-pipeline.py +++ b/recon-pipeline.py @@ -9,6 +9,8 @@ import threading import subprocess from pathlib import Path +__version__ = "0.7.2" + # fix up the PYTHONPATH so we can simply execute the shell from wherever in the filesystem os.environ["PYTHONPATH"] = f"{os.environ.get('PYTHONPATH')}:{str(Path(__file__).parent.resolve())}" @@ -207,7 +209,11 @@ class ReconShell(cmd2.Cmd): continue self.async_alert( - style(f"[!] {args.tool} has an unmet dependency; installing {dependency}", fg="yellow", bold=True,) + style( + f"[!] {args.tool} has an unmet dependency; installing {dependency}", + fg="yellow", + bold=True, + ) ) # install the dependency before continuing with installation @@ -232,11 +238,15 @@ class ReconShell(cmd2.Cmd): if tools.get(args.tool).get("shell"): # go tools use subshells (cmd1 && cmd2 && cmd3 ...) during install, so need shell=True - proc = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + proc = subprocess.Popen( + command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE + ) else: # "normal" command, split up the string as usual and run it - proc = subprocess.Popen(shlex.split(command), stdout=subprocess.PIPE, stderr=subprocess.PIPE) + proc = subprocess.Popen( + shlex.split(command), stdout=subprocess.PIPE, stderr=subprocess.PIPE + ) out, err = proc.communicate() @@ -269,5 +279,7 @@ class ReconShell(cmd2.Cmd): if __name__ == "__main__": - rs = ReconShell(persistent_history_file="~/.reconshell_history", persistent_history_length=10000) + rs = ReconShell( + persistent_history_file="~/.reconshell_history", persistent_history_length=10000 + ) sys.exit(rs.cmdloop()) diff --git a/recon/__init__.py b/recon/__init__.py index 7e66ef2..85528ea 100644 --- a/recon/__init__.py +++ b/recon/__init__.py @@ -27,7 +27,11 @@ tools = { "shell": True, }, "luigi": {"installed": False, "dependencies": ["pipenv"], "commands": ["pipenv install luigi"]}, - "pipenv": {"installed": False, "dependencies": None, "commands": ["apt-get install -y -q pipenv"],}, + "pipenv": { + "installed": False, + "dependencies": None, + "commands": ["apt-get install -y -q pipenv"], + }, "masscan": { "installed": False, "dependencies": None, @@ -38,7 +42,11 @@ tools = { "rm -rf /tmp/masscan", ], }, - "amass": {"installed": False, "dependencies": None, "commands": ["apt-get install -y -q amass"],}, + "amass": { + "installed": False, + "dependencies": None, + "commands": ["apt-get install -y -q amass"], + }, "aquatone": { "installed": False, "dependencies": None, @@ -82,7 +90,10 @@ tools = { "subjack": { "installed": False, "dependencies": ["go"], - "commands": ["go get github.com/haccer/subjack", "(cd ~/go/src/github.com/haccer/subjack && go install)",], + "commands": [ + "go get github.com/haccer/subjack", + "(cd ~/go/src/github.com/haccer/subjack && go install)", + ], "shell": True, }, "webanalyze": { @@ -140,7 +151,9 @@ def get_scans(): # 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"]) +install_parser.add_argument( + "tool", help="which tool to install", choices=list(tools.keys()) + ["all"] +) # options for ReconShell's 'scan' command @@ -155,7 +168,9 @@ scan_parser.add_argument( "--exempt-list", completer_method=cmd2.Cmd.path_complete, help="list of blacklisted ips/domains" ) scan_parser.add_argument( - "--results-dir", completer_method=cmd2.Cmd.path_complete, help="directory in which to save scan results", + "--results-dir", + completer_method=cmd2.Cmd.path_complete, + help="directory in which to save scan results", ) scan_parser.add_argument( "--wordlist", completer_method=cmd2.Cmd.path_complete, help="path to wordlist used by gobuster" @@ -165,19 +180,30 @@ scan_parser.add_argument( choices_function=lambda: [x[1] for x in socket.if_nameindex()], help="which interface masscan should use", ) -scan_parser.add_argument("--recursive", action="store_true", help="whether or not to recursively gobust") +scan_parser.add_argument( + "--recursive", action="store_true", help="whether or not to recursively gobust" +) scan_parser.add_argument("--rate", help="rate at which masscan should scan") scan_parser.add_argument( - "--top-ports", help="ports to scan as specified by nmap's list of top-ports (only meaningful to around 5000)", + "--top-ports", + help="ports to scan as specified by nmap's list of top-ports (only meaningful to around 5000)", +) +scan_parser.add_argument( + "--ports", help="port specification for masscan (all ports example: 1-65535,U:1-65535)" +) +scan_parser.add_argument( + "--threads", help="number of threads for all of the threaded applications to use" ) -scan_parser.add_argument("--ports", help="port specification for masscan (all ports example: 1-65535,U:1-65535)") -scan_parser.add_argument("--threads", help="number of threads for all of the threaded applications to use") 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( - "--local-scheduler", action="store_true", help="use the local scheduler instead of the central scheduler (luigid)", + "--local-scheduler", + action="store_true", + help="use the local scheduler instead of the central scheduler (luigid)", ) scan_parser.add_argument( - "--verbose", action="store_true", help="shows debug messages from luigi, useful for troubleshooting", + "--verbose", + action="store_true", + help="shows debug messages from luigi, useful for troubleshooting", )