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

SSLCertVerificationError #95

Closed
hax0rgb opened this issue Aug 1, 2021 · 0 comments
Closed

SSLCertVerificationError #95

hax0rgb opened this issue Aug 1, 2021 · 0 comments
Assignees
Milestone

Comments

@hax0rgb
Copy link

hax0rgb commented Aug 1, 2021

  • Python version: 3.7.10
  • Operating System: Linux
  • Dependencies list (run pip freeze): Output below:
beautifulsoup4==4.9.3
bs4==0.0.1
certifi==2021.5.30
cffi==1.14.6
chardet==4.0.0
charset-normalizer==2.0.4
click==8.0.1
colorama==0.4.4
colorclass==2.2.0
cryptography==3.4.7
dicttoxml==1.7.4
dirhunt==0.8.1
EditorConfig==0.12.3
filelock==3.0.12
future==0.18.2
gevent==21.1.2
google==3.0.0
greenlet==1.1.0
humanize==3.10.0
idna==3.2
importlib-metadata==4.6.3
Interlace==1.9.5
jsbeautifier==1.14.0
LinkFinder==1.0
lxml==4.6.3
MarkupSafe==2.0.1
netaddr==0.7.20
proxy-db==0.3.1
pycparser==2.20
PySocks==1.7.1
requests==2.26.0
requests-file==1.5.1
requests-mock==1.9.3
six==1.16.0
soupsieve==2.2.1
SQLAlchemy==1.4.22
tldextract==3.1.0
tqdm==4.36.1
typing-extensions==3.10.0.0
urllib3==1.26.6
zipp==3.5.0
zope.event==4.5.0
zope.interface==5.4.0

Description

The tool returns a lot of SSLCertVerificationError when running against a list of internal IP addresses. Is there a way to suppress these errors from the terminal output?

What I Did

Command used:

dirhunt List_of_urls.txt

Output:
Although the tool ran as expected and enumerated the web directories, my terminal was full of following errors

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1091)
  File "/home/srt_l9e0mzi05f/.local/lib/python3.7/site-packages/dirhunt/sessions.py", line 48, in wrap
    return fn(self, *args, **kwargs)
  File "/home/srt_l9e0mzi05f/.local/lib/python3.7/site-packages/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
  File "/home/srt_l9e0mzi05f/.local/lib/python3.7/site-packages/dirhunt/sessions.py", line 48, in wrap
    return fn(self, *args, **kwargs)
  File "/home/srt_l9e0mzi05f/.local/lib/python3.7/site-packages/urllib3/util/ssl_.py", line 450, in ssl_wrap_socket
    sock, context, tls_in_tls, server_hostname=server_hostname
  File "/home/srt_l9e0mzi05f/.local/lib/python3.7/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/home/srt_l9e0mzi05f/.local/lib/python3.7/site-packages/dirhunt/sessions.py", line 111, in get
    response = self.session.get(url, **kw)  # kwargs with proxies
  File "/home/srt_l9e0mzi05f/.local/lib/python3.7/site-packages/urllib3/util/ssl_.py", line 450, in ssl_wrap_socket
    sock, context, tls_in_tls, server_hostname=server_hostname
  File "/home/srt_l9e0mzi05f/.local/lib/python3.7/site-packages/requests/adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='www.virustotal.com', port=443): Max retries exceeded with url: /es/domain/3.222.93.59/information/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1091)')))
  File "/home/srt_l9e0mzi05f/.local/lib/python3.7/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)

During handling of the above exception, another exception occurred:

  File "/home/srt_l9e0mzi05f/.local/lib/python3.7/site-packages/dirhunt/sources/virustotal.py", line 17, in callback
    html = session.get(url).text
  File "/home/srt_l9e0mzi05f/.local/lib/python3.7/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
Traceback (most recent call last):
  File "/home/srt_l9e0mzi05f/.local/lib/python3.7/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/srt_l9e0mzi05f/.local/lib/python3.7/site-packages/dirhunt/sessions.py", line 111, in get
    response = self.session.get(url, **kw)  # kwargs with proxies
  File "/home/srt_l9e0mzi05f/.local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn
    conn.connect()
  File "/home/srt_l9e0mzi05f/.local/lib/python3.7/site-packages/dirhunt/sessions.py", line 48, in wrap
    return fn(self, *args, **kwargs)
  File "/home/srt_l9e0mzi05f/.local/lib/python3.7/site-packages/dirhunt/sessions.py", line 48, in wrap
    return fn(self, *args, **kwargs)
  File "/usr/lib64/python3.7/ssl.py", line 423, in wrap_socket
    session=session
  File "/home/srt_l9e0mzi05f/.local/lib/python3.7/site-packages/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
  File "/home/srt_l9e0mzi05f/.local/lib/python3.7/site-packages/requests/adapters.py", line 514, in send
    raise SSLError(e, request=request)
  File "/home/srt_l9e0mzi05f/.local/lib/python3.7/site-packages/dirhunt/sessions.py", line 111, in get
    response = self.session.get(url, **kw)  # kwargs with proxies
  File "/home/srt_l9e0mzi05f/.local/lib/python3.7/site-packages/requests/sessions.py", line 555, in get
    return self.request('GET', url, **kwargs)
  File "/home/srt_l9e0mzi05f/.local/lib/python3.7/site-packages/requests/sessions.py", line 555, in get
    return self.request('GET', url, **kwargs)
  File "/home/srt_l9e0mzi05f/.local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/home/srt_l9e0mzi05f/.local/lib/python3.7/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib64/python3.7/ssl.py", line 870, in _create
    self.do_handshake()
@Nekmo Nekmo self-assigned this Jan 25, 2022
@Nekmo Nekmo added this to the v0.9.0 milestone Jan 25, 2022
Nekmo added a commit that referenced this issue May 16, 2022
@Nekmo Nekmo closed this as completed May 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants