forked from VirusTotal/yara
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding per certificate file hash validation on PE file.
- Loading branch information
Showing
1 changed file
with
156 additions
and
0 deletions.
There are no files selected for viewing
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
6325c0f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this change it would be possible to add detection for stolen invalid certificates.
As an example tool:
https://github.com/secretsquirrel/SigThief
This following signature would be able to add detection for these files.
rule testsignhash
{
condition:
uint16(0) == 0x5A4D and pe.number_of_signatures > 0 and
for any i in (0..pe.number_of_signatures - 1): ( pe.signatures[i].thumbprint == "84ec67b9ac9d7789bab500503a7862173f432adb" and pe.signatures[i].hashinvalid)
}
Issue VirusTotal#1071 also is solved by this
6325c0f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am seeing a lot of in-the-wild samples doing this circumvention.
Some examples:
https://www.virustotal.com/gui/file/9600876f5aafc23e51f1af74784ebb861d98480c81f7d56c82177cabc884ac9e/detection
https://www.virustotal.com/gui/file/5148af5dadfad4c02d7baa81551ed8e809d0c4ebfe6631445c98274c3f469c13/detection
6325c0f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This got never merged, right?
6325c0f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately no.
6325c0f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the swift response. Perhaps a PR like VirusTotal/yara#1623 will make it. It would also provide this, as far as I can tell. But it's not yet merged.