emalderson / ThePhish

ThePhish: an automated phishing email analysis tool
GNU Affero General Public License v3.0
1.13k stars 174 forks source link

[ERROR]: Error while trying to create the case #33

Closed r1c4rd0r0ch4 closed 1 year ago

r1c4rd0r0ch4 commented 1 year ago

Hi,

After click open "Analyze" button, some messages shows up and suddenly it appears a message saying: [ERROR]: Error while trying to create the case.

How can I debug that?

Any idea?

r1c4rd0r0ch4 commented 1 year ago

[ERROR]_[case_from_email]: Error while trying to create the case: Traceback (most recent call last): File "/ThePhish/app/case_from_email.py", line 534, in main new_case = create_case(subject_field, observables_header, observables_body, attachments, hashes_attachments, eml_file_tuple, wsl) File "/ThePhish/app/case_from_email.py", line 308, in create_case if(len(api_thehive.find_case_templates(query = thehive4py.query.Eq("name", 'ThePhish')).json())) == 0: File "/home/ativy/.local/lib/python3.8/site-packages/thehive4py/api.py", line 680, in find_case_templates return self.find_rows("/api/case/template/_search", **attributes) File "/home/ativy/.local/lib/python3.8/site-packages/thehive4py/api.py", line 120, in find_rows return requests.post(req, params=params, json=data, proxies=self.proxies, auth=self.auth, verify=self.cert) File "/home/ativy/.local/lib/python3.8/site-packages/requests/api.py", line 117, in post return request('post', url, data=data, json=json, kwargs) File "/home/ativy/.local/lib/python3.8/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, kwargs) File "/home/ativy/.local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request resp = self.send(prep, send_kwargs) File "/home/ativy/.local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send r = adapter.send(request, kwargs) File "/home/ativy/.local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send resp = conn.urlopen( File "/home/ativy/.local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen httplib_response = self._make_request( File "/home/ativy/.local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 382, in _make_request self._validate_conn(conn) File "/home/ativy/.local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn conn.connect() File "/home/ativy/.local/lib/python3.8/site-packages/urllib3/connection.py", line 392, in connect self.ssl_context = create_urllib3context( File "/home/ativy/.local/lib/python3.8/site-packages/urllib3/util/ssl.py", line 312, in create_urllib3_context context.options |= options File "/usr/lib/python3.8/ssl.py", line 602, in options super(SSLContext, SSLContext).options.set(self, value) File "/usr/lib/python3.8/ssl.py", line 602, in options super(SSLContext, SSLContext).options.set(self, value) File "/usr/lib/python3.8/ssl.py", line 602, in options super(SSLContext, SSLContext).options.set(self, value) [Previous line repeated 476 more times] RecursionError: maximum recursion depth exceeded while calling a Python object

[ERROR]_[case_from_email]: Error while trying to create the case: Traceback (most recent call last): File "/ThePhish/app/case_from_email.py", line 534, in main new_case = create_case(subject_field, observables_header, observables_body, attachments, hashes_attachments, eml_file_tuple, wsl) File "/ThePhish/app/case_from_email.py", line 308, in create_case if(len(api_thehive.find_case_templates(query = thehive4py.query.Eq("name", 'ThePhish')).json())) == 0: File "/home/ativy/.local/lib/python3.8/site-packages/thehive4py/api.py", line 680, in find_case_templates return self.find_rows("/api/case/template/_search", **attributes) File "/home/ativy/.local/lib/python3.8/site-packages/thehive4py/api.py", line 120, in find_rows return requests.post(req, params=params, json=data, proxies=self.proxies, auth=self.auth, verify=self.cert) File "/home/ativy/.local/lib/python3.8/site-packages/requests/api.py", line 117, in post return request('post', url, data=data, json=json, kwargs) File "/home/ativy/.local/lib/python3.8/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, kwargs) File "/home/ativy/.local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request resp = self.send(prep, send_kwargs) File "/home/ativy/.local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send r = adapter.send(request, kwargs) File "/home/ativy/.local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send resp = conn.urlopen( File "/home/ativy/.local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen httplib_response = self._make_request( File "/home/ativy/.local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 382, in _make_request self._validate_conn(conn) File "/home/ativy/.local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn conn.connect() File "/home/ativy/.local/lib/python3.8/site-packages/urllib3/connection.py", line 392, in connect self.ssl_context = create_urllib3context( File "/home/ativy/.local/lib/python3.8/site-packages/urllib3/util/ssl.py", line 312, in create_urllib3_context context.options |= options File "/usr/lib/python3.8/ssl.py", line 602, in options super(SSLContext, SSLContext).options.set(self, value) File "/usr/lib/python3.8/ssl.py", line 602, in options super(SSLContext, SSLContext).options.set(self, value) File "/usr/lib/python3.8/ssl.py", line 602, in options super(SSLContext, SSLContext).options.set(self, value) [Previous line repeated 476 more times] RecursionError: maximum recursion depth exceeded while calling a Python object

[ERROR]_[thephish_app]: Exception on /analysis [POST] Traceback (most recent call last): File "/home/ativy/.local/lib/python3.8/site-packages/flask/app.py", line 2070, in wsgi_app response = self.full_dispatch_request() File "/home/ativy/.local/lib/python3.8/site-packages/flask/app.py", line 1515, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/ativy/.local/lib/python3.8/site-packages/flask/app.py", line 1513, in full_dispatch_request rv = self.dispatch_request() File "/home/ativy/.local/lib/python3.8/site-packages/flask/app.py", line 1499, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args) File "thephish_app.py", line 37, in analyze_email new_case_id, external_from_field = case_from_email.main(wsl, mail_uid) TypeError: cannot unpack non-iterable NoneType object

r1c4rd0r0ch4 commented 1 year ago

https://iili.io/H1kWPLX.png

emalderson commented 1 year ago

Are you using a version of TheHive that is supported by ThePhish? Also, have you set the API keys correctly? It seems like the API request is not being fulfilled.

r1c4rd0r0ch4 commented 1 year ago

Hi, the issue has been solved. API key wasn´t correct! Thank you so much!