-
Notifications
You must be signed in to change notification settings - Fork 563
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
decalage2
merged 18 commits into
decalage2:master
from
christian-intra2net:is-encrypted-by-msoffcrypto
May 11, 2019
Merged
Is encrypted by msoffcrypto #441
decalage2
merged 18 commits into
decalage2:master
from
christian-intra2net:is-encrypted-by-msoffcrypto
May 11, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)
This is a re-creation of PR #436 |
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. |
Once we are done with this: I have another branch waiting to become a PR which requires this (link) |
decalage2
approved these changes
May 11, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.