Neo23x0 / munin

Online hash checker for Virustotal and other services

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exception raised using MISP feature (proxy support)

Tux-Panik opened this issue · comments

Dear,
After pulling the latest version, I'm not able to run properly the MISP module:
cd /opt/munin/
sudo git pull
sudo vi /opt/munin/munin.ini (to add/change my own API keys)
sudo python3 -m pip install -r /opt/munin/requirements.txt
sudo python3 /opt/munin/munin.py --debug -i /opt/munin/munin.ini -f <input>

However, I reached the following exception:

[D] Querying MISP: 'https://misppriv.circl.lu'
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/pymisp/api.py", line 98, in init
response = self.get_recommended_api_version()
File "/usr/local/lib/python3.6/dist-packages/pymisp/api.py", line 1340, in get_recommended_api_version
response = self._prepare_request('GET', url)
File "/usr/local/lib/python3.6/dist-packages/pymisp/api.py", line 177, in _prepare_request
return s.send(prepped, verify=self.ssl, proxies=self.proxies, cert=self.cert)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 612, in send
adapter = self.get_adapter(url=request.url)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 703, in get_adapter
raise InvalidSchema("No connection adapters were found for '%s'" % url)
requests.exceptions.InvalidSchema: No connection adapters were found for ''https:/servers/getPyMISPVersion.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/munin/munin.py", line 503, in getMISPInfo
misp = PyMISP(MISP_URL, MISP_API_KEY, args.verifycert, 'json')
File "/usr/local/lib/python3.6/dist-packages/pymisp/api.py", line 112, in init
raise PyMISPError('Unable to connect to MISP ({}). Please make sure the API key and the URL are correct (http/https is required): {}'.format(self.root_url, e))
pymisp.exceptions.PyMISPError: Unable to connect to MISP ('https://misppriv.circl.lu'). Please make sure the API key and the URL are correct (http/https is required): No connection adapters were found for ''https:/servers/getPyMISPVersion.json'

I double checked the API key and it is good.

Any idea?
Thanks in advance,
Regards,
Julien

It seems like a connection error.

What is the output of

curl -o /dev/null --silent --head --write-out '%{http_code}\n' https://misppriv.circl.lu

Thanks Florian,
Below the command line output:
curl -o /dev/null --silent --head --write-out '%{http_code}\n' https://misppriv.circl.lu
302
I use a proxy but it is specified in my environment "$http_proxy" and "$https_proxy" and it allows connection to this subdomain.
The same with VT:
curl -o /dev/null --silent --head --write-out '%{http_code}\n' https://www.virustotal.com
200
So it is a proxy issue... strange!

Regards

PyMISP requires a manual proxy definition.
https://github.com/CIRCL/PyMISP/blob/644e1b065afd6f87f480a4bafa45ec908882cab7/pymisp/api.py#L65

I don't have that yet in my program.

I would keep this open as a missing feature in munin