i3visio / osrframework

OSRFramework, the Open Sources Research Framework is a AGPLv3+ project by i3visio focused on providing API and tools to perform more accurate online researches.
GNU Affero General Public License v3.0
918 stars 244 forks source link

mailfy throwing IndexError when email does not exist #366

Open milliemince opened 3 years ago

milliemince commented 3 years ago

After running command mailfy -n i3visio I get this error in step 2

Step 2/5. Checking if the emails have been used to register accounts in 5 platforms...
[
  "Infojobs",
  "Instagram",
  "KeyServerIO",
  "Twitter",
  "Youtube"
]

        Press <Ctrl + C> to skip this step...

        [*] Starting the research of 39 email(s) in 5 platform(s)... This may take a while.

        [*] 1/39 Checking 'i3visio@tutamail.com'...

Traceback (most recent call last):
  File "/usr/bin/mailfy", line 11, in <module>
    load_entry_point('osrframework==0.20.1', 'console_scripts', 'mailfy')()

  File "/usr/lib/python3/dist-packages/osrframework/mailfy.py", line 502, in main
    registered = process_mail_list_step_2(platforms=platforms, emails=emails)

  File "/usr/lib/python3/dist-packages/osrframework/mailfy.py", line 349, in process_mail_list_step_2
    entities = pla.get_info(query=e, mode="mailfy")

  File "/usr/lib/python3/dist-packages/osrframework/utils/platforms.py", line 152, in get_info
    results = getattr(self, "do_{}".format(mode))(query)

  File "/usr/lib/python3/dist-packages/osrframework/utils/platforms.py", line 352, in do_mailfy
    if self.check_mailfy(query, **kwargs):

  File "/usr/lib/python3/dist-packages/osrframework/wrappers/instagram.py", line 128, in check_mailfy
    csrf_token = re.findall("csrf_token", r1.text)[0]

IndexError: list index out of range
Epoch1331 commented 3 years ago

For me it's throwing the issue for all mailfy queries, not just when email doesn't exist

jjr207 commented 3 years ago

I got the same. Following.

ittisafur commented 3 years ago

Following. Got the same issue here even with existing mails.

jaykali commented 3 years ago

Same issue. This might comes for python listing code errors. @i3visio can you please check and solve it.

jaykali commented 3 years ago

Or might be problem of "EmailAhoy"

itsMattShull commented 3 years ago

Same, happening on all queries. Following.

jaykali commented 3 years ago

Everyone follow this updated fork https://github.com/jaykali/osrframework/

rapbando commented 2 years ago

Everyone follow this updated fork https://github.com/jaykali/osrframework/

Your fork throws an even bigger error:

`user@destination:~/osrframework$ osrf mailfy -m email@example.com [] 0 credentials have been loaded. [] 0 credentials have been loaded. [] 0 credentials have been loaded. [] 0 credentials have been loaded.

    .===========================================================.                                                                                                                                                                      
    |...........................................................|                                                                                                                                                                      
    |...........................................................|                                                                                                                                                                      
    |...........................................................|                                                                                                                                                                      
    |.......................              ......................|                                                                                                                                                                      
    |...................                    ....................|                                                                                                                                                                      
    |...................                      ..................|                                                                                                                                                                      
    |..................                       ..................|                                                                                                                                                                      
    |..................                        .................|                                                                                                                                                                      
    |..................                       ..................|                                                                                                                                                                      
    |..................                      ...................|                                                                                                                                                                      
    |..................                      ...................|                                                                                                                                                                      
    |..................                      ...................|                                                                                                                                                                      
    |.................                         .................|                                                                                                                                                                      
    |.................                        ..................|                                                                                                                                                                      
    |..................                       ..................|                                                                                                                                                                      
    |...................                    ....................|                                                                                                                                                                      
    |....................                   ....................|                                                                                                                                                                      
    |....................                  .....................|                                                                                                                                                                      
    |......................               ......................|                                                                                                                                                                      
    |......................               ......................|                                                                                                                                                                      
    |.....................                 .....................|                                                                                                                                                                      
    |.....................                 .....................|                                                                                                                                                                      
    |....................                   ....................|                                                                                                                                                                      
    |..................                       ..................|                                                                                                                                                                      
    |..............                               ..............|                                                                                                                                                                      
    |..........                                       ..........|                                                                                                                                                                      
    |......                                               ......|                                                                                                                                                                      
    |....                OSRFramework 0.20.4                ....|                                                                                                                                                                      
    |..                                                       ..|                                                                                                                                                                      
    '==========================================================='                                                                                                                                                                      

 ___  ____  ____  _____                                            _
/ _ \/ ___||  _ \|  ___| __ __ _ _ __ ___   _____      _____  _ __| | __

| | | _ | |) | | | '/ ` | ' ` \ / \ \ /\ / / _ | '| |/ / | || |) | <| || | | (_| | | | | | | /\ V V / () | | | < \/|/|| __| || \,|| || ||_| _/_/ __/|| ||\\

               Coded with ♥ by Yaiza Rubio & Félix Brezo

     -- The 'osrf' tool will list all the tools as subcommands. --          

      Mailfy | Copyright (C) Yaiza Rubio & Félix Brezo (i3visio) 2014-2020                                                                                                                                                             

This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you                                                                                                                                                         
are welcome to redistribute it under certain conditions. For additional info,                                                                                                                                                          
visit <https://www.gnu.org/licenses/agpl-3.0.txt>.                                                                                                                                                                                     

2021-09-21 23:29:22.877978 Step 1/5. Trying to determine if any of the following 1 emails exist using emailahoy3... [ "email@example.com" ]

    Press <Ctrl + C> to skip this step...

    [*] Verification of 'email@example.com' aborted. Details:
            This domain CANNOT be verified using EmailAhoy.
    [*] 0 credentials have been loaded.

2021-09-21 23:29:22.885423 Step 2/5. Checking if the emails have been used to register accounts in 7 platforms... [ "Facebook", "GnuPGKeys", "Infojobs", "Instagram", "OkCupid", "Twitter", "Youtube" ]

    Press <Ctrl + C> to skip this step...

    [*] Starting the research of 1 email(s) in 7 platform(s)... This may take a while.

    [*] 1/1 Checking 'email@example.com'...
    [*] 'mailfy' is not a valid mode for this wrapper (Facebook).

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 159, in _new_conn conn = connection.create_connection( File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 61, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "/usr/lib/python3.9/socket.py", line 954, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -5] No address associated with hostname

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 670, in urlopen httplib_response = self._make_request( File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 392, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/lib/python3.9/http/client.py", line 1279, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/lib/python3.9/http/client.py", line 1325, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/lib/python3.9/http/client.py", line 1274, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/lib/python3.9/http/client.py", line 1034, in _send_output self.send(msg) File "/usr/lib/python3.9/http/client.py", line 974, in send self.connect() File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 187, in connect conn = self._new_conn() File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 171, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fa2b4c38a90>: Failed to establish a new connection: [Errno -5] No address associated with hostname

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/requests/adapters.py", line 439, in send resp = conn.urlopen( File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 724, in urlopen retries = retries.increment( File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 439, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='keys.gnupg.net', port=80): Max retries exceeded with url: /pks/lookup?search=email@example.com (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fa2b4c38a90>: Failed to establish a new connection: [Errno -5] No address associated with hostname'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/bin/osrf", line 33, in sys.exit(load_entry_point('osrframework==0.20.4', 'console_scripts', 'osrf')()) File "/usr/local/lib/python3.9/dist-packages/osrframework-0.20.4-py3.9.egg/osrframework/launcher.py", line 152, in main module.main(args) File "/usr/local/lib/python3.9/dist-packages/osrframework-0.20.4-py3.9.egg/osrframework/mailfy.py", line 501, in main registered = process_mail_list_step_2(platforms=platforms, emails=emails) File "/usr/local/lib/python3.9/dist-packages/osrframework-0.20.4-py3.9.egg/osrframework/mailfy.py", line 349, in process_mail_list_step_2 entities = pla.do_mailfy(query=e) File "/usr/local/lib/python3.9/dist-packages/osrframework-0.20.4-py3.9.egg/osrframework/wrappers/gnupgkeys.py", line 183, in do_mailfy info = self.check_mailfy(query, kwargs) File "/usr/local/lib/python3.9/dist-packages/osrframework-0.20.4-py3.9.egg/osrframework/wrappers/gnupgkeys.py", line 132, in check_mailfy resp = s.get(f"http://keys.gnupg.net/pks/lookup?search={query}") File "/usr/lib/python3/dist-packages/requests/sessions.py", line 543, in get return self.request('GET', url, kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 530, in request resp = self.send(prep, send_kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 643, in send r = adapter.send(request, kwargs) File "/usr/lib/python3/dist-packages/requests/adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='keys.gnupg.net', port=80): Max retries exceeded with url: /pks/lookup?search=email@example.com (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fa2b4c38a90>: Failed to establish a new connection: [Errno -5] No address associated with hostname')) `