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

log-helper and json-output from oleobj #771

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

christian-intra2net
Copy link
Contributor

@christian-intra2net christian-intra2net commented Jun 17, 2022

Use log_helper in oleobj and use it to create json-output.

This PR includes the two commits of PR #769 to simplify testing and two other unrelated commits ("Fix occurrence of msodde..." and "Remove unused import").

Output in JSON format simplifies integration of oleobj in filtering pipelines. Changes to output itself are minimal, without --json option users should not see a difference to before.

@christian-intra2net christian-intra2net changed the title log-helper and json-output from olevba log-helper and json-output from oleobj Jul 11, 2022
Not needed any more when using log_helper
People (like me) might think that when they give "-r" as argument they
could give a directory with samples as input, e.g.

oleobj -r /path/to/samples

when actually they need to specify that with a glob and -r is
independent of that

oleobj /path/to/samples\*

Clarify that in the help-string of "-r".

Also, giving a glob did result in an error saying that this is not an
existing file. Fixed that.
Should not matter but this is safer and consistent with other tests.
When testing json-output we need to run samples through the "main"
functions of modules, not just their "process_file" functions that would
accept the extracted and decrypted data from the existing helper
function "loop_over_files". They need a filename as input, so add helper
to create a temp dir and extract&decrypt samples to that temporarily.
Since this test runs 3 scripts over all samples it takes pretty long.
Therefore, disable it per default, enable with a environment variable
OLETOOLS_TEST_JSON=1

Also, decrypting and extracting malware samples onto the disc might
cause trouble, another reason for not enabling this test per default.
@christian-intra2net
Copy link
Contributor Author

Fixed a bug I added earlier (ooxml had no enable_logging)

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

Successfully merging this pull request may close these issues.

None yet

1 participant