Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
ShadowFox88 opened this issue Aug 5, 2024 · 2 comments · May be fixed by #2287
Open
1 task done

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

ShadowFox88 opened this issue Aug 5, 2024 · 2 comments · May be fixed by #2287
Labels
bug Something isn't working

Comments

@ShadowFox88
Copy link

ShadowFox88 commented Aug 5, 2024

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

  • I agree to follow this project's Code of Conduct
@ShadowFox88 ShadowFox88 added the bug Something isn't working label Aug 5, 2024
@ppfeister
Copy link
Member

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

ntexe added a commit to ntexe/sherlock that referenced this issue Sep 5, 2024
@ntexe ntexe linked a pull request Sep 5, 2024 that will close this issue
@ntexe
Copy link
Contributor

ntexe commented Sep 5, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants