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

Connection errors #1

Open
Deadshot-MISP opened this issue Feb 16, 2022 · 2 comments
Open

Connection errors #1

Deadshot-MISP opened this issue Feb 16, 2022 · 2 comments

Comments

@Deadshot-MISP
Copy link

Hello,

I am trying to connect MISP to our deep discovery director, I am at the first part of your guide, I edited the key.py file and ran python3 last.py -l 1h, and I get the below errors.

Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/urllib3/connection.py", line 160, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "/usr/lib/python3.6/site-packages/urllib3/util/connection.py", line 84, in create_connection
raise err
File "/usr/lib/python3.6/site-packages/urllib3/util/connection.py", line 74, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 672, in urlopen
chunked=chunked,
File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 376, in _make_request
self._validate_conn(conn)
File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 994, in _validate_conn
conn.connect()
File "/usr/lib/python3.6/site-packages/urllib3/connection.py", line 348, in connect
conn = self._new_conn()
File "/usr/lib/python3.6/site-packages/urllib3/connection.py", line 172, in _new_conn
self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f3aec011ef0>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/usr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 720, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/usr/lib/python3.6/site-packages/urllib3/util/retry.py", line 436, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='misp.companysite.com', port=443): Max retries exceeded with url: /servers/getPyMISPVersion.json (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f3aec011ef0>: Failed to establish a new connection: [Errno 111] Connection refused',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/pymisp-2.4.144-py3.6.egg/pymisp/api.py", line 160, in init
response = self.recommended_pymisp_version
File "/usr/local/lib/python3.6/site-packages/pymisp-2.4.144-py3.6.egg/pymisp/api.py", line 216, in recommended_pymisp_version
response = self._prepare_request('GET', 'servers/getPyMISPVersion.json')
File "/usr/local/lib/python3.6/site-packages/pymisp-2.4.144-py3.6.egg/pymisp/api.py", line 3490, in _prepare_request
return self.__session.send(prepped, timeout=self.timeout, **settings)
File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3.6/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='misp.companysite.com', port=443): Max retries exceeded with url: /servers/getPyMISPVersion.json (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f3aec011ef0>: Failed to establish a new connection: [Errno 111] Connection refused',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "last.py", line 35, in
misp = ExpandedPyMISP(misp_url, misp_key, misp_verifycert, cert=misp_client_cert)
File "/usr/local/lib/python3.6/site-packages/pymisp-2.4.144-py3.6.egg/pymisp/api.py", line 181, in init
raise PyMISPError(f'Unable to connect to MISP ({self.root_url}). Please make sure the API key and the URL are correct (http/https is required): {e}')
pymisp.exceptions.PyMISPError: Unable to connect to MISP (https://misp.companysite.com/). Please make sure the API key and the URL are correct (http/https is required): HTTPSConnectionPool(host='misp.companysite.com', port=443):

@chackco
Copy link
Owner

chackco commented Feb 17, 2022

from your error , it seem tm-misp cannot connect to target , please check, for example you need connect to ddd
you need to allow connection port 443 from your misp host to ddd

@Deadshot-MISP
Copy link
Author

I am not at that part, the connection I have only edited the keys.py file with the misp url and misp key, and then ran the last.py test. It is failing to connect to itself(the misp URL)

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