mirror of
https://github.com/aljazceru/recon-pipeline.git
synced 2026-01-06 16:14:28 +01:00
Add scan tests (#10)
* recon.targets tests added * restructured tests logically * fixed yaml error * fixed job names * recon.__init__ tests added * recon.config tests added * recon.amass.ParseAmassScan tests added * fixed test destined to fail on CI pipeline * testing amass partially complete this commit closes #6 and #8 updated existing tests to utilize new paths
This commit is contained in:
@@ -77,10 +77,14 @@ class WebanalyzeScan(luigi.Task):
|
||||
Returns:
|
||||
luigi.local_target.LocalTarget
|
||||
"""
|
||||
return luigi.LocalTarget(f"{self.results_dir}/webanalyze-{self.target_file}-results")
|
||||
results_subfolder = Path(self.results_dir) / "webanalyze-results"
|
||||
|
||||
return luigi.LocalTarget(results_subfolder.resolve())
|
||||
|
||||
def _wrapped_subprocess(self, cmd):
|
||||
with open(f"webanalyze.{cmd[2].replace('//', '_').replace(':', '')}.txt", "wb") as f:
|
||||
with open(
|
||||
f"webanalyze.{cmd[2].replace('//', '_').replace(':', '')}.txt", "wb"
|
||||
) as f:
|
||||
subprocess.run(cmd, stderr=f)
|
||||
|
||||
def run(self):
|
||||
@@ -92,7 +96,9 @@ class WebanalyzeScan(luigi.Task):
|
||||
try:
|
||||
self.threads = abs(int(self.threads))
|
||||
except TypeError:
|
||||
return logging.error("The value supplied to --threads must be a non-negative integer.")
|
||||
return logging.error(
|
||||
"The value supplied to --threads must be a non-negative integer."
|
||||
)
|
||||
|
||||
commands = list()
|
||||
|
||||
@@ -101,7 +107,9 @@ class WebanalyzeScan(luigi.Task):
|
||||
target = target.strip()
|
||||
|
||||
try:
|
||||
if isinstance(ipaddress.ip_address(target), ipaddress.IPv6Address): # ipv6
|
||||
if isinstance(
|
||||
ipaddress.ip_address(target), ipaddress.IPv6Address
|
||||
): # ipv6
|
||||
target = f"[{target}]"
|
||||
except ValueError:
|
||||
# domain names raise ValueErrors, just assume we have a domain and keep on keepin on
|
||||
|
||||
Reference in New Issue
Block a user