Nekmo / dirhunt

Find web directories without bruteforce
MIT License
1.77k stars 255 forks source link

SSLCertVerificationError #95

Closed hax0rgb closed 2 years ago

hax0rgb commented 3 years ago

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()