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

broken report functionality in 45727ef commit #2804

Closed
Morpheme777 opened this issue Aug 17, 2023 · 7 comments
Closed

broken report functionality in 45727ef commit #2804

Morpheme777 opened this issue Aug 17, 2023 · 7 comments

Comments

@Morpheme777
Copy link
Contributor

Morpheme777 commented Aug 17, 2023

Describe the bug
I get an error when trying to generate report:

2023-08-16 14:29:28 - ERROR (c_operation.py:323 report) Error saving operation report (basic scenario)
Traceback (most recent call last):
  File "/opt/caldera2/caldera/app/objects/c_operation.py", line 315, in report
    step_report['output'] = json.loads(results.replace('\\r\\n', '').replace('\\n', ''))
  File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.9/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid \escape: line 1 column 17620 (char 17619)

To Reproduce

  1. I don't actually know what exact ability calls an exception, but when I run operation with around 50 abilities, I get an error in generating report.

Expected behavior
Generatiing report without issues

Screenshots
I just get an error in log and nothing in UI.

Desktop (please complete the following information):

  • OS: Kali linux
  • Browser Edge
  • Version Caldera 4.2.0

Additional context
I've found the root of issue. The commit 45727ef in c_operation.py broke the functionality due to removing try..except.. structure from code.

@elegantmoose
Copy link
Contributor

@Morpheme777 Which commit? That link is broken for me or rather doesnt show the commit.

@Morpheme777
Copy link
Contributor Author

Morpheme777 commented Aug 24, 2023

sory, my bad.
correct link: 45727ef

first comment was fixed too

@Morpheme777 Morpheme777 changed the title broken report functionality in 45727ef commit broken report functionality in [https://github.com/mitre/caldera/commit/45727ef78844f30d0ab91e2acf462f8ec74acd3d](https://github.com/mitre/caldera/commit/45727ef78844f30d0ab91e2acf462f8ec74acd3d) commit Aug 24, 2023
@Morpheme777 Morpheme777 changed the title broken report functionality in [https://github.com/mitre/caldera/commit/45727ef78844f30d0ab91e2acf462f8ec74acd3d](https://github.com/mitre/caldera/commit/45727ef78844f30d0ab91e2acf462f8ec74acd3d) commit broken report functionality in 45727ef commit Aug 24, 2023
@elegantmoose
Copy link
Contributor

Fix coming.

@elegantmoose
Copy link
Contributor

@Morpheme777 I might have been confusing your bug with another one but we did just push this patch (mitre/debrief#67) to Debrief plugin and bumped the version of the reportlab lib the report generator uses.

If you can, pull latest master from Caldera repo, and then cd into the /plugins/debrief plugin and pull its master branch as well. (eventually we will repin debrief to current version but we like to wait and do all the plugins at once we repinning)

@github-actions
Copy link

github-actions bot commented Oct 9, 2023

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

@Morpheme777
Copy link
Contributor Author

I'm newbie in git, so I actually didn't understand what exactly I need to do=)
I found a bug, specified the reason of that behavior and if I understand right the bug has nothing to do with plugins at all. As you can above in the description of the bug, the error appears in file /opt/caldera2/caldera/app/objects/c_operation.py

Copy link

github-actions bot commented Nov 9, 2023

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants