1. Introduction
Nowadays, the daily life of human being is significantly affected by computers and informatic systems, making cybersecurity one of the main concerns to be addressed by government agencies and companies to protect users from diverse threats arising from Internet use. Such threats are mainly provoked by malware, i.e., a malicious software designed to perform some unauthorized, often harmful or undesirable acts. Computer viruses, trojan horses, worms, and ransomware are examples of malware [
1,
2,
3,
4].
According to Cohen [
5], who is considered the pioneer researcher in computer viruses, a virus is a program that is able to infect other programs by modifying them to include a possibly evolved copy of itself. Cohen wrote the first program of this type which is currently known as the Stoned boot virus. Another example of a computer virus is Stuxnet [
6] considered the first cyber-warfare weapon ever.
Perhaps the simplest kind of malware is a Trojan horse which tries to appeal to and interest the user with some useful functionality to entice the user to run the program. In particular, they have been used to steal passwords. Rootkits, AIDS TROJAN DISK, Qbot (malware specialized in stealing user data) and TrickBot (malware focused on stealing financial data) are examples of Trojan horses.
Worms are also examples of malware. They are network viruses, primarily replicating on networks. Usually, these programs execute themselves automatically on a remote machine with minimal user intervention. Particularly, worms do not require a host program. SQL Slammer, Melissa (which is a macrovirus), Morris, as well as Netbus, Subseven, Deep Throat, Back Orifice and Concept, are some of the most known worms [
1].
Ransomware is a kind of malware which encrypts data on a computer to prevent users from accessing their computer files or systems. Cybercriminals hold the data until a ransom is paid. It is worth pointing out that the FBI has observed that one of the most frequent attacks carried out over the last few years by cybercriminals is realized via some ransomware. Wannacry, LockBit, Cryptolocker, Sodinokibi/REvil, and Phobos are examples of this type of attack. According to Ploszek et al. [
7], crypto Ransomware is the most dangerous among the different Ransomware attacks. These attacks allow the encryption of images, videos and any valuable user files.
At the beginning of the antivirus industry, malware detection was based on heuristic features that identified particular malware by creating a reliable fingerprint. During the detection, an antiviral engine checked the presence of the malware fingerprint in a file against known malware fingerprints stored in the antivirus database. String Scanning, Wildcards and Mismatches are examples of the first virus detection programs. Wildcards were used to detect the metamorphic virus w32/Regswap. These techniques allowed finding the sequence 83EB 0274 1683 EBOE 74OA 81EB 0301 0000 which identifies the w32/Beast virus [
1].
Fingerprints associated with infected files were sensitive to small changes in files. Furthermore, malware writers invented metamorphic and polymorphic viruses, which give rise to hundreds of thousands of new virus versions, making the previous detection approaches ineffective. In this line, malware detection systems have been developed based on traditional machine learning (support vector machines, decision trees, naive Bayes classifier, etc.) and deep learning algorithms based on recurrent neural networks (RNNs) [
8,
9].
It is worth pointing out that several authors need to be more convinced of the RNN’s effectiveness for intrusion detection due to their vulnerability against adversarial attacks. These authors have preferred the use of images and to train convolutional neural networks to learn feature malware [
10,
11,
12]. Another advancement in dealing with the use of machine learning in NIDS was proposed by Iglesias and Criado [
13], who used time series, visibility graphs and multiplex networks to analyze the behavior of attackers’ computers. They pointed out that tools such as Snort used to analyze network traffic and protocol have disadvantages (e.g., no zero-day attacks detection [
14]) to network intrusion detection.
Kaspersky [
15] developed detection malware tools based on machine learning techniques. In such a case, hash functions, and unsupervised learning confluent to extract file features that can be computed quickly and directly retrieved from the structure of the executable, like a file format description. Authors refer to [
16,
17] for good surveys regarding recent trends of the deep learning use for malware detection, in particular, for descriptions of cloud-based malware detection, mobile-device-based malware detection, and IoT-based malware detection.
1.1. Motivations
Currently, there needs to be more malware investigations dealing with its relation to the theory of representation of algebras. A comprehensive algebraic study of malware insertion detection will give rise to a better understanding of different cyber-attacks; works in this direction have been proposed by Webster [
18]. This paper proves that attacks of type Linux/Slapper or Scalper and some other metamorphic attacks in confluence with detection techniques as those presented by Kaspersky based on machine learning methods give rise to categories of representations of partially ordered sets. In particular, obfuscation techniques associated with metamorphic attacks define categorical equivalences between these categories.
1.2. Contributions
The main results of this paper are Theorems 2–4, and Corollary 1. Theorems 2 and 3 prove that some malware insertion-detection algorithms associated with some hierarchical attacks define particular families of partially ordered sets (posets).
Corollary 1 proves that posets introduced in Theorem 3 define hierarchical attacks without hidden malware.
Theorem 4 proves that malware insertion-detection algorithms give rise to categorical equivalences between categories of representations of posets.
This paper is structured as follows; Main definitions and notation are given in
Section 2, we present an overview of definitions and notation regarding malware (
Section 2.1) and posets (
Section 2.2). We present the main results in
Section 3.
Section 4 gives an example of the results obtained in
Section 3. Concluding remarks are given in
Section 5.
2. Preliminaries
This section is devoted to revising basic definitions and notation regarding malware insertion and detection, as well as, partially ordered sets and their
-linear representations [
1,
2,
3,
4,
19,
20,
21,
22].
2.1. Malware
As explained in the introduction, malware is malicious software designed to perform some unauthorized, often harmful or undesirable acts [
1]. The development of malware research has encouraged the introduction of sophisticated infection-detection malware techniques. Recently discovered computer viruses and worms such as Stuxnet [
6] and its variations are examples of the research progress on the subject.
2.1.1. Computer Viruses
The typical structure of a computer virus consists of the following three subroutines [
1]:
Infect-executable. This routine finds available executable files to infect them by copying its code.
Do-damage or Payload. This is responsible for delivering the malicious part of the virus.
Trigger-Pulled. Determines whether all the conditions required to deliver the payload are satisfied.
In the earlier stages of the antivirus industry, malware detection on computers had as a main goal to create a reliable fingerprint of a malicious file via its heuristic features. For instance,
The obtained fingerprint is compared with those stored in an antivirus database. However, malware writers introduced new versions of code virus for which the fingerprint approach is inefficient. Currently, computer viruses include decryptors to hide their functionality, encryption keys can be generated in different ways, such as constant, random but fixed, sliding, and shifting, often the encryption is carried out by applying an xor operation (e.g., W95/Memorial virus). However, other encryption techniques dealing with symmetry key cryptography (e.g., the IDEA family of viruses) and public-key cryptography have been used to encrypt viruses. Polymorphic and metamorphic computer viruses are examples of the use of decryptors.
Polymorphic viruses can mutate their decryptors to a high number of different instances that can take millions of different forms. The 1260 virus is an example of a polymorphic virus, it includes two sliding keys to decrypt its body and some junk instructions, which are nothing but garbage in the code [
1].
Metamorphic viruses create new virus generations that look different. They have one single-code body that carries data as code.
Formally speaking a metamorphic virus can be defined as follows [
4]:
Let
be a function computed by a computer program
P. Then a pair
v and
of recursive functions are said to be a metamorphic virus if it satisfies the following identities:
and
where
is a running environment consisting of data
d and programs
p stored on computers.
,
, and
are recursive functions. Whereas,
is called the
injury condition and
,
are called
infection conditions.
The difference between polymorphic and metamorphic viruses is that each form of a polymorphic virus has the same kernel and forms associated with metamorphic viruses have their own kernel.
As an example, the following are two generations of the metamorphic virus W95/Regswap:
- 1.
5A pop edx 58 pop, eax
- 2.
BF04000000 mov edi, 0004h BB04000000 mov ebx, 0004h
- 3.
8BF5 mov esi, ebp 8BD5 mov edx, ebp
- 4.
B80C000000 mov eax, 000Ch BF0C000000 mov edi, 000Ch
- 5.
81C288000000 mov add, edx, 0088h 81C088000000 mov add, eax, 0088h
- 6.
8B1A mov ebx, [edx] 8B30 mov esi, [eax]
- 7.
899C8618110000 mov [] 89B4BA18110000 mov []
- 8.
esi+eax*4+00001118, ebx edx+edi*4+00001118, esi.
Figure 1 shows examples of different generations produced by metamorphic viruses.
Konstantinou [
4] implemented a Hidden Markov Method to detect metamorphic attacks. He implemented (via a virus construction kit) code obfuscation techniques, like instruction reordering and garbage insertion, to produce the metamorphic versions of a virus. We remind the readers that, instruction substitution, instruction permutation, garbage code, variable substitution, and altering control flow are examples of obfuscation techniques. They have been used by viruses and worms as Evol (2000), Zmist, Zperm, Regswap, and Methaphor [
1,
2,
3,
4].
Some computer worms like Linux/Scalper develop so-called hierarchical attacks to control remote networks. In such a case, each infected node receives crucial information, such as the IP address of the adversary host and the addresses of the infected nodes. This type of information is provided to the remaining nodes until all target network nodes are infected.
Classical approaches to detect malware based on its fingerprint became ineffective due to its vulnerability to zero-day attacks. Recently, Kaspersky [
15] implemented machine learning methods to detect packed routines. Their method consists of analyzing file features resistant to small changes. According to this approach, the machine learns suitable hash values
associated with scanned files, and a similarity function is defined to determine whether or not two of these files are similar.
Similar files constitute a so-called hash bucket. These hash buckets classify the scanned files into two regions, named simple regions or hard regions. Files in simple regions of a hash bucket are either pure benign or pure malware, and no further feature analysis is required. Similarity pairs in these regions are of the form or . In hard regions of a hash bucket, the files can be benign and malware, and deep feature analysis is developed for more precise detection. Similarity pairs in hard regions are of the form .
Suppose the infection builds a hierarchical network, as in the case of a scalper attack. Each node contains benign and malware files in simple and hard regions. If vectors consisting of bits are used to denote such files, then a fixed node
has a structure
of the form.
where
(
) denote the set of simple (hard) files contained in
. It is assumed that all the files have the same size.
Figure 2 shows the entries of the matrix
of the node
, where
,
and
are matrix blocks of suitable size associated with files
and
(see identities (
1)). In this case, we add as many zeroes as possible to satisfy restrictions related to the inclusion of garbage instructions and size of the files. We also assume the notation
for each pair of the form
.
Obfuscation techniques as xor and row and column permutations can be applied to the elements of the node to obtain new versions of the detected viruses.
A node in a hierarchical attack is said to be strong (weak) if its files belong to a simple (hard) region. Files in a strong node are either of pure benign type or pure malware type. We let ⊙ (⊖) denote a strong () node in a hierarchical attack.
Henceforth, we will assume that nodes associated with a hierarchical attack have the structure given by the matrix shown in
Figure 2.
2.1.2. Using Information Theory to Detect and Insert Malware
As we have seen in previous sections, polymorphisms make infeasible static detection of viruses. We remind the reader that there are two kinds of polymorphisms (those obtained by data encryption and those obtained by data compressing). Machine learning methods have been developed to detect different file features such as
N-grams, statistical features, and entropy. Particularly, entropy features are based on the entropy computation of the file or some of its areas. Bearing in mind that benign files tend to have low entropy values, whereas obfuscated or packed files tend to have high entropy values [
23].
Lyda and Hamrock [
24] introduced the idea of using entropy (over the entire file) to classify packed malware. It is worth noting that nowadays, distinguishing between packed and non-packed executable files is a strong line of investigation for malware analysts. For instance, Mantovani et al. [
23] implemented a machine-learning classifier based on the union of features to identify different forms of packing. Lee et al. [
25] used machine learning to recover original files from backup system files (infected with ransomware) via entropy techniques. Perdisci et al. [
26] proposed studying specific packer features in the portable executable file format. Whereas, Ugarte-Pedrero et al. [
27] suggested that entropy is the main feature of detecting packed files. They used the Zeus botnet, one of the first bot families to adopt low entropy packing schemes.
Raphel et al. [
28] used entropy to recognize polymorphic samples which use xor-based encoders. Their approach is based on five steps (extraction of files or appropriated file fragments, computation and concatenation of such fragments, computation of the entropy for concatenated fragments and construction of a suitable similarity distance matrix).
We also recall that Lim et al. [
29] proposed to analyze the different files as vectors or streams of bytes to analyze some statistical features.
Entropy has also been used as a helpful feature to insert malicious files. In such a case, the analyst splits a target file into shares or chunks to insert a low entropy pattern of bytes between each share; then, the malicious file is reconstructed in memory to bypass the action of high entropy file detectors. Menéndez et al. [
30,
31] used the entropy-based tools EnTS and EEE to detect and conceal malicious files into executables. They also used VirusTotal to reproduce the behavior of some anti-virus engines. Detect It Easy (DIE), PEiD, PackerID, NFD, ExeScan, and Manalyze are popular tools to analyze malware. In particular, DIE and PEiD have a component for entropy analysis [
23,
32].
Nowadays, an interesting problem in cryptography is proving the leakage resilience of cryptographic implementations. Side-channel attacks (SCA) may be one of these implementations’ most significant threats [
33]. In this kind of attack, a secret key implemented in a device (e.g., a smart card) is retrieved by analyzing the side channel signals obtained from its physical implementation. Low entropy masking schemes (LEMS) have been introduced to guarantee high security against SCA attacks with less randomness than traditional masking schemes. Analysis of these types of schemes has been implemented by Li et al. [
34], who studied leakage characteristics of multiplicative LEMS. Whereas Zhang et al. [
35] trained deep learning assisted with a new metric to improve SCA attacks. Security of LEMS has also been studied by Grosso et al. [
36], Ye et al. [
37], and Zhang et al. [
38].
Network security and channel capacity have been studied by Hua et al. [
39], Adesso et al. [
40], And Yilmaz et al. [
41], who introduced a method to estimate the maximum amount of information leakage by some signals generated by the execution of some instructions in a processor.
2.2. Partially Ordered Sets and Their Representations
A partially ordered set or poset is a pair , where is a possibly empty set endowed with a relation ≤, which is
Reflexive, i.e., , for any ,
Antisymmetric, i.e., and implies , for any .
Transitive, i.e., and implies , for any .
Henceforth, if there is no confusion, we will write instead of the pair to denote a poset.
Often, finite posets are described by their Hasse diagram, which is a system of sets with the form , where r is a fixed positive real number (small enough) and for each point , it is defined a unique point and a unique circle with center and radius r.
The set consists of non-horizontal lines connecting circles of , according to the following rule:
A line l connects two circles c and with centers and associated with points p and in if and only if p and is a covering (i.e., if there is such that then or ).
As an example,
Figure 3 shows a Hasse diagram of a finite partially ordered set
such that
,
,
,
, and
.
A poset is said to be a chain if for pair of points , it holds that or (i.e., any pair of points in a chain are comparable). A poset is an antichain if its points are incomparable.
The width of a poset is the size of its largest antichain (e.g., the width of a chain is 1).
If
R is a commutative ring and
is a finite poset then a
-subspace U is a system of modules with the form
where
is an
R-module,
is a submodule of
for any
, and
If
R is a field then a
-subspace is said to be an
R-linear representation (or
representation) of the poset
[
19,
20,
21,
22].
If
and
are representations of a poset
then their sum
is a representation given by the following identity.
The representation 0 has 0 as ground vector space. Furthermore, a representation U is said to be indecomposable if whenever then either or . Otherwise, U is said to be decomposable.
A morphism between two representations and is an R-linear map such that . is an isomorphism if , for any .
The composition of morphisms between representations is given by the usual composition of R-linear morphisms. The identity morphism associated with a representation U is denoted such that if is a morphism then .
We let denote the category of representations of a poset , which is a Krull-Schmidt category.
denotes the dimension of a representation
U of a poset
. It is an integral vector of the form
where
is the dimension
of the vector space
as vector space. Whereas,
, for any
.
One of the problems regarding the theory of representation of posets consists of giving a complete description of the indecomposable representations of the categories defined by finite posets .
Up-to-date, the algorithms of differentiation have been the main tool to classify posets, the algorithm of differentiation with respect to a maximal point introduced by Nazarova and Roiter and the algorithm of differentiation with respect to a suitable pair of points are the most remarkable algorithms to reach such a classification. They are functors with the main goal of reducing the dimension of the posets involved in the classification process.
The following is the definition of the algorithm of differentiation with respect to a suitable pair of points also known as
or
[
19]: Let
a and
b be two points in a finite poset
then the pair
is said to be
suitable for
, if
can be written as a sum of the form
where
is an
n-point chain (
).
The derived poset
is a subset of the modular lattice generated by
such that
where
and
are
n-point chains such that
, and
.
for all
,
. Points in
inherit the relations given by
. In particular, relations between these points and points
and
are given by the relations between them and points
.
Figure 4 shows Hasse diagrams of a poset
with a suitable pair of points and its corresponding derived poset.
Differentiation
or
is defined by the following identities for a representation
:
The following theorem is the main result regarding . For each i, , is an indecomposable representation for which, is a field. is a field, for any . It is zero for the remaining points in the poset.
Theorem 1 (Theorem 5.6, [
19])
. The two-point differentiation with completion functor induces a categorical equivalence between quotient categorieswhere () is the ideal consisting of morphisms which pass through direct sums of objects (). The Matrix Problem
The indecomposable representations of a poset can be obtained as solutions of a matrix problem. To do that, we note that each representation of gives rise to a matrix (a matrix representation) whose columns are partitioned into strips labeled by the points of the poset. Columns contained in the strip associated consists of coordinates with respect to a fixed basis of of generators of the subspace . In this case, if is the set of columns in the strip then .
If M and are matrix representations of a poset with then the direct sum of M and is given by the formula
Two representations M and are said to be equivalent if one can be obtained from the other using the following admissible transformations:
Elementary transformations of rows of the whole matrix.
Elementary column transformations of the columns within each vertical strip.
Addition of columns of a strip .
Equivalent matrices give rise to isomorphic representations of the associated poset.
3. Main Results
We remind readers that an equipped poset
is a poset whose points define a partition of the form
. If
(
) then
x is said to be a
strong point (
weak point). Relations
R in equipped posets are partitioned into two sets
, if a pair
(
) then we write
(
). In such a case if
, i.e.,
and
, i.e.,
then
. Also, if
then
[
20,
22].
We assume that the hierarchical attack (see
Figure 2) model satisfies the following additional condition:
- 1.
All the files associated with the malware infecting a network belong to an isolated strong node denoted M.
- 2.
Each infected node x is encoded by finite sets of -vector columns, . Columns in encode either benign files or malware. Columns in encode hidden malware in hard regions.
- 3.
The files in the malware node M are distributed among a fixed set of weak nodes , where denotes the initial stage of the infection (hidden malware associated with hard regions are contained in ). , for any .
- 4.
If a node P in the attacked network is infected by a node for some then it holds that , where P is encoded by . Particularly, if P is also infected by a weak node , it holds that either or .
The following result proves that a hierarchical attack structured by matrices
(
Figure 2) defines an equipped poset.
Theorem 2. A hierarchical attack defined by a strong node M as defined above and weak nodes with the structure given by a matrix (see Figure 2) and conditions (1)–(4) defines an equipped poset. Proof. We note that nodes in the infected network are the points in the equipped poset
. Strong nodes correspond to strong points, and weak nodes correspond to weak points in
. The stages of the infection start in
, continue to
and so on. Since, for any pair of weak nodes
and
,
it holds that
with
then
and
are weakly related. Moreover,
constitute a weak chain, in the sense that its points and relations between them are weak, we write
. Condition (3) proves that relations between weak points
and another point in
are either weak or strong. Whereas, relations between
and points
are strong. Finally, we note that by definition the strong point
M is incomparable with the other points of the poset
. Therefore,
can be written as a sum with the form
. Where
.
Figure 5 shows an example of an equipped poset induced by a hierarchical attack. Double (single) lines denote strong (weak) relations. In this case, N represents an arbitrary set of infected nodes related to the weak chain
. □
If is a node infected by a hierarchical attack with files of type , for suitable indexes , then is said to be the hull of , we let denote the hull of the node . Note that, . if and only if is strong.
denotes the strong subspace of the subspace . In such a case, .
According to the definition of a hierarchical attack and its properties (1)–(4). We note that hidden malware associated with hard regions can be pinpointed by xoring files in with files in weak nodes . In such a case, it is built the span sum , .
The detection procedure determines the matrix
shown in
Figure 6, labeled above by the infected nodes (
,
M and
N) of a network. The bottom part (under the bold line) is labeled by corresponding symbols
. Such symbols denote subspaces spanned by columns whose entries are elements over
. We let
denote the subspace associated with a point
x.
, (these columns are denoted with the symbol ∗), these subspaces encode pure malware (and weak relations) associated with nodes . , . Columns associated with symbols encode hidden malware pinpointed by the detection process. Such malware can be inserted into the node by adding some garbage entries denoted in the matrix . Relations between subspaces associated with points keep without changes their relations with the other points of .
Relations between the infected files allow us to give the next result.
Theorem 3. The insertion-detection matrix constitute an equipped poset . Where, and are chains, M and N and their relations are defined as for the poset .
Proof. By definition, point
is a strong point. Furthermore, since files associated with the nodes
constitute malware satisfying the condition
,
, then points
,
constitute a weak chain. In particular,
, for any
j. The same argument for subspaces
allow us to infer that
. Since
,
, it holds that
. Moreover,
, for any
,
. Since relations between points
,
and points in subset
are inherited by the relations that these points have with points
. The following
Figure 7 shows the poset
defined by the insertion-detection matrix
. □
Corollary 1. The hierarchical attack defined by an equipped poset of type has no hidden malware.
Proof. The malware used in this type of attack is encoded by subspaces and which are induced by simple regions. □
In a more general setting, we can define a functor
induced by a hierarchical attack defined by an equipped poset of type
and its associated detection algorithm defined by a corresponding equipped poset
. The following
Figure 8 shows the poset
and its detector
.
If we replace the field for the real numbers field and for the complex numbers field. Then -column transformations between rows and columns of the matrices induced by the linear structure of posets and give rise to categories of representations of the equipped posets and . In such a case, a representation U of an equipped poset is a system of -subspaces of the form , with () provided that ().
A morphism between two representations U and V of an equipped poset is a -linear transformation such that . Note that, , for any pair of appropriated vectors. is an isomorphism if and only if for any .
Each representation U over the pair of fields of an equipped poset can be represented by a matrix with entries over separated into vertical strips labeled by the points of . Columns in are generators of .
The matrix problem associated with an equipped poset is defined as follows:
Two matrix representations of an equipped poset are said to be equivalent, if one can be obtained from the other via the following admissible transformations:
Elementary transformations over of rows of whole matrix.
Elementary column transformations over within each vertical strip.
Additions of columns of a strip to the columns of if .
Independent additions of the real and imaginary part of the columns of a strip to the real and imaginary parts of a strip if .
Note that, if is a weak chain then ⌀, , , , and , are its only indecomposable representations, where
, , , , , if .
.
, , , , , if .
, , , , , if . , if .
Theorem 4. The insertion-detection matrix defined over the pair of fields associated with the equipped posets and induces the functor such that for it holds that Moreover, is a categorical equivalence between the quotient categories and . Where, for fixed , is the ideal of consisting of morphisms that pass through direct sums of the indecomposable objects , , and , i.e., . The ideal is defined in the same fashion, i.e., .
Proof. Firstly, we note that is an additive functor provided that for all morphisms and , it holds that, , for any , , and for any , is a -vector space by definition.
Note that, for fixed
, it holds that,
and
. Moreover, if
denotes the morphism-subspace of
whose elements satisfy the condition
Then it is easy to see that for fixed
, and a morphism
it holds that
Thus, any linear morphism is an isomorphism.
The density of the functor follows from the same ideas used to carry out a hierarchical attack to the network defined by the equipped poset . In such a case, we consider that , where is complementary subspace, . For these vectors we define corresponding vectors .
We note that for each
i,
. Any subspace
of the poset
can be written in the form
where
denotes an appropriated complementary subspace. Note that,
(corresponds to hidden malware) and
(corresponds to pure malware).
Let be a fixed basis then it is possible to define vectors of the form , for some suitable vectors .
Let
and
a basis of the subspace
then the representation
such that
is such that
. We are done. □