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

JSON error #151

Open
priamai opened this issue Sep 20, 2023 · 3 comments
Open

JSON error #151

priamai opened this issue Sep 20, 2023 · 3 comments

Comments

@priamai
Copy link

priamai commented Sep 20, 2023

Describe the bug

Getting this JSON error:

File ~/DevOps/github/firstorg2023/venv/lib/python3.10/site-packages/requests/models.py:975, in Response.json(self, **kwargs)
    971     return complexjson.loads(self.text, **kwargs)
    972 except JSONDecodeError as e:
    973     # Catch JSON-related errors and raise as requests.JSONDecodeError
    974     # This aliases json.JSONDecodeError and simplejson.JSONDecodeError
--> 975     raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)

JSONDecodeError: Expecting value: line 1 column 1833357 (char 1833356)

To Reproduce


from pyattck import Attck

attack = Attck()

for technique in attack.enterprise.techniques:
    print(technique.id)
    print(technique.name)

Expected behavior
List of techniques.

Screenshots

Desktop (please complete the following information):

  • OS: Linux
  • Pip version: Version: 7.1.2

Additional context
Add any other context about the problem here.

@stevengoossensB
Copy link

Something is off with the file and how it's generated

image

You can edit the file, change these values to something so the json doesn't break (e.g. empty strings and then load it from local when constructing the Attck object in your code.

@Your7Maxx
Copy link

Something is off with the file and how it's generated

image

You can edit the file, change these values to something so the json doesn't break (e.g. empty strings and then load it from local when constructing the Attck object in your code.

I also encountered the same problem, may I ask where is the file path you modified?

@cridin1
Copy link

cridin1 commented Dec 1, 2023

I changed the path from which it pulls the json file and it works fine:

attack = Attck(enterprise_attck_json="https://raw.githubusercontent.com/mitre/cti/master/enterprise-attack/enterprise-attack.json")
print(attack.enterprise.techniques[0].tactics[0].name)

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

4 participants