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": {
"installed": False,
"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": {
"installed": False,

View File

@@ -29,7 +29,8 @@ tool_paths = {
"webanalyze": f"{Path.home()}/go/bin/webanalyze",
"masscan": f"{defaults.get('tools-dir')}/masscan",
"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 = [

View File

@@ -7,8 +7,8 @@ from pathlib import Path
import luigi
from luigi.util import inherits
from recon.config import defaults
from recon.masscan import ParseMasscanOutput
from recon.config import defaults, tool_paths
@inherits(ParseMasscanOutput)
@@ -200,7 +200,7 @@ class SearchsploitScan(luigi.Task):
def run(self):
""" 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"):
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:
Path(self.output().path).mkdir(parents=True, exist_ok=True)