sherlock icon indicating copy to clipboard operation
sherlock copied to clipboard

Having a . at the end of a username causes an error

Open ShadowFox88 opened this issue 1 year ago • 2 comments

Installation method

PyPI (via pip)

Description

When trying out a username that ends in ., there is an error with the way the program looks for the username. Currently, for the site exposure it goes to {username}.exposure.co, but in the event the username provided has a ., it will error as you can't have 2 dots in a URL. The error trace I get is this:

Traceback (most recent call last):
  File "/home/vahin/.local/bin/sherlock", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/vahin/.local/share/pipx/venvs/sherlock-project/lib/python3.12/site-packages/sherlock_project/sherlock.py", line 829, in main
    results = sherlock(
              ^^^^^^^^^
  File "/home/vahin/.local/share/pipx/venvs/sherlock-project/lib/python3.12/site-packages/sherlock_project/sherlock.py", line 386, in sherlock
    r, error_text, exception_text = get_response(
                                    ^^^^^^^^^^^^^
  File "/home/vahin/.local/share/pipx/venvs/sherlock-project/lib/python3.12/site-packages/sherlock_project/sherlock.py", line 119, in get_response
    response = request_future.result()
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/usr/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vahin/.local/share/pipx/venvs/sherlock-project/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vahin/.local/share/pipx/venvs/sherlock-project/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vahin/.local/share/pipx/venvs/sherlock-project/lib/python3.12/site-packages/requests/adapters.py", line 667, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/home/vahin/.local/share/pipx/venvs/sherlock-project/lib/python3.12/site-packages/urllib3/connectionpool.py", line 789, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "/home/vahin/.local/share/pipx/venvs/sherlock-project/lib/python3.12/site-packages/urllib3/connectionpool.py", line 466, in _make_request
    self._validate_conn(conn)
  File "/home/vahin/.local/share/pipx/venvs/sherlock-project/lib/python3.12/site-packages/urllib3/connectionpool.py", line 1095, in _validate_conn
    conn.connect()
  File "/home/vahin/.local/share/pipx/venvs/sherlock-project/lib/python3.12/site-packages/urllib3/connection.py", line 615, in connect
    self.sock = sock = self._new_conn()
                       ^^^^^^^^^^^^^^^^
  File "/home/vahin/.local/share/pipx/venvs/sherlock-project/lib/python3.12/site-packages/urllib3/connection.py", line 196, in _new_conn
    sock = connection.create_connection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vahin/.local/share/pipx/venvs/sherlock-project/lib/python3.12/site-packages/urllib3/util/connection.py", line 58, in create_connection
    raise LocationParseError(f"'{host}', label empty or too long") from None
urllib3.exceptions.LocationParseError: Failed to parse: 'thisisatest123..exposure.co', label empty or too long

Steps to reproduce

  1. Try running sherlock <username>.
  2. The error should appear

Additional information

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

ShadowFox88 avatar Aug 05 '24 22:08 ShadowFox88

Hm. Good catch.

Since some sites CAN have a dot at the end, even if only a few, this should probably be addressed via the regexCheck key for sites that don't

ppfeister avatar Aug 05 '24 23:08 ppfeister

Hi @ppfeister. I've created a pull request that will fix this bug. #2287 . Please, check this out.

ntexe avatar Sep 05 '24 13:09 ntexe

https://github.com/sherlock-project/sherlock/issues/2242#issue-2449598345

Joze5280 avatar Sep 16 '25 07:09 Joze5280

@esinyay

alparslan1453927 avatar Sep 16 '25 07:09 alparslan1453927