elceef/dnstwist

Allow output file to exist

jullle3 opened this issue · 5 comments

When running dnstwist with

    permutations = dnstwist.run(
        domain=domain,
        registered=True,
        format='list',
        dictionary=f'{ROOT_DIR}/lib/dictionaries/english.dict',
        tld=f'{ROOT_DIR}/lib/dictionaries/abused_tlds.dict',
        output='/dev/null',
    )

it spams stdout with all permutations, and since its also returned as a list (which is all i need), i fix it by redirecting output to /dev/null, however this fails since dnstwist doesn't allow output files to exist before runs. This can be fixed by opening the file with mode w instead of x

In dnstwist.py
image

Just pass format='null' argument and skip output='/dev/null' to mute the output.

@elceef WIth format='null' it makes DNS requests. I want it to only perform permutations. Is there another solution?

I assumed you want to scan for registered domains since you're passing argument registered=True.
Pull the latest code. Writing to os.devnull should be now allowed.

Thanks. Will test later

@elceef Works like a charm. Looking forward to new pip release