-2

So I found this tool: https://github.com/elceef/dnstwist and I want to pass a list of domains into that tool then take the output and visualize it. It operates through the command line, but how do I automate entering each domain and process the output automatically as well? By the way I am using colab, so I would need a solution using jupyter notebooks!

Thanks!

  • Use the `subprocess` module to run a program from Python. – Barmar Feb 18 '21 at 09:02
  • Thanks for the answer! But how do I pass the output back into python, especially with that banner? – Monlist Feb 18 '21 at 09:06
  • The library is written in Python; probably simply `import` it and call its functions, instead of detouring via the shell. – tripleee Feb 18 '21 at 09:10
  • `subprocess.Popen()` allows you to read the output of the command. – Barmar Feb 18 '21 at 09:10
  • Though for simple things you should always prefer `subprocess.run()` or one of the legacy convenience functions like `subprocess.check_output()` – tripleee Feb 18 '21 at 09:10

1 Answers1

0

If you want to do this programmatically I would not use the provided cli – although this would also be possible.

Instead you can create a small python script to do this. Import dwintwist in your script and have a look at the main function in dwintwist.py to see how you call this.

Doesn't look to hard, but I don't know your programming skill level of course.

matthias
  • 109
  • 1
  • 6