annamcabee / Mitre-Attack-API

Python module to interact with the MITRE attack framework via the MITRE API
73 stars 17 forks source link

simplejson.errors.JSONDecodeError #3

Open SofiaArancibia opened 6 years ago

SofiaArancibia commented 6 years ago

Hi! I'm trying to use the API and whichever function I run, the error message is the same:

simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

So for example:

from mitreapi import AttackAPI
from pandas import *
from pandas.io.json import json_normalize
attack = AttackAPI()
groups = attack.get_all_groups()

I got:

Traceback (most recent call last):
  File "/home/sofia/Desktop/new_rules/MITRE_parsing.py", line 12, in <module>
    groups = attack.get_all_groups()
  File "/home/sofia/.local/lib/python2.7/site-packages/mitreapi/mitre.py", line 54, in get_all_groups
    data = json.loads(response.content)
  File "/home/sofia/.local/lib/python2.7/site-packages/simplejson/__init__.py", line 518, in loads
    return _default_decoder.decode(s)
  File "/home/sofia/.local/lib/python2.7/site-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/home/sofia/.local/lib/python2.7/site-packages/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
[Finished in 1.4s]

Could you help? Thanks!

Cyb3rWard0g commented 6 years ago

Good afternoon @SofiaArancibia ! The ATT&CK API used in this library has been already deprecated. I would recommend using this new library which uses TAXII APIs provided by MITRE. Let me know if this helps: https://github.com/Cyb3rWard0g/ATTACK-Python-Client