Method and system for zero day malware similarity detection
Abstract
A method at a computing device including fragmenting a malware sample into a plurality of byte strings, each of the plurality of byte strings having a predetermined length; embedding each of the plurality of byte strings in an embedding network to generate a plurality of embeddings; for each embedding in the plurality of embeddings, finding a nearest neighbor; and setting a predicted family for the malware sample based on a fusion of the nearest neighbor for each of the plurality of embeddings.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 11 · Forward citations: 0.
Claims (15 — 3 Independent, 12 Dependent)
- Claim 1Independent Claim
A method at a computing device comprising: performing a first training on the embedding network, the first training comprising: randomly choosing two malware samples from a malware family; randomly choosing a benignware sample from a corpus of benignware; fragmenting each of the two malware samples and the benignware sample into byte strings of the predetermined length: creating triplet pairs of an anchor sample and positive sample from the byte strings from the two malware samples and a negative sample from the byte strings from the benignware sample; and training the embedding network for triplet loss based on the triplet pairs; fragmenting a malware sample into a plurality of byte strings, each of the plurality of byte strings having a predetermined length, the predetermined length being based on an input size of an embedding network trained on triplet pairs derived from malware and benignware to ensure a differentiation in byte string functionality; embedding each of the plurality of byte strings in the embedding network to generate a plurality of embeddings; for each embedding in the plurality of embeddings, finding a nearest neighbor; and setting a predicted family for the malware sample based on a fusion of the nearest neighbor for each of the plurality of embeddings; wherein when the nearest neighbor for an embedding is outside a predetermined threshold, classifying the embedding as unknown; and wherein, when the fusion comprises an unknown family, flagging the malware sample as a zero-day sample, the flagging causing an action to be performed on the malware sample.
- Claim 2Depends on #1
The method of claim 1, wherein the two malware samples and the benignware sample are raw executables.
- Claim 3Depends on #1
The method of claim 1, wherein triplet loss is calculated based on L = ∑ i = 1 b [ f (x i a) - f (x i p) 2 2 - f (x i a) - f (x i n) 2 2 + α] + where, Lis the loss, x a is the anchor sample, x p is the positive sample, x n is the negative sample, b is the length of a batch of triplet pairs, and a is a margin enforced between positive and negative pairs.
- Claim 4Depends on #1
The method of claim 1, further comprising using a gym environment to perform a second training, the second training comprising: creating a training set by: randomly choosing a plurality of first malware samples from a corpus of malware samples; fragmenting each of the plurality of first malware samples into a plurality of training byte strings, each of the plurality of training byte strings having a predetermined length; and organizing the plurality of training byte strings into the training set; creating a support set by: randomly choosing a plurality of second malware samples from a corpus of malware samples; fragmenting each of the plurality of second malware samples into a plurality of support byte strings, each of the plurality of support byte strings having a predetermined length; and organizing the plurality of support byte strings into the support set; choosing a batch of the training set; and using the support set and batch of the training set to update the embedding network by establishing a reward for batch matching for the entire batch of the training set.
- Claim 5Depends on #4
The method of claim 4, wherein the support set and batch of the training set are embedded using the embedding network.
- Claim 6Depends on #5
The method of claim 5, wherein the establishing the reward comprises performing a batch neighbor search for the batch of the training set.
- Claim 7Depends on #6
The method of claim 6, wherein the establishing the reward further comprising repeating batch neighbor search over the entire training set.
- Claim 8Independent Claim
A computing device comprising: a processor; and memory, wherein the computing device is configured to: perform a first training on the embedding network, the first training comprising: randomly choosing two malware samples from a malware family; randomly choosing a benignware sample from a corpus of benignware; fragmenting each of the two malware samples and the benignware sample into byte strings of the predetermined length; creating triplet pairs of an anchor sample and positive sample from the byte strings from the two malware samples and a negative sample from the byte strings from the benignware sample; and training the embedding network for triplet loss based on the triplet pairs; fragment a malware sample into a plurality of byte strings, each of the plurality of byte strings having a predetermined length, the predetermined length being based on an input size of an embedding network trained on triplet pairs derived from malware and benignware to ensure a differentiation in byte string functionality; embed each of the plurality of byte strings in the embedding network to generate a plurality of embeddings; for each embedding in the plurality of embeddings, find a nearest neighbor; and set a predicted family for the malware sample based on a fusion of the nearest neighbor for each of the plurality of embeddings; wherein when the nearest neighbor for an embedding is outside a predetermined threshold, classifying the embedding as unknown; and wherein, when the fusion comprises an unknown family, flagging the malware sample as a zero-day sample, the flagging causing an action to be performed on the malware sample.
- Claim 9Depends on #8
The computing device of claim 8, wherein the two malware samples and the benignware sample are all raw executables.
- Claim 10Depends on #8
The computing device of claim 8, wherein triplet loss is calculated based on L = ∑ i = 1 b [ f (x i a) - f (x i p) 2 2 - f (x i a) - f (x i n) 2 2 + α] + where, L is the loss, x a is the anchor sample, x p is the positive sample, x n is the negative sample, b is the length of a batch of triplet pairs, and a is a margin enforced between positive and negative pairs.
- Claim 11Depends on #8
The computing device of claim 8, wherein the computing device is further configured to use a gym environment to perform a second training, the second training comprising: creating a training set by: randomly choosing a plurality of first malware samples from a corpus of malware samples; fragmenting each of the plurality of first malware samples into a plurality of training byte strings, each of the plurality of training byte strings having a predetermined length; and organizing the plurality of training byte strings into the training set; creating a support set by: randomly choosing a plurality of second malware samples from a corpus of malware samples; fragmenting each of the plurality of second malware samples into a plurality of support byte strings, each of the plurality of support byte strings having a predetermined length; and organizing the plurality of support byte strings into the support set; choosing a batch of the training set; and using the support set and batch of the training set to update the embedding network by establishing a reward for batch matching for the entire batch of the training set.
- Claim 12Depends on #11
The computing device of claim 11, wherein the support set and batch of the training set are embedded using the embedding network.
- Claim 13Depends on #12
The computing device of claim 12, wherein the computing device is configured to establish the reward by performing a batch neighbor search for the batch of the training set.
- Claim 14Depends on #13
The computing device of claim 13, wherein the computing device is configured to establish the reward by further repeating batch neighbor search over the entire training set.
- Claim 15Independent Claim
A non-transitory computer readable medium for storing instruction code, which, when executed by a processor of a computing device, cause the computing device to: perform a first training on the embedding network, the first training comprising: randomly choosing two malware samples from a malware family; randomly choosing a benignware sample from a corpus of benignware; fragmenting each of the two malware samples and the benignware sample into byte strings of the predetermined length; creating triplet pairs of an anchor sample and positive sample from the byte strings from the two malware samples and a negative sample from the byte strings from the benignware sample; and training the embedding network for triplet loss based on the triplet pairs; fragment a malware sample into a plurality of byte strings, each of the plurality of byte strings having a predetermined length, the predetermined length being based on an input size of an embedding network trained on triplet pairs derived from malware and benignware to ensure a differentiation in byte string functionality; embed each of the plurality of byte strings in the embedding network to generate a plurality of embeddings; for each embedding in the plurality of embeddings, find a nearest neighbor; and set a predicted family for the malware sample based on a fusion of the nearest neighbor for each of the plurality of embeddings; wherein when the nearest neighbor for an embedding is outside a predetermined threshold, classifying the embedding as unknown; and wherein, when the fusion comprises an unknown family, flagging the malware sample as a zero-day sample, the flagging causing an action to be performed on the malware sample.
Technical Overview & Description
FIELD OF THE DISCLOSURE The present disclosure relates to malware similarity detection, and in particular relates to unknown (zero-day) family detection. BACKGROUND With rapid advances in Artificial Intelligence (AI) and Deep Learning (DL) in recent years, learned systems are being applied to aid humans in all aspects of life. Areas that require large amounts of data processing have seen greater success with applications of AI. One such application is cybersecurity. One area of cybersecurity is malware analysis. Malware is malicious code that may intend to cause harm to a computer system, for example by corrupting functions on a computer or operating system of the computer, or by stealing sensitive data from the computer system. Malware analysis is a process of determining the functionality, origin, and/or potential impact of a malware sample. In the cybersecurity task of malware analysis, governments and corporations must search through millions of files entering their network each year for malware. According to the AVTEST Institute, there were 70,687,826 new unique malware samples cataloged for Windows systems alone in 2022. Human investigation is impossible at this scale, and traditional signature-based methods can be evaded through packing and other obfuscation techniques. The task of malware analysis is not simply finding if a file has malicious intent or not. Challenges within the space of malware analysis are family detection, similarity analysis, and zero-day family detection. BRIEF DESCRIPTION OF THE DRAWINGS The present disclosure will be better understood with reference to the drawings, in which: FIG. 1 is a block diagram showing the sorting of malware samples into families and classifying unknown samples as a new family. FIG. 2 is a block diagram showing traditional family level similarity analysis. FIG. 3 is a block diagram showing the fragmenting of a sample and the aggregation of the results for similarity analysis. FIG. 4 is a block diagram showing t
Cited By — Indexed Forward Citations (0 of 0 total)
No indexed citing patents in this generation yet. Ingest USPTO/PatentsView bulk citation tables via patents-ingest to expand the local forward citation graph.
References Cited — Backward Prior Art (11)
| Patent | Title | Year | Citations |
|---|---|---|---|
| US 2025/0117483 A1 | METHOD AND SYSTEM FOR ZERO DAY MALWARE SIMILARITY DETECTION | — | 1 |
Non-Patent Literature (10)
- European Patent Office (EPO): Extended European Search Report (EESR) for Application No. 24202346.3, Date: Feb. 19, 2025, 8 pages.
- Marpaung et al.,
- “
- Survey on malware evasion techniques: state of the art and challenges
- ”
- , in 2012 14th International Conference on Advanced Communication Technology (ICACT), 2012, pp. 744-749.
- Mercaldo
- &
- Santone,
- “