Nekmo / dirhunt

Find web directories without bruteforce

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SSLCertVerificationError

hax0rgb opened this issue · comments

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