Patent Description:
Malware can penetrate networks through a variety of ways (email phishing, a compromised external drive, an infected personal device, an IT misconfiguration, etc.), once it has gained entry the attack will typically evolve through the different stages of the cyber kill chain. It carries out early reconnaissance, creates a state of persistence, seeks access to the outside world through a Command & Control server, and then initiates a series of lateral movements (access to resources, propagation, privileges, etc.), until it reaches its final goal of data exfiltration, data destruction, or demand for ransom.

The document <NPL>, concerns a methodology for detection attacks on large-scale networks using detection by traffic anomaly, the NetFlow protocol and statistical techniques. The aim is to detect anomalies in certain traffic of network services (such as web, FTP, SSH, telnet, among others), using few computational resources and without disturbing the network traffic. The method comprises a collection and storage of data provided by NetFlow; a model to define the network traffic pattern; and a model for outliers detection.

The document <NPL>, discloses several anomaly detection methods, for example Anomaly detection using principal component analysis (PCA) and k-means, and Anomaly detection using PCA and extreme value analysis.

The document <CIT> describes the determination of upper and lower boundaries based on an interquartile range (IQR) associated with a reference network traffic information. The network analysis system may be arranged to update the upper and lower boundaries based on the most recent reference network traffic information. This reference network traffic information is then used in comparison with a threshold to detect anomaly outliers.

An object of the present invention is to provide a method which is able to find outliers with a minimum of false positives.

Another object of the present invention is to provide a method which is able to quickly find outliers.

These and other objectives of the present invention are substantially achieved by providing a method for detecting malware penetrating a network by identifying anomalous communication between at least two systems of the network, the method being carried out by a computer and for each unique combination of source IP address and destination IP address, comprising the following steps:.

The IQR means interquartile range and is a measure of statistical dispersion, being equal to the difference between 75th and 25th percentiles of a set of ordered data. If Q3 is the 75th percentile and Q1 is the 25th percentile, IQR = Q3 - Q1.

The method according to the invention can in particular be considered as remarkable as it applies during the lateral movements phase where a malicious attack generates specific types of network traffic and is therefore most vulnerable to detection using an algorithm according to the invention.

As the malware attempts to make connections to the various resources within the network towards its final goal, the general behavior of these network resources change. For example, a server which never tried connecting to another server, may initiate a connection under the influence of the malware. When such sudden deviations from the regular behavior happens, the method according to the invention is therefore able to identify such anomalies. Thus, hundreds of thousands flow packets are to be analyzed to identify such anomalous behavior.

Once identified, an investigation is made to determine if these anomalous connections made are indeed genuine based on current usage patterns. If this were not true, then it could represent a malware trying to make such connections in its intent to reach the critical assets.

The method according to the invention focuses on identifying anomalous communication patterns between two systems. The model achieves this by establishing a baseline of communication pattern based on past communication between two systems and comparing it against the current communication pattern between the same two systems. The anomalous communication identified in this manner can be either lower or higher than the baseline. The anomalies lower than the baseline can be ignored and the ones which exceed the baseline are the ones that are of interest in identifying a lateral movement attempt.

Advantageously, the present invention uses network flow logs to create a baseline for identifying anomalous network communication and lateral movement. Network flow logs capture the traffic information between various network interfaces in a network. Information captured in flow logs typically includes the source and destination IP addresses, the source and destination ports, the volume of data transmitted, TCP flags and timestamp.

According to an advantageously embodiment of the invention, once an anomalous communication is detected, the method can further comprise the step of determining a distance from the outlier threshold by calculating the difference between the IQR of current period and the outlier threshold.

The distance makes it possible to provide the analysts an idea of the deviation extent.

According to an embodiment of the invention, the past period can comprise past several days just before the current period. Preferably, the past period can comprise seven days just before the current period. Furthermore, the given frequency can be one day such that one value of the metric is calculated per day.

Thus, the method according to the present invention makes it possible to plot and track a pattern of usage for a configured time of seven days for example. The present invention compares the seven days of metrics with current metric. As an output, the method determines, if Source IP and Destination IP as a combination is above the cutoff threshold for the previous seven days. If the usage behavior pattern is different, then the method flags it off as an anomaly.

According to the invention, the current period can be the current day. It is also possible to envisage the current period as several hours of the current day.

According to an advantageously embodiment of the invention, the metric can comprise the total number of in_bytes data of the network flow logs. The in_bytes metric is the total number of bytes that have been paged in.

According to another advantageously embodiment of the invention, the metric can comprise the total number of flow records of the network flow logs.

According to another advantageously embodiment of the invention, the metric can comprise the total number of connections of the network flow logs.

Preferably, several metrics can be calculated, the anomalous communication is detected with respect to each metric. Accordingly, the sum(in_bytes), the sum(flow records) and the sum(connections) can be calculated separately, since each metric can give rise to an anomalous behaviour on its own.

According to an advantageously embodiment of the invention, the outlier threshold can be calculated as being greater than <NUM> times the baseline. Advantageously, the outlier threshold is determined as being equal to <NUM> times the baseline. With this ratio, it has been noted a minimum of false positive.

According to the invention, when the Source IP address of the considered combination is mapped to an actual user, the method further can comprise the step of determining a user from the detection of the anomalous communication.

If the Source IP is mapped to an actual user in the organization, then the user whose behavior has changed can also be determined.

According to another aspect of the invention, it is proposed a computer program comprising instructions which, when the program is executed by a processing unit, can cause the processing unit to carry out the steps of the method as described above.

The invention also concerns a non-transitory computer-readable storage medium encoded with computer-executable instructions which, when executed, perform the method as described above.

Further advantages and characteristics of the invention will become apparent on examining the detailed description of an embodiment, which is in no way limitative, and the attached drawings, in which:.

While the invention is susceptible to various modifications and alternative forms, specific embodiments thereof are shown by way of example in the drawings and will herein be described in detail. It should be understood, however, that the drawings and detailed description thereto are not intended to limit the invention to the particular form disclosed, but on the contrary, the intention is to cover all modifications, equivalents and alternatives falling within the scope of the present invention as defined by the appended claims. Hereinafter, the present invention will be described in detail by explaining exemplary embodiments of the invention with reference to the attached drawings.

In accordance with the preferred embodiment, the method and system according to the invention relate to the following materials and processes:
Embodiments herein include computer-implemented methods, tangible non-transitory computer-readable mediums, and systems. The computer-implemented methods may be executed, for example, by a processor that receives instructions from a non-transitory computer-readable storage medium. Similarly, a system described herein may include at least one processor and memory, and the memory may be a non-transitory computer-readable storage medium. As used herein, a non-transitory computer-readable storage medium refers to any type of physical memory on which information or data readable by a processor may be stored. Examples include random access memory (RAM), read-only memory (ROM), volatile memory, nonvolatile memory, hard drives, CD ROMs, DVDs, flash drives, disks, and any other known physical storage medium. Singular terms, such as "memory" and "computer-readable storage medium," may additionally refer to multiple structures, such a plurality of memories and/or computer-readable storage mediums. As referred to herein, a "memory" may comprise any type of computer-readable storage medium unless otherwise specified. A computer-readable storage medium may store instructions for execution by a processor, including instructions for causing the processor to perform steps or stages consistent with an embodiment herein. Additionally, one or more computer-readable storage mediums may be utilized in implementing a computer-implemented method. The term "computer-readable storage medium" should be understood to include tangible items and exclude carrier waves and transient signals.

<FIG> depicts a network comprising a local area network LAN <NUM> connecting several servers, among which server <NUM> and server <NUM>. Servers are able to communicate together via the LAN <NUM> and with different machines outside the LAN, for example via Internet <NUM>.

The exporter <NUM> is a router that collects IP network traffic between all interfaces of the network. The exporter <NUM> aggregates packets into flows and exports flow records towards a collector <NUM>. The collector <NUM> is able to receive and store the flows data. The method according to the invention is implemented inside the collector <NUM> to analyze the received flow data.

The collector <NUM> is a server, a computer, a processing unit or any single machine or group of machines comprising hardware and software components such as for example a central processing unit (CPU), memory coupled to the CPU; and a computer readable storage medium coupled to the CPU; the storage medium containing instructions that are executed by the CPU via the memory to implement the method according to the invention.

The present invention aims to analyze the traffic during the lateral movements phase in order to detect anomalous behavior of the systems. Indeed, a malware attack generates abnormal traffic. The present invention uses a method which is particularly applied during the lateral movements.

The method according to the invention is able to identify anomalous network communication between server <NUM> and server <NUM> by analyzing the network flow logs. The aim is to define a baseline based on a study of previous flow logs. A comparison is then realized between current flow logs and the baseline. In other words, the method according to the invention is able to establish a baseline of communication pattern based on past communication between server <NUM> and server <NUM> and compare it against the current communication pattern between the same two servers. The anomalous communication identified in this manner can be either be lower or higher than the baseline. The anomalies lower than the baseline can be ignored and the ones which exceed the baseline are the ones that are of interest in identifying a lateral movement attempt.

Flow logs capture the traffic information between server <NUM> and server <NUM>. Information captured in flow logs typically includes the source and destination IP addresses, the source and destination ports, the volume of data transmitted, TCP flags and timestamp.

For example, the invention can be implemented with the aid of the toolNetFlow of Cisco®, Jflow of Juniper, Qflow of Qradar, AWS VPC Flow logs, Azure NSG Flow logs or any other similar tools.

A flow is a sequence of packets that all share following values which define a unique key for the flow:.

<FIG> is a schematic view of different steps of the method according to the invention.

The method is intended to analyze data of the network flow logs concerning the communication between server <NUM> and server <NUM>.

The baseline computation can run at any periodicity for the purpose of training method. Preferably, the baseline computation is run every day. When the baseline computation runs, it considers the logs stored in the system for the past "X" days. This "X" is a configurable parameter. Preferably, the computation runs every day during the last seven days. It is also possible to consider a period of more than seven days, for example thirty days or between seven and thirty.

On step <NUM>, the collector <NUM> fetches the unique combination of Source IPs and Destination IPs from the current days NetFlow logs. In the present case, the combination is the server <NUM> and server <NUM>. All data collected constitute a metadata.

For each combination record, a test is realized if mandatory values are missing at step <NUM>. If yes, the current logs are rejected and next logs are considered for a new step <NUM>. If no, the step <NUM> concerns a calculation of several metrics such as total number of in_bytes data, total number of flow_records and total number of connections for each day of the period of seven days for each unique combination of source and destination IP addresses.

Particularly, following metrics are determined for the Source IP, for example server <NUM>, and the destination IP, for example server <NUM>:.

For each day during the past seven days, a sum(in_bytes) is calculated, a sum(flow_records) is calculated, and a count(*) is calculated.

At step <NUM>, the baseline is calculated for the combination server <NUM> with server <NUM> from all sum(in_bytes), sum(flow_records) and count(*) calculated during the past period. The baseline for anomaly detection is a threshold which is calculated as being the IQR (InterQuartile Range) of the metrics calculated for the combination of server <NUM> with server <NUM>. The calculation of IQR is define in accordance with <FIG>.

On <FIG>, at step <NUM>, an outlier threshold is calculated for the combination of server <NUM> with server <NUM> as follows:
Outlier threshold > <NUM> * baseline. Other values different from <NUM> can be used. <NUM> is the optimal value according to the invention as it reduces false positives.

Step <NUM> concerns the anomaly detection by comparing a new <NUM>*IQR calculated from data of a current period. The current period to consider is for example a day directly after the seven day. It is possible to consider only some hours as current period. At step <NUM>, the new <NUM>*IQR is calculated based on current sum(in_bytes), current sum(flow_records) and current sum(connections) for the combination of server <NUM> with server <NUM>. The IQR is calculated for each of the in_bytes, flow_records and connections. There are three comparisons. There is a check if the current day in_bytes/flow_records/total_connections is higher than the calculated outlier threshold.

In other words, once the baseline is generated, the anomaly detection can run at any frequency. Preferably, the anomaly detection is run daily. During each run, metadata is generated for the data pertaining to the current day. A comparison is done between the last computed baseline and the current day's volume. If the current day's volume is <NUM> times higher than the baselined for the IP addresses combination, then this is considered as an anomaly communication.

Once the anomalies are detected, it is also calculated at step <NUM> a "Distance from the Threshold" as information for the threat hunter to determine the extent of the anomaly. This distance is calculated as the difference between the outlier threshold and the new <NUM>*IQR calculated for the current period.

At step <NUM>, the instance is updated as an outlier.

At step <NUM>, there is a check if any more current day logs are to be processed. If yes, a next record is called at step <NUM> to be analyzed. If no, this is the end at step <NUM>.

Back to the step <NUM>, if the check is negative, the log is updated to "Nofinding" at step <NUM>, then the step <NUM> is carried out.

<FIG> illustrate the calculation of the IQR according to the invention.

To determine the baseline from the historical communication patterns, the method according to the invention uses Interquartile Range (IQR). IQR is used for determining the distribution range of a dataset. In the present case, as part of the baselining, it is intended to determine if the values are spread out or not. This will effectively describe how consistent or inconsistent the communication patterns are and what are the medians and extremes of these patterns.

The IQR describes the middle <NUM>% of values when ordered from lowest to highest. To find the Interquartile Range (IQR), the median of the lower and upper half of the data is first found. These values are Quartile <NUM> (Q1) and Quartile <NUM> (Q3). The IQR is the difference between Q3 and Q1.

The formula of calculating IQR for <NUM> days can be as follows: <MAT> where.

The table of <FIG> provides some sample values and how the IQR is calculated.

As described above, IQR gives the spread/distribution of data. Since communication anomalies due to sudden increase in activity are sought, the values which are in the Quadrant <NUM> or lower can be ignored and a focus can be done on the ones that are greater than Quadrant <NUM> (Q3).

Values only slightly greater than Q3 might not be significant enough to be considered as an anomaly. To reduce the count of false-positives and identify significant threats, it was decided to look for values greater than a factor of IQR. According to the invention, a factor of <NUM> times the IQR gives optimal results, i.e., it reduces false positives without creating a risk of false negatives.

<FIG> illustrates an example for packet based volumetric Anomaly. The example assumes a past period of <NUM> days. The day wise packets received in bytes are shown. This packet flow is between two IP Addresses, server <NUM> and server <NUM>. In the example, the metric calculated is sum(in_bytes). This metric is calculated each day during the seven days. Based on these day wise numbers, the baseline concerning the sum(in_bytes) is determined by calculating the IQR. Then the Outlier Threshold is calculated as <NUM>*IQR. The bytes received from the same set of IP Addresses for Day <NUM> (current day) is also shown. If this is greater than Outlier Threshold, the method flags it as an outlier.

The table also shows the distance from the Outlier Threshold to provide an idea of the deviation extent.

Claim 1:
Method for detecting malware penetrating a network by identifying anomalous communication between at least two systems of the network, the method being carried out by a computer and for each unique combination of source IP address and destination IP address, comprising the following steps:
- considering a past period,
- considering the network flow logs stored during said past period,
- calculating values of a metric based on data of the network flow logs within the past period and at a given frequency,
- calculating a baseline which consists in calculating an IQR, interquartile range, of all metric values calculated during the past period,
- determining an outlier threshold from the baseline,
- considering a current period,
- considering the network flow logs stored during said current period,
- calculating values of the metric based on data of the network flow logs within the current period,
- calculating an IQR of all metric values calculated during the current period,
- classifying the communication between the two systems of the unique combination as an anomalous communication if the IQR of the current period is greater than the outlier threshold.