Merged
Conversation
ryanohoro
reviewed
Jan 25, 2023
Collaborator
ryanohoro
left a comment
There was a problem hiding this comment.
Seems to work as advertised
src/python/strelka/tests_configuration/test_scanner_assignment.py
Outdated
Show resolved
Hide resolved
ryanohoro
reviewed
Jan 25, 2023
This file contains hidden or 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
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.
Describe the change
TLSH is a fuzzy matching algorithm that can be used for similarity comparisons. Similar files will have similar hash values which allows for the detection of similar objects by comparing their hash values TLSH has been adopted by a range of bodies and malware repositories.
This PR adds in a TLSH scanner, which compute the TLSH per file and compares against a local list of TLSH hashes to identify potential matches. The output of this scanner is a score based on a maximum threshold as well as a list of known TLSH hashes to compare against. If the comparison score between the source file and one of the list hashes is below a threshold (default: 30), a match is stored in the scanner's output.
The following chart provides an understanding of potential matches using score:
With a default set to below 30, the expected false positive rate is low with an acceptable detection hit rate.
To use this scanner, you must generate a YAML file consisting of labels and corresponding TLSH values to compare against. The file at
./configs/python/backend/tlsh/rules.yamlis the default location for this match file, but can be overridden in thebackend.yamloptions forScanTlsh.Describe testing procedures
The scanner test:
./src/python/strelka/tests/test_scan_tlsh.pywas created to validate this scanner.Given an install of the
requirements.txtfile at./src/python/requirements.txt, runningsrc/python/strelka/tests/test_scan_tlsh.pyshould result in test success:Sample output
Checklist