DataSploit / datasploit

An #OSINT Framework to perform various recon techniques on Companies, People, Phone Number, Bitcoin Addresses, etc., aggregate all the raw data, and give data in multiple formats.
GNU General Public License v3.0
2.96k stars 426 forks source link

Problem with domain_emailhunter.py #266

Open DocKali opened 5 years ago

DocKali commented 5 years ago

Please provide the following details.

Host System

Error Description

Please provide the details of the error. Try to provide the output and also steps to reproduce (if possible). For some domain, I obtain the following Traceback :

Traceback (most recent call last):
  File "datasploit.py", line 112, in <module>
    main(sys.argv[1:])
  File "datasploit.py", line 68, in main
    auto_select_target(single_input, output)
  File "datasploit.py", line 104, in auto_select_target
    domainOsint.run(target, output)
  File "/usr/toolz/datasploit/domainOsint.py", line 9, in run
    osint_runner.run("domain", "domain", domain, output)
  File "/usr/toolz/datasploit/osint_runner.py", line 30, in run
    x.output(data, m_input)
  File "/usr/toolz/datasploit/domain/domain_emailhunter.py", line 51, in output
    if type(data) == list and data[1] == "INVALID_API":
IndexError: list index out of range

I don't understand why I have this error for some domains and not for others, how to solve this?

jx6f commented 5 years ago

I was in the same boat. Following patch works for me.

diff --git a/domain/domain_emailhunter.py b/domain/domain_emailhunter.py
index ab255fe..c209ea9 100755
--- a/domain/domain_emailhunter.py
+++ b/domain/domain_emailhunter.py
@@ -48,7 +48,7 @@ def main(domain):

 def output(data, domain=""):
-    if type(data) == list and data[1] == "INVALID_API":
+    if type(data) == list and len(data) >= 2 and data[1] == "INVALID_API":
             print colored(
                 style.BOLD + '\n[-] Emailhunter API key not configured, skipping Email Search.\nPlease refer to http://datasploit.readthedocs.io/en/latest/apiGeneration/.\n' + style.END, 'red')
     else:
DocKali commented 5 years ago

Thanks for your patch @jx6f it seems it works well in my case. Now I'm facing a new problem, same as #271 But it's another story!