I have a program that I wrote that uses this python code called dnstwist which can be found here: Dnstwist documentation
The python code for dnstwist itself can be found here: dnstwist.py
The way my code uses dnstwist is through the os.open()
function. It looks like this: s.popen(os.getcwd() + "/dnstwist.py --json --registered " + url).read()
While this does work, I'd prefer to be able to just import dnstwist and use it as a library.
I've looked up some questions here on StackOverflow on how to do such a thing. One in particular: How does Python importing exactly work?
The problem I'm having is that I'm not sure how to call the various functions within dnstwist.
I asked the person who made this how I would do such a thing. They said to do the following:
import dnstwist
fuzz = dnstwist.DomainFuzz("google.com")
fuzz.generate()
fuzz.domains
I tried out this exact code and I got the following error:
AttributeError: 'function' object has no attribute 'DomainFuzz'
I get similar errors any time I try to use one of the functions that dnstwist.py has. I'm really not sure how I should go about this.
Thanks for your time.