added searchsploit to installable tools (#25)

* added searchsploit to installable tools

* formatted with black
This commit is contained in:
epi052
2020-02-22 12:20:13 -06:00
committed by GitHub
parent 6613ab69a9
commit ff801dfc6b
3 changed files with 18 additions and 4 deletions

View File

@@ -30,7 +30,20 @@ tools = {
"seclists": { "seclists": {
"installed": False, "installed": False,
"dependencies": None, "dependencies": None,
"commands": [f"git clone https://github.com/danielmiessler/SecLists.git {defaults.get('tools-dir')}/seclists"], "shell": True,
"commands": [
f"bash -c 'if [[ -d {defaults.get('tools-dir')}/seclists ]] ; then cd {defaults.get('tools-dir')}/seclists && git fetch --all && git pull; else git clone https://github.com/danielmiessler/SecLists.git {defaults.get('tools-dir')}/seclists; fi'"
],
},
"searchsploit": {
"installed": False,
"dependencies": None,
"shell": True,
"commands": [
f"bash -c 'if [[ -d {Path(tool_paths.get('searchsploit')).parent} ]] ; then cd {Path(tool_paths.get('searchsploit')).parent} && git fetch --all && git pull; else git clone https://github.com/offensive-security/exploitdb.git {defaults.get('tools-dir')}/exploitdb; fi'",
f"cp -n {Path(tool_paths.get('searchsploit')).parent}/.searchsploit_rc {Path.home().resolve()}",
f"sed -i 's#/opt#{defaults.get('tools-dir')}#g' {Path.home().resolve()}/.searchsploit_rc",
],
}, },
"masscan": { "masscan": {
"installed": False, "installed": False,

View File

@@ -29,7 +29,8 @@ tool_paths = {
"webanalyze": f"{Path.home()}/go/bin/webanalyze", "webanalyze": f"{Path.home()}/go/bin/webanalyze",
"masscan": f"{defaults.get('tools-dir')}/masscan", "masscan": f"{defaults.get('tools-dir')}/masscan",
"amass": f"{defaults.get('tools-dir')}/amass", "amass": f"{defaults.get('tools-dir')}/amass",
"go": "/usr/local/go/bin/go" "go": "/usr/local/go/bin/go",
"searchsploit": f"{defaults.get('tools-dir')}/exploitdb/searchsploit"
} }
top_tcp_ports = [ top_tcp_ports = [

View File

@@ -7,8 +7,8 @@ from pathlib import Path
import luigi import luigi
from luigi.util import inherits from luigi.util import inherits
from recon.config import defaults
from recon.masscan import ParseMasscanOutput from recon.masscan import ParseMasscanOutput
from recon.config import defaults, tool_paths
@inherits(ParseMasscanOutput) @inherits(ParseMasscanOutput)
@@ -200,7 +200,7 @@ class SearchsploitScan(luigi.Task):
def run(self): def run(self):
""" Grabs the xml files created by ThreadedNmap and runs searchsploit --nmap on each one, saving the output. """ """ Grabs the xml files created by ThreadedNmap and runs searchsploit --nmap on each one, saving the output. """
for entry in Path(self.input().path).glob("nmap*.xml"): for entry in Path(self.input().path).glob("nmap*.xml"):
proc = subprocess.run(["searchsploit", "--nmap", str(entry)], stderr=subprocess.PIPE) proc = subprocess.run([tool_paths.get("searchsploit"), "--nmap", str(entry)], stderr=subprocess.PIPE)
if proc.stderr: if proc.stderr:
Path(self.output().path).mkdir(parents=True, exist_ok=True) Path(self.output().path).mkdir(parents=True, exist_ok=True)