Closed HullaBrian closed 4 years ago
Format idle
just prints domain permutations and does not run any active scans so it can't tell which are registered. I suggest to use CSV format and pipe it through cut
like this:
$ dnstwist --format csv --registered domain.com | cut -d, -f2
I will update the documentation and the argument parser to make sure chaining --format idle
with other options won't be possible.
Alright. I will see if that works.
It doesn’t seem to work in the way that I want to use it. It works in the command line, but doesn’t work with what I want to use it with which is the subprocess.run()
Command. When I run it, I get the following error:
Error: Unrecognized arguments: | cut\n
Can you paste full console output?
Sure...
CompletedProcess(args=['dnstwist', '--format', 'csv', '--registered', 'domain.name', '|', 'cut', '-d,', '-f2'], returncode=2, stdout='', stderr="usage: /home/#####/.local/bin/dnstwist [OPTION]... DOMAIN\ndnstwist: error: argument -f/--format: invalid choice: '2' (choose from 'cli', 'csv', 'json', 'idle')\n")
I am getting a different error now because i changed the command from "-f2" to "--format idle". But i changed it back because that didnt work
I think I have full picture now. Pipes do not work with subprocess
so you need to figure out some other way to parse the output. How about running it with --format json
and then use json.loads()
to convert it into a dictionary?
I managed to make it work. Thanks so much!
I am attempting to retrieve a list of registered results off of a scan. I want to put it in idle format as I am using that list in another tool. However, if I want to do something such as:
$dnstwist -r domain.com --format idle
This returns just idle format of a non registered scan or so it seems. I have run a registered scan using:$dnstwist -r domain.com
this returns some reachable websites.All I am saying is that chaining arguments together doesn't seem to work.