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

Is encrypted by msoffcrypto #441

Merged

Conversation

christian-intra2net
Copy link
Contributor

Encountered a sample for which msoffcrypto correctly detects encryption but crypto.is_encrypted does not (see first commit). Instead of fixing oletools, duplicating stuff that works in msoffcrypto, use the msoffcrypto code to check for encryption. Keep the old implementation as backup (in case msoffcrypto fails or is not available).

Also added a try-catch around is_encrypted testing solving issue #427 . Add test code so this will not happen again.
And update some testcode to get rid of oleid-warnings.

This is an interesting one since "our" old implementation of is_encrypted
claims that the embedded file is still encrypted (which it is not), but
the msoffcrypto-is_encrypted gets it right.
There were cases where our own test of byte 0x15 of SummaryInformation
stream was incorrect. So leave test to the professionals ;-)
Running main() within same interpreter capturing SystemExit and
sys.stdout/err always causes trouble (at least in unittest).
Fork another python process and capture from there, that is easier
and cleaner in my view.
Might be password like error message states, but could also be a problem
with crypto libraries (e.g. dll/so-file for cryptography not found)
@christian-intra2net
Copy link
Contributor Author

This is a re-creation of PR #436

@christian-intra2net
Copy link
Contributor Author

Added one more small test. It is unrelated to this PR but too insignificant to warrant its own pull request, so I just added it.

@christian-intra2net
Copy link
Contributor Author

Once we are done with this: I have another branch waiting to become a PR which requires this (link)

@christian-intra2net christian-intra2net deleted the is-encrypted-by-msoffcrypto branch May 20, 2019 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants