gcrahay / otx_misp

Imports Alienvault OTX pulses to a MISP instance
Other
52 stars 42 forks source link

'TypeError' object has no attribute 'message' #39

Open Blu3B3ard opened 4 years ago

Blu3B3ard commented 4 years ago

Description

Hi.

I tried to do the firts command bellow after install otx-misp: otx-misp -o OTX API key -s https://misp.example.com/ -m MISP API key -t "2017-07-16T19:20:30+01:00" -u -c otx.ini -w

But the return is 'TypeError' object has no attibute 'message'.

Versions

Traceback or error

'TypeError' object has no attibute 'message'

sudo-jtcsec commented 4 years ago

I found that I'm having a similar issue. I think its tied to the creation of a MISP object in init.py

When I try a dry run to pull Pulses, it works. When I try to add a MISP event, I get the type error message. When I put it at the highest verbosity, it looks like I at least get to line 175. The output is below:

Connection to MISP instance: https://misp Error: 'TypeError' object has no attribute 'message'

Then the following line is hit: try: misp = pymisp.PyMISP(server, key, ssl=False, out_type='json')

I think "out_type" may have been deprecated, because I dont see that as an option in the documentation for creating a pymisp object (https://pymisp.readthedocs.io/en/latest/modules.html#mispobject)

I tried a script I have that I know works to create a pymisp object - without the "out_file='json'" option it works, but with it I get an unexpected keyword argument error.

So after the pymisp object creation fails, it trys and fails to print the error message for some unknown other reason.

except pymisp.PyMISPError as ex: raise ImportException("Cannot connect to MISP instance: {}".format(ex.message)) except Exception as ex: raise ImportException("Cannot connect to MISP instance, unknown exception: {}".format(ex.message))

So potentially two separate issues: error message not printing correctly and then the error that is failing to print is a pymisp creation failure?