Patent Description:
In computer networking, a communication port is a logical communication endpoint on the network that, from a software standpoint, identifies a specific resource (e.g., a process or a type of service) executing on a given computer in the network. Communication ports (also referred to herein simply as ports or port numbers) are typically defined by a communications protocol. For example, ports are one of the Layer <NUM> (i.e., the Transport Layer) protocols in the Open Systems Interconnection (OSI) model, and are used to define network sessions in client-server application architectures.

Ports provide a multiplexing service for multiple services or multiple communication sessions at one network address. In operation, ports are part of the addressing information used to identify sources and destinations of messages transmitted over a network. Additionally, each "open" port is typically associated with a specific service such as have a service that is connected to them such as a database service, an email service or a communication service.

Network port scanning is a method for determining which ports on a network are open. Running a port scan on a network or server reveals which ports are open and configured to receive and/or send information. Network professionals can use port scanning tools to measure their exposure to attackers and to monitor devices and services. Hackers, on the other hand, scan ports to probe networks for open ports that may be exploitable and to map which services run on each device. For example, a hacker can send a message to multiple ports, and analyze the responses from each given port in order to determine if the port is being used, and if so, what service is using the given port.

<CIT> discloses a method and an apparatus for detecting a port scan in a network. <CIT> discloses a system for detecting network intrusions and other conditions in a network. The article entitled "<NPL>, discloses a comparison of port scan methods based on type, mode of detection, mechanism used for detection and other characteristics, and reports on the available data sets and evaluation criteria for port scan detection approaches.

The description above is presented as a general overview of related art in this field and should not be construed as an admission that any of the information it contains constitutes prior art against the present patent application.

The present invention is defined by the appending independent claims. Features of various embodiments are set out in the appending dependent claims.

There is disclosed herein a method including identifying, in data traffic transmitted between multiple nodes that communicate over a network, a set of pairs of source and destination nodes, each pair consisting of a given source node and a given destination node, and one or more communication ports on the given destination node in each pair that are accessed by the data traffic from the given source node, computing, for each pair in the set, a respective baseline level that is indicative of an average of a first number of the communication ports that source nodes other than the given source node in the pair accessed on the given destination node during a first time period, computing, for each pair in the set, a respective test score that is indicative of a difference between a second number of the communication ports that the given source node in the pair accessed on the given destination node during a second time period and the baseline level, and initiating a preventive action with respect to the given source node in any of the pairs for which the test score is greater than a specified level.

In some examples, identifying the pairs of source and destination nodes includes collecting, from a probe, data packets transmitted over the network, aggregating the collected data packets into communication sessions between a given source node and a given destination node, and identifying, in each the aggregated communication sessions, the given source node accessing at least one given communication port on the given destination node. The method also includes identifying one or more noisy scanners, each of the noisy scanners including a given source node that accesses at least a specified first number of destination ports on at least a second specified number of destination nodes. Computing the baseline level for a given pair includes computing a revised first number of the protocol ports that source nodes other than the given source node in the pair and other than any of the identified noisy scanners accessed on the given destination node during the first time period;.

In further examples, the specified level includes a first specified level, initiating the preventive action includes initiating a first preventive action, and the method also includes identifying any failed connections in the port scans during the second time period, and initiating a second preventive action with respect to the given source node in any of the pairs having at least one of the identified failed connections and for which the test score is greater than a second specified level lower than the first specified level.

In one example, the second time period is subsequent to the first time period. In another example, the first and the second time periods have substantially identical time durations. In supplemental examples, the first time period includes multiple sub-periods, and computing the test score for a given pair includes computing separate baseline levels for each of the sub-periods, computing an average of the separate baseline levels, and subtracting the computed average from the second number of the communication ports. In some examples, the second time period and each of the sub-periods have substantially identical time durations.

In additional examples, initiating the preventive action includes generating an alert for the given source node. In further examples, initiating the preventive action includes restricting access of the given source node to the network.

There is also disclosed herein an apparatus including a network interface device coupled to a data network including multiple nodes that communicate via the network, and at least one processor configured to identify, in data traffic transmitted between the multiple nodes over the network, a set of pairs of source and destination nodes, each pair consisting of a given source node and a given destination node, and one or more communication on the given destination node in each pair that are accessed by the data traffic from the given source node, to identify one or more noisy scanners, each of the noisy scanners comprising a given source node that accesses at least a specifid first number of destination ports on at least a second specified number of destination nodes, to compute, for each pair in the set, a respective baseline level that is indicative of an average of a first number of the communication ports that source nodes other than the given source node and other than any of the identified noisy scanners in the pair accessed on the given destination node during a first time period, to compute, for each pair in the set, a respective test score that is indicative of a difference between a second number of the communication ports that the given source node in the pair accessed on the given destination node during a second time period and the baseline level, and to initiate a preventive action with respect to the given source node in any of the pairs for which the test score is greater than a specified level.

There is also disclosed herein a computer software product, the product including a non-transitory computer-readable medium, in which program instructions are stored, which instructions, when executed by a computer, cause the computer to identify, in data traffic transmitted between multiple nodes that communicate over a network, a set of pairs of source and destination nodes, each pair consisting of a given source node and a given destination node, and one or more communication ports on the given destination node in each pair that are accessed by the data traffic from the given source node, to identify one or more noisy scanners, each of the noisy scanners comprising a given source node that accesses at least a specified first number of destination ports on at least a second specified number of destination nodes, to compute, for each pair in the set, a respective baseline level that is indicative of an average of a first number of the communication ports that source nodes other than the given source node and other than any of the identified noisy scanners, in the pair accessed on the given destination node during a first time period, to compute, for each pair in the set, a respective test score that is indicative of a difference between a second number of the communication ports that the given source node in the pair accessed on the given destination node during a second time period and the baseline level, and to initiate a preventive action with respect to the given source node in any of the pairs for which the test score is greater than a specified level.

There is also disclosed herein examples of a method including identifying, in data traffic transmitted between multiple nodes that communicate over a network during a timespan including multiple predefined time periods, a set of port scans, each of the port scans including an access, in the data traffic, of a plurality of communication ports on a given destination node by a given source node during a given time period, and computing, for each given source node in the identified port scans, an average number of the destination nodes whose respective communication ports were accessed by the given source node during any given port scan by the given source node, and a fraction of the time periods during which the given source node accessed at least one of the destination nodes in at least one of the port scans carried out by the given source node, The method also includes assembling a whitelist of the source nodes for which one or more of the following conditions was found to apply: the average number of the destination nodes accessed in the identified port scans was greater than a first threshold, and the fraction of the time periods during which at least one of the destination nodes was accessed in at least one of the port scans was greater than a second threshold. The method further includes initiating a preventive action upon detecting a port scan by one of the nodes that is not on the whitelist.

In one example, identifying the port scans includes identifying, in the data traffic, a set of pairs of the source and the destination nodes, each pair consisting of a given source node and a given destination node, and one or more of the communication ports accessed in the data traffic between the source and destination nodes in each pair, computing, for each pair in the set, a respective baseline level that is indicative of a first number of the communication ports that source nodes other than the given source node in the pair accessed on the given destination node during a first time period, computing, for each pair in the set, a respective test score that is indicative of a difference between a second number of the communication ports that the given source node in the pair accessed on the given destination node during a second time period and the baseline level, and designating any of the pairs for which the test score is greater than a specified level as the port scans.

In some examples, the average number of the destination nodes includes an average number of the destination nodes that were accessed by the given source node during each of the time periods in which the given source node accessed at least one of the communication ports. In additional examples, the multiple time periods include a set of first time periods and a second time period subsequent to the first time periods, the steps of computing the averages and the functions and assembling the whitelist are performed on the port scans identified in the first time periods, and detecting the port scan by one of the nodes that is not on the whitelist is in the second time period.

In further examples, each of the predefined time periods have substantially identical time durations. In supplemental examples, initiating the preventive action includes generating an alert for the given source node in the detected port scan. In another example, initiating the preventive action includes restricting access of the given source node in the detected port scan to the network.

There is also disclosed herein examples of an apparatus including a network interface device coupled to a data network including multiple nodes that communicate via the network and at least one processor configured to identify, in data traffic transmitted between multiple nodes that communicate over a network during a timespan including multiple predefined time periods, a set of port scans, each of the port scans including an access, in the data traffic, of a plurality of communication ports on a given destination node by a given source node during a given time period, and to compute, for each given source node in the identified port scans, an average number of the destination nodes whose respective communication ports were accessed by the given source node during any given port scan by the given source node, and a fraction of the time periods during which the given source node accessed at least one of the destination nodes in at least one of the port scans carried out by the given source node. The processor is also configured to assemble a whitelist of the source nodes for which one or more of the following conditions was found to apply: the average number of the destination nodes accessed in the identified port scans was greater than a first threshold, and the fraction of the time periods during which at least one of the destination nodes was accessed in at least one of the port scans was greater than a second threshold. The processor is further configured to initiate a preventive action upon detecting a port scan by one of the nodes that is not on the whitelist.

There is also disclosed herein examples of a computer software product, the product including a non-transitory computer-readable medium, in which program instructions are stored, which instructions, when read by a computer, cause the computer to identify, in data traffic transmitted between multiple nodes that communicate over a network during a timespan including multiple predefined time periods, a set of port scans, each of the port scans including an access, in the data traffic, of a plurality of communication ports on a given destination node by a given source node during a given time period and to compute, for each given source node in the identified port scans, an average number of the destination nodes whose respective communication ports were accessed by the given source node during any given port scan by the given source node, and a fraction of the time periods during which the given source node accessed at least one of the destination nodes in at least one of the port scans carried out by the given source node. The computer software product is also configured to assemble a whitelist of the source nodes for which one or more of the following conditions was found to apply: the average number of the destination nodes accessed in the identified port scans was greater than a first threshold, and the fraction of the time periods during which at least one of the destination nodes was accessed in at least one of the port scans was greater than a second threshold. The computer software product is further configured to initiate a preventive action upon detecting a port scan by one of the nodes that is not on the whitelist.

There is also disclosed herein examples of a method including defining, for a given software category, respective, disjoint sets of communication ports that are used by each of a plurality of software systems in the given software category, including at least first and second disjoint sets, identifying, in data traffic transmitted between multiple nodes that communicate over a network, a set of port scans, each of the port scans including an access, in the data traffic, of a plurality of the communication ports on a given destination node by a given source node during a predefined time period, and upon detecting a port scan by one of the nodes including accesses of at least one of the communication ports in the first set and at least one of the communication ports in the second set, initiating a preventive action.

In some examples, detecting accesses of at least one of the communication ports in the first set includes detecting accesses of at least a specified number of the communication ports in the first set, wherein the specified number is greater than one. In additional examples, the at least one of the communication ports in the first set and at least one of the communication ports in the second set include at least a specified number of the communication ports in each of the first and the second sets, wherein the specified number is greater than one.

In a first example, the given software category includes operating systems. In a second example, the given software category includes database servers. In a third example, the given software category includes email servers. In a fourth example, the given software category includes remote session applications.

In further examples, initiating the preventive action include generating an alert for the given source node in the detected port scan. In supplemental examples, initiating the preventive action includes restricting access of the given source node in the detected port scan to the network.

There is also disclosed herein examples of an apparatus including a network interface device coupled to a data network including multiple nodes that communicate via the network, and at least one processor configured to define, for a given software category, respective, disjoint sets of communication ports that are used by each of a plurality of software systems in the given software category, including at least first and second disjoint sets, to identify, in data traffic transmitted between multiple nodes that communicate over a network, a set of port scans, each of the port scans including an access, in the data traffic, of a plurality of the communication ports on a given destination node by a given source node during a predefined time period, and upon detecting a port scan by one of the nodes including accesses of at least one of the communication ports in the first set and at least one of the communication ports in the second set, to initiate a preventive action.

There is also disclosed herein examples of a computer software product, the product including a non-transitory computer-readable medium, in which program instructions are stored, which instructions, when read by a computer, cause the computer to define, for a given software category, respective, disjoint sets of communication ports that are used by each of a plurality of software systems in the given software category, including at least first and second disjoint sets, to identify, in data traffic transmitted between multiple nodes that communicate over a network, a set of port scans, each of the port scans including an access, in the data traffic, of a plurality of the communication ports on a given destination node by a given source node during a predefined time period, and upon detecting a port scan by one of the nodes including accesses of at least one of the communication ports in the first set and at least one of the communication ports in the second set, to initiate a preventive action.

There is also disclosed herein examples of a method including identifying, in data traffic transmitted between multiple nodes that communicate over a network, a set of port scans, each of the port scans including an access, in the data traffic, of a plurality of communication ports on a given destination node by a given source node during a predefined time period, computing, for the communication ports that were accessed in the identified port scans, respective first probabilities of being accessed during any given port scan, computing for each pair of the communication ports in the identified port scans, a respective second probability that both of the communication ports in the pair were accessed during any given port scan, and upon detecting a port scan by one of the nodes including accesses of first and second communication ports on a given destination node for which the respective second probability for the pair of the first and second communication ports is lower than a threshold dependent upon the respective first probabilities of the first and second communication ports, initiating a preventive action.

In one example, identifying the port scans includes identifying, in the data traffic, a set of pairs of the source and the destination nodes, each pair consisting of a given source node and a given destination node, and one or more of the communication ports accessed in the data traffic between the source and destination nodes in each pair, computing, for each pair in the set, a respective communication level that is indicative of a first number of the communication ports that source nodes other than the given source node in the pair accessed on the given destination node during a first time period, computing, for each pair in the set, a respective test score that is indicative of a difference between a second number of the communication ports that the given source node in the pair accessed on the given destination node during a second time period and the baseline level, and designating any of the pairs for which the test score is greater than a specified level as the port scans.

In some examples, the specified time period includes multiple sub-periods including a set of first sub-periods and a second sub-period subsequent to the first sub-periods, the steps of identifying the group of high-traffic ports and generating the whitelist are performed on the port scans in the first sub-periods, and detecting the port scan on one of the nodes is in the second sub-period. In additional examples, each of the sub-periods have substantially identical time durations.

In further examples, initiating the preventive action includes generating an alert for the given source node in the detected port scan. In supplemental examples, initiating the preventive action includes restricting access of the given source node in the detected port scan to the network.

There is also disclosed herein examples of an apparatus including a network interface device coupled to a data network including multiple nodes that communicate via the network, and at least one processor configured to identify, in data traffic transmitted between multiple nodes that communicate over a network, a set of port scans, each of the port scans including an access, in the data traffic, of a plurality of communication ports on a given destination node by a given source node during a predefined time period, to compute, for the communication ports that were accessed in the identified port scans, respective first probabilities of being accessed during any given port scan, to compute for each pair of the communication ports in the identified port scans, a respective second probability that both of the communication ports in the pair were accessed during any given port scan, and upon detecting a port scan by one of the nodes including accesses of first and second communication ports on a given destination node for which the respective second probability for the pair of the first and second communication ports is lower than a threshold dependent upon the respective first probabilities of the first and second communication ports, to initiate a preventive action.

There is also disclosed herein examples of a computer software product, the product including a non-transitory computer-readable medium, in which program instructions are stored, which instructions, when read by a computer, cause the computer to identify, in data traffic transmitted between multiple nodes that communicate over a network, a set of port scans, each of the port scans including an access, in the data traffic, of a plurality of communication ports on a given destination node by a given source node during a predefined time period, to compute, for the communication ports that were accessed in the identified port scans, respective first probabilities of being accessed during any given port scan, to compute for each pair of the communication ports in the identified port scans, a respective second probability that both of the communication ports in the pair were accessed during any given port scan, and upon detecting a port scan by one of the nodes including accesses of first and second communication ports on a given destination node for which the respective second probability for the pair of the first and second communication ports is lower than a threshold dependent upon the respective first probabilities of the first and second communication ports, to initiate a preventive action.

There is also disclosed herein examples of a method including identifying, in data traffic transmitted between multiple nodes that communicate over a network, a set of port scans, each of the port scans including an access, in the data traffic, of a plurality of communication ports on a given destination node by a given source node during a predefined time period, identifying in the data traffic a group of high-traffic ports, including one or more of the communication ports that receive respective volumes of the data traffic that are in excess of a predefined threshold, generating, for the identified port scans respective signatures indicative of the communication ports other than the high-traffic ports that were accessed in each of the port scans, computing a respective frequency of occurrence of each of the signatures over the set of the port scans, assembling a whitelist of the signatures for which the respective frequency of occurrence is greater than a predefined threshold, and upon detecting a port scan for which the respective signature is not on the whitelist, initiating a preventive action.

In some examples, the specified time period includes multiple sub-periods including a set of first sub-periods and a second sub-period subsequent to the first sub-periods, the steps of computing the first and the second probabilities are performed on the port scans in the first sub-periods, and detecting the port scan on one of the nodes is in the second sub-period. In additional examples, each of the sub-periods have substantially identical time durations.

In additional examples, computing the respective frequency of occurrence of each of the signatures over the set of the port scans includes determining, for each given unique signature, a count of scans matching the given unique signature, and the whitelist includes the unique signatures whose respective counts of matching scans are greater than a specified number.

In further examples, computing the respective frequency of occurrence of each of the signatures over the set of the port scans includes determining, for each given unique signature, a count of unique source nodes in the scans matching the given unique signature, and the whitelist includes the unique signatures for which one or more of the following conditions was found to apply: the count of the unique source nodes is greater than a first value, and the count of the unique source nodes is less than a second value.

In supplemental examples, computing the respective frequency of occurrence of each of the signatures over the set of the port scans includes determining, for each given unique signature, a count of unique destination nodes in the scans matching the given unique signature, and the whitelist includes the unique signatures for which one or more of the following conditions was found to apply: the count of the unique destination nodes is greater than a first value, and the count of the unique destination nodes is less than a second value.

In some examples, the high-traffic port is associated with a given destination node. In another example, initiating the preventive action includes generating an alert for the given source node in the detected port scan. In additional examples, initiating the preventive action includes restricting access of the given source node in the detected port scan to the network.

There is also disclosed herein examples of an apparatus including a network interface device coupled to a data network including multiple nodes that communicate via the network, and at least one processor configured to identify, in data traffic transmitted between multiple nodes that communicate over a network, a set of port scans, each of the port scans including an access, in the data traffic, of a plurality of communication ports on a given destination node by a given source node during a predefined time period, to identify in the data traffic a group of high-traffic ports, including one or more of the communication ports that receive respective volumes of the data traffic that are in excess of a predefined threshold, to generate, for the identified port scans respective signatures indicative of the communication ports other than the high-traffic ports that were accessed in each of the port scans, to compute a respective frequency of occurrence of each of the signatures over the set of the port scans, to assemble a whitelist of the signatures for which the respective frequency of occurrence is greater than a predefined threshold, and upon detecting a port scan for which the respective signature is not on the whitelist, to initiate a preventive action.

There is also disclosed herein examples of a computer software product, the product including a non-transitory computer-readable medium, in which program instructions are stored, which instructions, when read by a computer, cause the computer to identify, in data traffic transmitted between multiple nodes that communicate over a network, a set of port scans, each of the port scans including an access, in the data traffic, of a plurality of communication ports on a given destination node by a given source node during a predefined time period, to identify in the data traffic a group of high-traffic ports, including one or more of the communication ports that receive respective volumes of the data traffic that are in excess of a predefined threshold, to generate, for the identified port scans respective signatures indicative of the communication ports other than the high-traffic ports that were accessed in each of the port scans, to compute a respective frequency of occurrence of each of the signatures over the set of the port scans, to assemble a whitelist of the signatures for which the respective frequency of occurrence is greater than a predefined threshold, and upon detecting a port scan for which the respective signature is not on the whitelist, to initiate a preventive action.

The disclosure is herein described, by way of example only, with reference to the accompanying drawings, wherein:.

Embodiments of the present invention provide methods and systems for identifying port scans on a data network. As described hereinbelow, while monitoring data traffic transmitted between multiple nodes that communicate over a network, a set of pairs of source and destination nodes are identified, each pair consisting of a given source node and a given destination node, and one or more communication ports accessed in the data traffic between the source and destination nodes in each pair. For each pair in the set, a respective baseline level and a respective test score are computed. For each pair in the set, the respective baseline level is indicative of a first number of the communication ports that source nodes other than the given source node in the pair accessed on the given destination node a first time period, and the respective test score that is indicative of a difference between a second number of the communication ports that the given source node in the pair accessed on the given destination node during a second time period and the baseline level. A preventive action can be initiated with respect to the given source node in any of the pairs for which the test score is greater than a specified level.

Embodiments of the present invention also provide methods and systems for detecting if any of the identified port scans comprise an anomalous combination of ports that can indicate a malicious port scan. Examples of anomalous combination of ports include, but are not limited to, port pairs and port groups. As described hereinbelow, the analysis to detect the suspicious port scans may be based on source profiles, port profiles, port pair profiles and scanner probe profiles.

<FIG> is a block diagram that schematically shows a computing facility <NUM> comprising a malicious port scan detection system <NUM> that collects and monitors data packets <NUM> transmitted between multiple nodes <NUM> coupled to a data network <NUM> in order to identify malicious port scans, in accordance with an embodiment of the present invention. In embodiments described herein, each node <NUM> comprises any type of device (i.e., physical or virtual) that is configured to communicate over the network, and has an IP address assigned for this purpose. In the example shown in <FIG>, the nodes comprise workstations <NUM> and a public network <NUM> such as the Internet. As described hereinbelow, embodiments of the present invention aggregate the data packets into communication sessions, identify any of the communication sessions that comprise port scans <NUM>, and generate an alert for any of the port scans that are suspected of being malicious.

While the example shown in <FIG> shows the nodes comprising workstations <NUM>, nodes <NUM> comprising other types of devices that communicate over network <NUM> and Internet <NUM> are considered to be within the spirit and scope of the present invention. For example, the nodes may comprise devices such as servers, wireless devices such as smartphones, routers and network switches.

Each workstation <NUM> may comprise, for example, a workstation identifier (ID) <NUM>, a workstation processor <NUM>, a workstation memory <NUM> that stores a plurality of communication ports <NUM> (also referred to herein simply as ports). Unlike physical ports, ports <NUM> are logical entities that are defined by a communications protocol such as TCP/IP.

Examples of workstation IDs <NUM> include, but are not limited to, a media access control (MAC) addresses and Internet Protocol (IP) addresses that can be used to uniquely identify each of the workstations. While any given time, each given workstation <NUM> is assigned a unique IP address, the given workstation may be associated with multiple IP addresses over an extended time period. For example, the IP address for a given workstation <NUM> may change after a reboot of the given workstation. Generally, in operation, processor <NUM> executes, from memory <NUM>, an operating system <NUM> (e.g., Linux) and one or more software applications <NUM> (e.g., a database server).

In the configuration shown in <FIG>, memory <NUM> also stores a whitelist <NUM> that stores the identifiers for one or more workstations <NUM>. As described in the description referencing <FIG> and <FIG> hereinbelow, embodiments of the present invention can ignore any suspicious port scan <NUM> that is initiated by any workstation <NUM> in the whitelist.

Workstations <NUM> communicate over data network <NUM> (e.g., a local area network) that is also coupled to an Internet gateway <NUM>. Gateway <NUM> couples computing facility <NUM> to public networks <NUM> such as the Internet, and comprises communications circuitry (not shown) that enables communication between workstations <NUM> and sites/computers (not shown) on the Internet.

In some embodiments, malicious port scan detection system <NUM> comprises a system processor <NUM> and a system memory <NUM>, which are coupled by a system bus (not shown) to a network interface controller (NIC) <NUM> that couples the computer system to network <NUM>. In some embodiments, malicious port scan detection system <NUM> may comprise a user interface (UI) device <NUM> (e.g., an LED display) or another type of output interface.

In the configuration shown in <FIG>, malicious port scan detection system <NUM> comprises a probe <NUM> that collects information on data packets <NUM> transmitted over network <NUM>. While the example in <FIG> shows probe <NUM> as a module of malicious port scan detection system <NUM>, the probe can be implemented either as a standalone device coupled to network <NUM>, or as a module in another device coupled to the network. Probe <NUM> optionally collects data packets <NUM> from network <NUM> and processes the collected data packets to extract information, using any of the methods described, in <CIT> and <CIT>.

Memory <NUM> stores respective pluralities of communication sessions <NUM>, aggregated communication sessions <NUM> and port lists <NUM>. In embodiments described herein, processor <NUM> is configured to collect the data packets from probe <NUM>, to group the data packets into communication sessions <NUM>, to aggregate the communication sessions into aggregated communication sessions <NUM>, and to identify any of the aggregated communication sessions that indicate a given port scan <NUM>. The use of port lists <NUM>, which store respective pluralities of ports <NUM> (i.e., port numbers), is described in the description referencing <FIG>, hereinbelow.

Each communication session <NUM> optionally comprises a source node identifier <NUM>, a destination port identifier <NUM>, a time <NUM>, a source port identifier <NUM>, a destination port identifier <NUM>, a protocol <NUM>, a status <NUM>, a volume <NUM> (source to destination), a reverse-volume <NUM> (also referred to as rvolume, destination to source), and a time <NUM>. Each aggregated communication session <NUM> optionally comprises a port scan time period <NUM>, a subset <NUM> of the communication sessions, and a signature <NUM>.

In each given communication session <NUM>, source node <NUM> stores the identifier of a first given workstation <NUM>, destination node <NUM> stores the identifier of a second given workstation <NUM>, source port <NUM> refers to a given port <NUM> on the first given workstation that is being used to communicate with the second given workstation during the given communication session, the destination port <NUM> refers to a given port <NUM> on the second given workstation that is being accessed during the given communication session, the protocol <NUM> refers to a given communications protocol (e.g., NFS, SSH, KERBEROS, LDAP) that is used by the given communication session, the status <NUM> indicates whether the given communication session completed successfully, volume <NUM> indicates an amount of data transmitted from the first given workstation to the second given workstation during the given communication session, and reverse volume <NUM> indicates an amount of data transmitted from the second given workstation to the first given workstation during the given communication session.

In embodiments described herein, source node <NUM> may be used to refer to the first given workstation, and destination node <NUM> may be used to refer to the second given workstation. In embodiments where workstations communicate using TCP/IP, processor can identify the source and the destination ports for a given communication session <NUM> based on information stored in a given data packet <NUM> storing the TCP header.

For each aggregated communication session <NUM>, the port scan time period <NUM> comprise specified time period (e.g., a specific number of hours or days), and subset <NUM> refers to a plurality of communication sessions <NUM>. Signatures <NUM> are described in the description referencing <FIG>, hereinbelow.

In some embodiments, the tasks of collecting the data packets, grouping the data packets into the communication sessions, aggregating the communication sessions and identifying the aggregated communication sessions that comprise port scans <NUM> may be split among multiple devices within computing facility <NUM> (e.g., workstations <NUM>) or external to the computing facility (e.g., a data cloud based application). In some embodiments, the functionality of some or all of workstations <NUM> and/or malicious port scan detection system <NUM> may be deployed in computing facility <NUM> as virtual machines.

Examples of memories <NUM> and <NUM> include dynamic random-access memories and nonvolatile random-access memories. In some embodiments, the memories may comprise nonvolatile storage devices such as hard disk drives and solid-state disk drives.

Processors <NUM> and <NUM> comprise general-purpose central processing units (CPU) or special-purpose embedded processors, which are programmed in software or firmware to carry out the functions described herein. This software may be downloaded to computers <NUM> and <NUM> in electronic form, over a network, for example. Additionally or alternatively, the software may be stored on tangible, non-transitory computer-readable media, such as optical, magnetic, or electronic memory media. Further additionally or alternatively, at least some of the functions of processors <NUM> and <NUM> may be carried out by hard-wired or programmable digital logic circuits.

<FIG> is a flow diagram that schematically illustrates a method for identifying suspicious port scans <NUM> on network <NUM>, in accordance with an embodiment of the present invention. In embodiments described herein, a suspicious port scan comprises a source workstation <NUM> that accesses an anomalous combination of communication ports <NUM> on a destination workstation <NUM> within a predetermined time period.

In step <NUM>, processor <NUM> uses probe <NUM> to collect data packets <NUM> that are transmitted between nodes <NUM> on network <NUM> during a time period that comprises multiple sub-periods. For example, the time period may comprise seven consecutive days (i.e., one week), and each sub-period may comprise any <NUM> hour period (e.g., one day) during the week.

In step <NUM>, processor <NUM> groups and stores the collected data packets as individual communication sessions <NUM> between respective pairs of source and destination nodes <NUM>. The communication session typically comprises a sequence of data packets <NUM> that a first given workstation <NUM> transmits to a given port <NUM> on a second given workstation <NUM>. Upon detecting a given sequence of data packets, processor <NUM> defines a new communication session <NUM>, and stores, to the new communication session, the identifier for the first given workstation to source node <NUM>, the identifier for the second given workstation to destination node <NUM>, the date and time that the given sequence of data packets were collected to time <NUM>, the port number for the first given workstation in the TCP header to source port <NUM>, the port for the second given workstation in the TCP header to destination port <NUM>, a communications protocol used by the sequence of data packets to protocol <NUM>, a status (e.g., succeeded/failed) of the communication session to status <NUM>, and a first amount of data (e.g., <NUM> bytes) that the first given workstation transmitted to the second given workstation in the sequence of data packets to volume <NUM>.

In some instances, the sequence of data packets may also comprise a second volume of data (e.g., <NUM> bytes) that the second given workstation transmits to the first given workstation. Process <NUM> can store the second amount of data to rvolume <NUM>.

In some embodiments, processor <NUM> can group the packets according to the IP addresses (not shown) in the packets, such that the system processor can group together packets <NUM> having the same source and destination addresses or having the same source address, source port, destination address, destination port and protocol. In an alternative embodiment, processor <NUM> can manage a table (not shown) which correlates between addresses in packets and respective IDs <NUM> of nodes <NUM>, for example as described in <CIT>, and groups together packets according to the IDs corresponding to the addresses in the packets. An example for grouping the collected data packets <NUM> is described in <CIT>.

In step <NUM>, processor <NUM> aggregates the communication sessions into a plurality of aggregated communication sessions <NUM>, so that each of the aggregated communication sessions comprises the data in the communication sessions for each unique pair of source and destination nodes that communicated with each other during a given sub-period. In embodiments of the present invention, each sub-period typically comprises a predefined time period (e.g., one hour, two hours or <NUM> hours).

When aggregating communication sessions <NUM>, processor <NUM> can identify and flag any of the communication sessions to a given port <NUM> that failed. In embodiments herein, these flagged communication sessions may be referred to as failed connections. A communication session to a given port <NUM> can be flagged as a failed connection if no response is received from the given port, or if a response is received indicating that the given port is closed. A failed connection is typically a result of a faulty configuration of a given node <NUM>, and a given port <NUM> can be identified as a failed port by detecting that there are no successful connections to the given port on the given node. For example, if given node <NUM> comprises an email server that is configured with a wrong IP address, other nodes <NUM> on the network will generate failed connections when they attempt to access a wrong destination port on the email server.

In the TCP/IP communications model, a successful communication session comprises (a) a given source node <NUM> transmitting a "SYN" command to a given destination node <NUM>, (b) the given destination node transmitting a "SYN-ACK" command to the given source node in response to receiving the "SYN" command, and (c) the given source node transmits an "ACK" command to the given destination node in response to receiving the "SYN-ACK" command. In embodiments of the present invention, processor <NUM> can identify a failed connection by detecting a given communication session <NUM> that is missing a "SYN-ACK" command transmitted from a given destination node <NUM> to a given source node <NUM> and/or is missing an "ACK" command transmitted from the given source node to the given destination node.

In embodiments of the present invention, processor <NUM> can use failed connection information to determine if any of the aggregated communication sessions comprise any port scans. For example, if all the communication sessions in a given aggregated communication session <NUM> are successful (i.e., have successful transmissions of the "SYN", "SYN-ACK" and "ACK" commands), them there is a low likelihood that the given aggregated communication session comprises a port scan. However, if all the connections in the given aggregated communication session comprise failed connections on different ports <NUM> (as detected using embodiments described supra), then there is a high likelihood that the given aggregated communication session comprises a port scan.

In step <NUM>, processor <NUM> "cleans" the data in port scan records in order to retain the data that is relevant for analysis. In one embodiment, processor <NUM> can clean the data by filtering out any of the communication sessions comprising port scans having source ports <NUM> and protocols <NUM> that are known to have activity in numerous destination ports <NUM>. For example, based on parameters provided by a systems administrator, processor <NUM> can filter out any of the port scans whose protocol is NFS and whose source port numbers are either "<NUM>", "<NUM>" or "<NUM>". In a another embodiment, a given port list <NUM> may comprise a set of ports <NUM> that are used by services available on network <NUM>, and processor <NUM> can filter out any scans of ports <NUM> in the given port list.

In step <NUM>, processor <NUM> identifies one or more aggregated port communication sessions <NUM> that comprise respective port scans <NUM>. In some embodiments, processor <NUM> can use destination profiles to identify a given port scan, as described in the description referencing <FIG> hereinbelow.

In step <NUM>, in response to identifying the port scans in step <NUM>, processor <NUM> can initiate, for the source node in each identified port scan <NUM>, a first preventive action. In one embodiment, processor <NUM> can initiate the first preventive action by presenting, on user interface device <NUM>, an alert message indicating that the identified source node is performing suspicious port scans. In another embodiment, processor <NUM> can initiate the first preventive action by restricting the identified source node from accessing network <NUM> (e.g., by conveying an instruction to a network switch or a firewall coupling the identified source node to network <NUM>).

In an additional embodiment, processor <NUM> can initiate the first preventive action by transmitting the identifier of the given source node to an alert management system (not shown) such as a security information and event management (SIEM) system. In a further embodiment, processor <NUM> can generate the alert by storing the identifier of the given source node to a data structure (not shown) that an alert management system (e.g., a SIEM system) can extract via an API (not shown).

In one variation of the embodiments described hereinabove, processor <NUM> can identify a user (e.g., via login credentials) of the source node in an identified port scan, and initiate the preventive action with respect to the given user. In another variation of the embodiments described hereinabove, processor <NUM> can identify, on the source node in an identified port scan, a software process that accessed the ports in the identified port scan, and initiate the preventive action with respect to the software process.

In step <NUM>, processor <NUM> identifies a given identified port scan that comprises a given source node <NUM> that scanned an anomalous combination of destination ports <NUM> on a given destination node <NUM> during the time period (i.e., a test period). Different embodiments for detecting the anomalous combinations are described hereinbelow in the respective descriptions referencing <FIG>. The port scan identified in step <NUM> may also be referred to herein as a suspicious port scan.

Finally in step <NUM>, in response to identifying the anomalous port scans in step <NUM>, processor <NUM> can initiate a second preventive action for the source nodes in the anomalous port scans, and the method ends. Examples of preventative actions are described supra.

In embodiments of the present invention, processor <NUM> can use destination profiles to detect port scans <NUM>. As described hereinbelow, processor <NUM> can generate, based on data packets <NUM> collected during a specified time period, destination profiles for each given destination node <NUM> that indicates a typical number of ports <NUM> (i.e., destination ports <NUM>) scanned on the given destination node, and use the destination profiles to detect any subsequently collected port scans that are anomalous.

<FIG> is a flow diagram that schematically illustrates a method for computing destination profile scores, and using the computed scores to identify port scans <NUM>, in accordance with an embodiment of the present invention. In step <NUM>, using embodiments described in the description referencing <FIG> hereinabove, processor <NUM> identifies a set of port scans. To identify the set of port scans, processor <NUM> collects communication sessions <NUM> and aggregates them into aggregated communication sessions <NUM>. Each aggregated communication session <NUM> comprises a given port scan <NUM> having a first given workstation <NUM> accessing at least one given communication port <NUM> on a second given destination <NUM>.

Processor <NUM> collects the communication sessions during multiple time periods that include a training period (also referred to herein as a first time period) and a test period (also referred to herein as a second time period). The test and training periods may have substantially identical (e.g., within <NUM>%) time durations. For example, the test and training periods may comprise <NUM> hour periods. In some embodiments, the test period is subsequent to the training period. In additional embodiments, the training and the test periods may overlap partially of completely (i.e., the same time period).

In step <NUM>, processor <NUM> identifies any of the source nodes in the aggregated communication sessions that are "noisy scanners". In embodiments of the present invention, a given source node <NUM> can be classified as a noisy scanner if the given source node accesses (i.e., "scans") at least a first number (e.g., at least <NUM>, at least <NUM>, at least <NUM>, at least <NUM>, or at least <NUM>) of destination ports <NUM> on at least a second number (e.g., <NUM>, <NUM>, <NUM>, or <NUM>) of destination nodes <NUM> during the training period. In some embodiments, the second number is greater than the first number. As described hereinbelow, processor <NUM> can ignore any source node <NUM> that the system processor classified as a noisy scanner.

In step <NUM>, processor <NUM> computes, for each pair of a given source node <NUM> and a given destination node <NUM> in the aggregated communication sessions, a baseline score (also referred to herein as a baseline level) that indicates a typical number of ports <NUM> that remaining first source nodes (i.e., excluding the given source node and any of the source nodes that identified as noisy scanners) accessed on the given destination node during a given sub-period (e.g., one day) in the training period. Processor <NUM> uses the following formula for each of the source node <NUM> and destination node <NUM> pairs (i,j) to compute baseline scores: <MAT> where.

In operation, processor <NUM> can compute Equation (<NUM>) for a single training period D or for a training period having multiple sub-periods D. In embodiments with a single period D, the training and the test periods may have substantially identical time durations, and in embodiments with multiple periods D, the sub-periods and the test periods may have substantially identical time durations.

In step <NUM>, processor <NUM> computes, for each pair of a given source node <NUM> and a given destination node <NUM> in the second aggregated communication sessions, a destination profile score that can be used to identify, based on the destination ports on the destination nodes accessed by the source nodes during the training and the test periods, any of the source nodes that are suspected of performing port scans <NUM>. For example, processor <NUM> can compute, for each pair (i,j) identified during the test period, the following destination profile score: <MAT> where <MAT> comprises a number of destination ports <NUM> that the source node i accessed on the destination node j during the test period. In embodiments of the present invention, a higher destination profile score for a given pair (i,j) indicates that number of ports <NUM> that a given source node i scanned on a given destination node j during the test period was greater than the ports on the given destination node that the given source node scanned during the training period. A higher Scorei,j indicates a higher probability that the source node i is performing a port scan on the destination node j.

Finally, in step <NUM>, processor <NUM> can identify a given pair of source and destination nodes whose destination profile score exceeds a specified threshold (i.e., a level), thereby indicating suspicious port scans, and the method ends. In one embodiment the threshold may comprise a large score value (e.g., <NUM>, <NUM>, <NUM> or <NUM>) for the score. In another embodiment the threshold may comprise a low score value (e.g., <NUM>, <NUM> or <NUM>) and the number of failed connections between the source and destination nodes during the test period is greater than a low failed connection value (e.g., <NUM>, <NUM> or <NUM>).

In a second anomalous port scan detection embodiment, processor <NUM> can use source profiles to detect potentially malicious port scans. As described hereinbelow, processor <NUM> can generate, based on ports scans <NUM> collected during a specified time period, a source profile for each given source node <NUM> that indicates nodes whether or not a given source node is either an aggressive scanner or a periodic scanner. In embodiments of the present invention, scans from aggressive and periodic scanners are not considered to be suspicious, and the aggressive and periodic scanners can be whitelisted.

Computer networks such as network <NUM> typically comprise workstations <NUM> that can execute processes that perform legitimate port scans or perform legitimate activities that resemble ports scans (i.e. with a different intention). Since these services or activities sometimes originate from the same source node <NUM>, embodiments of the present invention can generate and use source profiles to detect these source nodes in order to whitelist their legitimate port scanning activity.

<FIG> is a flow diagram that schematically illustrates a method for computing source profiles, and using the computed source profiles to detect and whitelist any source nodes <NUM> that are aggressive or periodic scanners, in accordance with an embodiment of the present invention. In step <NUM>, using embodiments described in the description referencing <FIG> hereinabove, processor <NUM> identifies a set of port scans. To identify the set of port scans, processor <NUM> collects, during a timespan comprising multiple predefined time periods, communication sessions <NUM> and aggregates them into aggregated communication sessions <NUM>. Each aggregated communication session <NUM> comprises a given port scan <NUM> having a first given workstation <NUM> accessing at least one given communication port <NUM> on a second given destination <NUM> during a given time period. The predefined time periods may have substantially identical time durations (e.g., one day).

In step <NUM>, processor <NUM> computes, for each given source node "i" in the port scans, scann _dests_avera i that indicates an average number of destination nodes <NUM> whose respective communication ports <NUM> were accessed by the given source node during any given scan by the given source node. In some embodiments, scanned_dest _avera i comprises an average number of the destination nodes that the given source node scanned per time period, omitting time periods where no scans were performed by the given source node.

In step <NUM>, processor <NUM> computes for each given source node "i" in the port scans, for the given source node i, <MAT>, which indicates a fraction of the time periods D during which the given source node accessed at least one of the destination nodes in at least one of the port scans carried out by the given source node.

In step <NUM>, processor <NUM> whitelists, based on the computed scanned_dests_averagei averages and scan_ratioi fractions, any of the source nodes that are classified either as aggressive or periodic scanners, as described in the criteria hereinbelow, To whitelist a given source node <NUM>, processor <NUM> adds the given source node (i.e., the corresponding port number) to whitelist <NUM>.

In embodiments of the present invention, an aggressive scanner can be defined as a given source node <NUM> that scans a few destination nodes <NUM> during every time period (e.g., every day). For example, an aggressive scanner might scan a database server and a web server (i.e., two different destination nodes) every hour to check on their respective statuses. In some embodiments, for each given source node <NUM>, processor <NUM> can first identify scan_daysi as a number of days the given source node performed at least one scan, and can classify the given source node as an aggressive scanner if ∀i: scanned_dests_averagei exceeds a first low threshold (e.g., <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>) and/or scan_ratioi exceeds a first high threshold (e.g., <NUM>, <NUM>, <NUM>, <NUM>).

For example, if the first low threshold is <NUM>, the first high threshold is <NUM>, and the daily number of destination nodes <NUM> scanned by a given source node <NUM> is [<NUM>,<NUM>,<NUM>,<NUM>,<NUM>,<NUM>], then the given source node is an aggressive scanner since scan_daysi = <NUM>, scanned_dests_avera i = <NUM>, and scan_ratioi = <NUM>.

In embodiments of the present invention, a periodic scanner can be defined as a given source node <NUM> that scans many destinations with less frequency (e.g., once a week). For example, a periodic scanner may scan ports <NUM> on all the nodes (e.g., workstations <NUM>) on network <NUM> on a weekly basis to see if there are any changes such as if any new ports <NUM> are open or if there are any respective vulnerabilities in the nodes. In a manner similar to detecting aggressive scanners, for each given source node <NUM>, processor <NUM> can first identify scan_day i, and can classify the given source node as a periodic scanner if Vi: scanned_dests_averagei exceeds a second high threshold (e.g., <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>) and/or scan_ratioi exceeds a second low threshold (e.g., <NUM>, <NUM>, <NUM>, <NUM>).

For example, if the second high threshold is <NUM>, the first second low threshold is <NUM>, and the daily number of destination nodes <NUM> scanned by a given source node <NUM> is [<NUM>,<NUM>,<NUM>,<NUM>,<NUM>,<NUM>], then the given source node is a periodic scanner since scan_daysi = <NUM>, scanned_dests_averagei = <NUM>, and scan_rat i = <NUM>.

In one embodiment, processor <NUM> can receive an input (e.g., from a system administrator) that specifies the first and second low thresholds and the first and the second high thresholds. In another embodiment, processor <NUM> can dynamically set these thresholds based on the respective distributions of the computed values (i.e., scanned_dests_avera i and scan_ratioi). For example, processor <NUM> can dynamically set the threshold based on (e.g., a fixed percentage) of outliers in the respective distributions of the computed values.

Returning to the flow diagram, in step <NUM>, processor <NUM> identifies any of the source nodes in the port scans (i.e., that were identified in step <NUM>) that are not in whitelist <NUM>, and the method ends.

In one embodiment, processor <NUM> can perform step <NUM> during any given time period in order to identify a given non-whitelisted source node that performed a port scan during the given time period. In another embodiment, the time periods comprise one or more first time periods followed by a second time period, and processor <NUM> can perform steps <NUM>-<NUM> on the one or more first time periods, and perform step <NUM> on the second time period.

Embodiments described herein can use port profiles to detect potentially malicious port scans. Port profiles indicate which combinations of ports <NUM> are not likely to be a part of "normal" user activity, but rather part of a network scan. The concept behind port profiles is that there are combinations of ports that are suspicious if they are scanned during a short period of time (e.g., one day). For example, if a legitimate user wants to access a specific network service provided by a given workstation <NUM> on network <NUM>, the user typically knows what software application is providing the service, and any port(s) <NUM> the software application is using.

In a first port profile embodiment, the service (also referred to herein as a software category) comprises an operating system. For example, if the user wants to communicate with a given workstation running the Windows™ operating system (produced by Microsoft Corporation, Redmond, Washington), the user can use port number "<NUM>" which is for the remote desktop protocol (RDP) service. However, if the user tries to communicate with the given workstation via port number "<NUM>", then that may be suspicious since port number "<NUM>" is typically used by secure shell (SSH) service, which is a service in the Linux™ operating system and rarely exists in Windows™ operating systems.

In a second port profile embodiment, the service comprises database management systems (DBMS). In operation, a first given workstation <NUM> communicates with a DBMS application executing on a second given workstation <NUM> via a given port <NUM> on the second given workstation that is associated with the DBMS application. In this embodiment, a suspicious port scan may comprise the first given workstation communicating with a large number of ports <NUM> (i.e., on the second given workstation) that are associated with a corresponding large number of different DBMS applications. This type of activity may be caused by an attacker conducting a service enumeration, which, for example, tries to identify all the available DBMS applications on a specific server.

It is important to note that suspicious port scan activity is different in the two embodiments described supra. In the operating system embodiment, a small number of port scans that cross different operating system port groups may be suspicious. This is because a given workstation <NUM> typically executes a single operating system. However, in the DBMS embodiment, a suspicious port scan may require a large number of port scans that cross different DBMS port scan groups in order to be labeled as suspicious. This is because a given workstation <NUM> may execute more than one DBMS application.

In the first port profile embodiment, processor <NUM> can define a plurality of port lists <NUM> for a corresponding plurality of operating system <NUM>. Each port list <NUM> comprises multiple port numbers <NUM> that are commonly used by a given operating system <NUM>. Therefore, each given port list <NUM> for a given operating system <NUM> comprises port number <NUM> that are typically used by the given operating system, and are either never or rarely used by other operating systems <NUM>. Examples of operating systems <NUM> that can have respective port lists <NUM> include, but are not limited to Windows™ (produced by Microsoft Corporation, Redmond, Washington), Linux™, Android™ (produced by Alphabet Inc. , Mountain View, California), macOS™ (also known as OS-X™, produced by Apple Inc. , Cupertino California).

The rationale for defining the port lists in the first port profile embodiment is that an attacker typically does not know the operating system executing on a given workstation <NUM> that they are scanning, and one goal of the attacker is to identify operating system <NUM>. Therefore, the attacker may scan a few ports <NUM> from more than one port list <NUM> in order to identify the operating system executing on the given workstation.

For example, if a first given list <NUM> comprises ports used by Windows™, a second given <NUM> comprises ports used by Linux™ and a third given list <NUM> comprises ports used by macOS™, then for each source node <NUM> and destination node <NUM> pair, processor <NUM> can compute a tuple (N Windows, N Linux, N_macOS) that represent respective counts of the port numbers in the port lists that, during a test period (there is no need for a training period) were scanned on the given destination node by the given source node. In this example:.

In some embodiments, processor <NUM> can use specified thresholds for the mix of counts in the tuples to identify suspicious port scans <NUM> that "cross" a plurality of operating systems. In a first example, processor <NUM> can flag the port scans in a given tuple as suspicious if the given tuple indicates a threshold number (e.g., ><NUM>, ><NUM> or ><NUM>) of scans of ports <NUM> that are associated with one of the operating systems, and positive numbers of scans of any the ports associated with the remaining operating systems. In another example, processor <NUM> can flag the port scans in a given tuple as suspicious if the given tuple indicates respective large numbers (e.g., ><NUM>, ><NUM> or ><NUM>) of scans of ports <NUM> that are associated with least <NUM> different operating systems. In the first example, processor can flag a port scan that results in the tuple (<NUM>,<NUM>,<NUM>) as suspicious, and in the second example, the processor can flag the port scan that results in the tuple (<NUM>,<NUM>,<NUM>) as suspicious.

In additional embodiments, processor <NUM> can transform the tuples into probabilities that the processor can use to identify suspicious port scans. For example, processor <NUM> can compute probabilities_tuple = [p<NUM>, p<NUM>,. , pn] where <MAT>.

There may be instances where the port values are small and the probabilities are suspected to be inaccurate. In other words, even though a given port <NUM> was not previously accessed, its probability of being accessed in the future is not zero. In one embodiment, processor <NUM> can use methods such as confidence interval or Laplace smoothing in order to improve estimation. In another embodiment, processor <NUM> can compute an entropy of probabilities_tuple for a given tuple, and flag the port scans in the tuple as suspicious (i.e., in that they are accessing a suspicious combination of the ports in more than one of the sets) if the entropy exceeds a specified threshold (e.g., <NUM>, <NUM>).

In the second port profile embodiment, processor <NUM> can define a plurality of port lists <NUM> for a corresponding plurality of software applications <NUM>. Each port list <NUM> comprises multiple port numbers <NUM> that are commonly used by a specific family of software applications <NUM>. Therefore, each given port list <NUM> for a given software application <NUM> comprises ports that are typically used by the given software application, and are either never or rarely used by other software applications <NUM>. In the second port profile embodiment, examples of families (also known as categories) of software applications <NUM> include, but are not limited to, database services, email services and remote access services (also known as remote session services).

For example, if the family of software application <NUM> comprises database servers, then the port list for the database servers may comprise:.

Typically a given node (e.g., a given workstation <NUM> or a server) might execute a small number (e.g., <NUM>-<NUM>) different database server engines. Therefore, if processor <NUM> detects that a given source node <NUM> is scanning, on a given destination node <NUM>, at least a threshold number (e.g., at least <NUM>, at least <NUM> or at least <NUM>) of ports <NUM> from different port lists <NUM> for database servers, this may indicate that given source node is looking for "any" database server, and therefore does not know which one is executing on the given destination profile. When detecting a large number of ports scanned from different port lists <NUM> for a given network service, having zero or a few (e.g., less that <NUM>, less than <NUM> or less than <NUM>) successful sessions can increase suspiciousness.

In some embodiments, processor <NUM> can use additional criteria such as a number of detected failed connections correlated to different ports <NUM>. In one example, processor <NUM> can flag (i.e., as suspicious) a port scan that scans a large number (e.g., at least four or at least five) of ports <NUM> from different port lists <NUM> for database servers. In another example, processor <NUM> can flag a port scan that scans a small number (e.g., at least two or at least three) of ports <NUM> from different port lists <NUM> for database servers as suspicious wherein at least one of the port scans has a failed connection (as described supra). Note that these examples are typically for port scans that are performed within a short timeframe (e.g., less than one hour, less than two hours or less than three hours).

In a first embodiment, the threshold may comprise a large number such as at least <NUM>, at least <NUM> or at least <NUM>. In a second embodiment, the threshold may comprise a small number (e.g., at least <NUM>, at least <NUM> or at least <NUM>) of ports in different port lists, and at least <NUM> failed connection on any of the port numbers in any of the port lists (i.e., for the family). The port scans in the first and second embodiments are typically within a short time period (e.g., one, two or three hours).

<FIG> is a flow diagram that schematically illustrates a method of using port profiles to detect cross software system port scans, in accordance with an embodiment of the present invention. In step <NUM>, processor <NUM> defines a plurality of software systems in a specific software category, and in step <NUM>, the system processor defines, for each given software system, a given port list <NUM> comprising a set of one or more ports <NUM> that are used exclusively by the given software system. Therefore, each port lists <NUM> comprise at least first and second disjoint sets of communication ports <NUM> (i.e., port numbers). The category may comprise operating systems or software applications that provide network services such as database servers or email servers. As described supra, if the family is operating systems, then each port list <NUM> comprises one or more ports <NUM> used by an operating system such as Windows™, Linux™ or macOS™. Likewise if the family is DMBS applications, then each port list <NUM> comprises one or more ports <NUM> used by a DBMS application such as MySQL™, PostgreSQL™ or Cassandra™.

In step <NUM>, using embodiments described in the description referencing <FIG> hereinabove, processor <NUM> identifies a set of port scans. To identify the set of port scans, processor <NUM> collects, during a predefined time period (e.g., one hour or one day), communication sessions <NUM> and aggregates them into aggregated communication sessions <NUM>. Each aggregated communication session <NUM> comprises a given port scan <NUM> having a first given workstation <NUM> accessing at least one given communication port <NUM> on a second given destination <NUM>.

Finally, in step <NUM>, using embodiments described hereinabove, processor <NUM> identifies, in the identified port scans (i.e., in step <NUM>), a given source node <NUM> that accesses at least one of the communication ports in a first port list <NUM> and at least one of the communication ports in a second port list <NUM>, and the method ends.

Embodiments described herein can compute a distribution of port usage in network <NUM>, and use the computed distribution to identify suspicious port scans on the network. For example, during a training period, processor <NUM> can detect that the port numbers "<NUM>" and "<NUM>" are used frequently, but rarely together. During a subsequent test period, if processor <NUM> detects that a given source node <NUM> scanned, those two ports <NUM> on a given destination node <NUM>, then the system processor can generate an alert for the given source node.

<FIG> is a flow diagram that schematically illustrates a method of detecting port scans <NUM> comprising outlier pairs of ports <NUM>, in accordance with an embodiment of the present invention. In step <NUM>, using embodiments described in the description referencing <FIG> hereinabove, processor <NUM> identifies a set of port scans. To identify the set of port scans, processor <NUM> collects, during a predefined time period, communication sessions <NUM> and aggregates them into aggregated communication sessions <NUM>. Each aggregated communication session <NUM> comprises a given port scan <NUM> having a first given workstation <NUM> accessing at least one given communication port <NUM> on a second given destination <NUM>.

In step <NUM>, processor <NUM> computes, for each given port p scanned during the predefined time period, a probability Pp that that a given source node <NUM> accessed a given port p on a given destination node <NUM> in any port scan <NUM> during the predefined time period.

In step <NUM>, processor <NUM> computes, for each pair of ports p1 and p2, a joint probability JPp1,p2 of a connection between a given source node <NUM> and the ports p1 and p2 on a given destination node <NUM> in any port scan <NUM> during the predefined time period.

Upon computing JPp1,p2 for each pair of ports <NUM> that were scanned during the training period, in step <NUM>, processor <NUM> computes a Port Pair Score (PPS) that the system processor can use to identify pairs of ports p1 and p2 that have the following characteristics:.

To compute the Port Pair Score, processor <NUM> can use the following formula <MAT>.

In Equation (<NUM>), higher PPS scores indicate a pair of ports <NUM> that are (each) frequently scanned on the network, but are rarely scanned together on a given destination node <NUM> by a given source node <NUM> during the predefined time period. In embodiments of the present invention, the threshold for a high PPS score can be a high value. For example the threshold can be greater than <NUM>, greater than <NUM> or greater than <NUM>.

Finally, in step <NUM>, processor <NUM> identifies any of the source nodes that, during the predefined time period, scanned a pair of ports <NUM> having a high Port Pair Score, and the method ends. In embodiments of the present invention, a scanned a pair of ports <NUM> having a high Port Pair Score indicates that respective JPp1,p2 for the pair of ports p1 and p2 is lower than a threshold dependent upon the respective probabilities Pp of ports p1 and p2.

In one embodiment, the predefined time period may comprise multiple sub-periods that may have substantially identical time durations. In this embodiment, processor <NUM> can perform step <NUM> during any given sub-period in order to identify a given source node <NUM> that, during the given sub-period, scanned a pair of ports <NUM> having a high Port Pair Score. In another embodiment, the sub-periods comprise one or more first sub-periods followed by a second sub-period, and processor <NUM> can perform steps <NUM>-<NUM> on the one or more first sub-periods, and perform step <NUM> on the second sub-period.

Some scanning tools use a port scanning probe that comprises a given software application <NUM> loaded on one or more nodes <NUM> and is configured to scan other nodes <NUM> on the network, and to report results of a scan to a scanning server (e.g., a given node <NUM>). Scanning probes can be deployed in networks having nodes <NUM> that the scanning server cannot access directly with all the ports required for the scan (e.g., due to a firewall protecting a subset of the network). In operation, probes can be deployed on numerous network endpoints (i.e., nodes <NUM>) to randomly perform port scans, and then transmit results of the scans back to a given node (i.e., a server). Since scans performed by scanner probes may generate alerts, embodiments of the present invention enable processor <NUM> to whitelist scans performed by a given scanner probe.

<FIG> is a flow diagram that schematically illustrates a method detecting any deployed scanner probes, in accordance with an embodiment of the present invention. In step <NUM>, using embodiments described in the description referencing <FIG> hereinabove, processor <NUM> identifies a set of port scans. To identify the set of port scans, processor <NUM> collects, during a predefined time period, communication sessions <NUM> and aggregates them into aggregated communication sessions <NUM>. Each aggregated communication session <NUM> comprises a given port scan <NUM> having a first given workstation <NUM> accessing at least one given communication port <NUM> on a second given destination <NUM>.

In step <NUM>, processor <NUM> identifies, in the identified port scans, a group of high traffic ports <NUM>. In embodiments of the present invention, processor <NUM> can classify a given port <NUM> as having high traffic if the amount data traffic passing through the given port during the predefined time period exceeds a predefined threshold. Examples of predetermined thresholds include, but are not limited to <NUM>, <NUM> and <NUM> bytes. In some embodiments, the given port can be on a given node <NUM>. In other words processor <NUM> can classify the combination of the given node and the given port as having high traffic.

In operation, processor <NUM> can use volume <NUM> and/or rvolume <NUM> in the communication sessions of the aggregated port scan (i.e., corresponding to a given port scan <NUM>) to determine if the data traffic in a given port scan <NUM> exceeds the predefined threshold. In some embodiments, processor <NUM> can classify a given port <NUM> as having high traffic if the maximum amount of data passing through the given port in any given communication session (i.e., during a given port scan <NUM>) exceeds the predefined threshold.

In step <NUM>, processor <NUM> generates, for the identified port scans, respective signatures <NUM> indicative of the communication ports other than the high-traffic ports that were accessed in each of the port scans. In other words, a given signature <NUM> for a given port scan <NUM> may comprise a set of the communication ports that were accessed during the given port scan and that were not classified as having high traffic.

In step <NUM>, processor <NUM> computes a respective frequency of occurrence of each of the signatures over the set of the port scans, and in step <NUM> the processor assembles whitelist <NUM> by initializing the whitelist and then adding, to the whitelist, the signatures for which the respective frequency of occurrence is greater than a predefined threshold. In one embodiment, the frequency of occurrence for a given signature <NUM> may include information such as:.

In this embodiment, examples of specific thresholds include, but are not limited to:.

In some embodiments, processor <NUM> can use a combination of the thresholds to identify the signatures to add to the whitelist. For example, a given combination may be:.

Finally, in step <NUM>, processor <NUM> identifies any of the source nodes in the identified port scans having respective signatures not in the whitelist, and the method ends.

In one embodiment, the predefined time period may comprise multiple sub-periods that may have substantially identical time durations. In this embodiment, processor <NUM> can perform step <NUM> during any given sub-period in order to identify, in the given sub-period, a identified port scan <NUM> having respective signatures not in the whitelist. In another embodiment, the sub-periods comprise one or more first sub-periods followed by a second sub-period, and processor <NUM> can perform steps <NUM>-<NUM> on the one or more first sub-periods, and perform step <NUM> on the second sub-period.

Claim 1:
A method, comprising:
identifying, in data traffic transmitted between multiple nodes (<NUM>) that communicate over a network (<NUM>), a set of pairs of source and destination nodes, each pair consisting of a given source node and a given destination node, and one or more communication ports (<NUM>) on the given destination node in each pair that are accessed by the data traffic from the given source node;
identifying one or more noisy scanners, each of the noisy scanners comprising a given source node that accesses at least a specified first number of destination ports on at least a second specified number of destination nodes;
computing, for each pair in the set, a respective baseline level that is indicative of an average of a first number of the communication ports that source nodes other than the given source node in the pair and other than any of the identified noisy scanners, accessed on the given destination node during a first time period;
computing, for each pair in the set, a respective test score that is indicative of a difference between a second number of the communication ports that the given source node in the pair accessed on the given destination node during a second time period and the baseline level; and
initiating a preventive action with respect to the given source node in any of the pairs for which the test score is greater than a specified level.