dnsReaper
dnsReaper copied to clipboard
Overwriting output file Path (--out)
I was trying to integrate dnsReaper with another security automation tool. I used python to run the dnsReaper and Read the output as a JSON later. something like this.
output_file = tempfile.NamedTemporaryFile(suffix='.json')
command = ['python3', '/dnsReaper/main.py','single', '--domain', domain, '--out-format', 'json', '--out', output_file.name]
subprocess.run(command, check=True)
however, the tool always writes the output in a different path than the one I provided with output_file.name
.
This is because the following line in 'output.py' always adds the extension (.josn | .csv) to the file path.
self.path = f"{path}.{format}"
A did a small change to the output,py file to make it work for me.
self.path = path if path.endswith(format) is True else f"{path}.{format}"
Should I create a PR?
That looks like a great contribution.
If you raise a PR I'll give it a quick test and approve it for merging :)
@SimonGurney I created a PR #126