System-based recon techniques can involve gathering information by directly or indirectly interacting with a system. For example, an attacker can directly scan active hosts by interacting with the hosts (e.g., sending TCP SYN packets to them). The attacker can also gather information indirectly, without interacting with the target (e.g., observing or monitoring leaked information).
6.3.1 Remote System-based Reconnaissance Techniques.
Adversaries can perform remote reconnaissance techniques from a remote location to gather information using direct or indirect interaction with a system. Network scanning and sniffing are performed to discover active network resources from an external network or within an internal network. Effective scanning techniques often enable adversaries to find vulnerabilities and to compromise IT assets [
33]. This information can then be mapped to, e.g., a
Common Vulnerability and Exposure (CVE) database, which provides detailed information about publicly known vulnerabilities. Databases and categorization of CVEs are available at MITRE,
48 the National Vulnerability Database,
49 CVE Details,
50 and so on. Sniffing techniques are primarily used to capture network packets that reveal sensitive information such as user credentials and protocols being used in the network. One significant distinction between scanning and sniffing is that scanning techniques require direct interaction with the target system, while sniffing uses indirect interaction.
Scanning Techniques . Achleitner et al. categorized malicious network scanning based on the process of selecting addresses from a scanning space (e.g., IP address space) [
16]. According to the authors, network scanning includes uniform scanning (probing random hosts within a IP range), local-preference (preferring a particular region), preference-sequential (probing IP addresses sequentially), non-preference sequential (selecting random IP ranges), and preference-parallel (performing parallel scans).
Scanning techniques can be categorized as
stealthy or
non-stealthy scanning. With stealthy scanning techniques, adversaries leave minimal trace of the scan and its origin, which makes stealthy scanning difficult to detect using conventional security measures. Non-stealthy scans are more “aggressive,” and there is greater chance of being detected by an IDS. Stealthy scanning by bots is one of the most sophisticated techniques to efficiently gather information about a network [
54]. Botnets can be configured to perform a variety of scan types, including uniform scanning where every host is scanned with equal probability [
17], sequential scanning that systematically explores a space of IP addresses and/or ports [
17], and preferential scanning that uses additional information to bias the search to specific parts of the network, types of hosts, or ports [
15]. Botnet-based stealthy scanning is useful for discovering and compromising network infrastructure while minimizing detection by scanning from many hosts over multiple days [
54].
Scanning techniques can also be categorized as
horizontal scans,
vertical scans, and
coordinated/ distributed scans [
33]. If an adversary targets multiple ports on a single IP address, then the scan is vertical. A horizontal scan involves targeting a specific port on multiple IP addresses. A coordinated or distributed scan is a combination of both horizontal and vertical scans and can be launched from multiple scanning hosts (e.g., botnet-based scanning).
First, we discuss some of the most common low-level (i.e., network or transport layer) scanning techniques, emphasizing the network packet attributes.
•
TCP Scan with SYN/ACK Flag: There are several TCP scanning techniques that use SYN or ACK flags to scan a network. TCP SYN scan is a widely used scanning technique; it does not establish a full connection, which makes it relatively stealthy and fast. Adversaries can use the ACK flag to identify open ports as well.
–
TCP Connect: TCP connect scan establishes a full three-way handshake with hosts within the target IP range [
39]. It starts by sending a SYN packet from a client to the target host. The server responds with a SYN
\(|\)ACK packet (RST packet is sent if the port is closed). Finally, the client sends an ACK in return, establishing the full connection. TCP connect is the simplest scanning technique, and it can be performed without admin privileges, since it scans active ports, which does not require any special flag settings. However, this scan increases the chance of being detected by an IDS due to establishing an active session [
39].
–
TCP SYN Scan: SYN scan is a common scanning technique for identifying open and closed ports. SYN scan is also called a
half-open scanning technique, since it does not establish a full TCP connection [
105]. A SYN scan can be performed quickly within a given range of ports, and it is a relatively stealthy technique. To perform this scan, adversaries send a SYN packet to the target host, and wait to receive the response. If a
SYN or
ACK is received, then the port is open. If the response is
RST (reset), then the port is closed.
–
ACK Flag Probe Scan: This scanning technique sets the
ACK flag instead of the
SYN flag and determines if a port is open, closed, or unfiltered by analyzing the
Time-To-Live (TTL) and window fields within the RST packet header [
26]. The target port is open if the
TTL value is less than 64 or if the window value is not 0. Further, an ACK flag probe may also be able to differentiate between the presence of a stateful or stateless firewall and filtering rules by checking the response or error message (e.g., destination unreachable) [
105].
•
TCP Scan based on RST Response: Adversaries can set or unset several flags (e.g., FIN, PSH, URG) to perform stealthy scanning. Receiving a packet with RST means the port is closed; otherwise, it is open. A popular example of setting the flags is XMAS Scan. An inverse TCP scan sets either one flag or none in a TCP packet and is similar to XMAS Scan in terms of detecting open or closed ports.
–
XMAS Scan: XMAS scan is used to identify ports with the status open and closed [
43]. The scan involves manipulating the
PSH,
URG, and
FIN flags of a TCP header in crafted packets. An XMAS scan may bypass firewall and ACL filters, and it is fast as well [
105]. It is called “XMAS scan,” because if the packet is viewed within
Wireshark, then the enabled alternating bits look like a XMAS-tree.
–
FIN Scan: FIN scan is also a stealthy scanning technique, similar to the XMAS scan. However, only the
FIN flag is set [
57].
–
NULL Scan: NULL scan is a stealthy technique similar to XMAS and FIN scanning techniques, but no flag is set in the packet [
57]. The result is the same: ignored packet means open ports, while an
RST response indicates that the corresponding port is closed.
•
UDP Scan: UDP is simpler than TCP and does not provide the same variety of flag modification schemes as TCP does. However, a UDP scan can still be used to scan open UDP ports that provide a running service. In a UDP scan, a response is typically received if the port is closed. Typical open services such as DNS, VPN, SNMP, NTP, and so on, can be determined using UDP port scan [
105]. In some cases, it is possible to detect versions of services and operating systems as well [
105].
Listing scanning is another form of UDP scan that lists IP addresses and names by discovering hosts indirectly [
26]. The technique involves performing a reverse DNS resolution to determine hostnames.
•
ICMP Scan: A simple ICMP scan is performed to identify an active network device given a particular IP address [
30]. An “ICMP Covering Ping Sweep” can discover active hosts within a range of IP addresses and can list active nodes based on the subnets [
29].
•
ARP Scan: ARP scanning is a network discovery technique that works by broadcasting an ARP packet in the network and checking which hosts respond [
114]. Hosts that respond to the broadcast message are active hosts. The ARP scan is a low-level scanning technique that works in local area networks and is usually used to obtain both physical (MAC address) and logical (IPv4/6) addresses of active hosts.
Adversaries may be able to perform TCP, UDP, and ICMP scans from an external network, since all of these techniques are routable. Since ARP scan is non-routable, adversaries can perform it only in a local area network. Adversaries can start scanning hosts and ports locally once they have at least one compromised host in the target network.
Adversaries can also vary the attributes of network scans, including the speed, distribution, and destination of scanning [
33]. Depending on their motivations and on the defenses of the networks, adversaries may prefer a
slow scan approach to avoid detection [
51]. For example, if a port scanner is scanning a host with ports ranging from 1 to 1024 and with a time interval of 5 minutes between each port, then performing the scan will take approximately 85 hours. It is harder for defenders to match and trace these suspicious packets in a vast dataset of traffic over a longer period in a large enterprise system.
Table
4 shows the approach, target information, phases, and examples of publicly available tools for scanning techniques. Scanning techniques include ICMP, UDP, ARP, or TCP scanning techniques.
Type refers to whether the techniques are active or passive.
Target information is what adversaries are looking for using these techniques.
Phase denotes if a particular technique is utilized in external or internal phase. Finally, we include publicly available
tools that are used by security researchers as references. However, adversaries may use more sophisticated techniques, such as exploiting services or software vulnerabilities without crashing, performing reconnaissance as regular users, and so on, to avoid detection [
148].
Attackers can also perform
application-level scanning techniques, such as banner grabbing, operating system and application fingerprinting. Here, we discuss some of the common techniques. Table
5 presents the approach, target information, phases, and examples of publicly available tools for different application-level scanning techniques.
•
Banner Grabbing: Banner grabbing is a vulnerability scanning techniques that uses application banner information, including name and version [
140]. There are two types of banner grabbing: active and passive. Active banner grabbing requires establishing TCP connections with a remote host to send crafted packets. Adversaries then receive and process the response. Passive banner grabbing involves passive sniffing techniques to capture and analyze network packets. Active banner grabbing techniques are more prone to detection by the defender. Adversaries usually target service ports, such as HTTP, FTP, and SMTP services (ports 80, 21, and 25, respectively). Using banner grabbing techniques adversaries can potentially map an entire network [
31].
•
Fingerprinting: Fingerprinting is a method of analyzing response packets to determine the operating system, application version (e.g., web server), or network protocol (e.g., SNMP). Often, the operating system and/or the application reply with packets that expose the platform and version in the packet header. Adversaries can analyze the response packets, compare the values against a dataset of various operating systems and versions, and identify the OS version (e.g., APT32 [
53]). Information can also be obtained by examining error-message responses.
Sniffing Techniques . Adversaries can perform sniffing to capture and analyze unencrypted network packets [
49] to collect information like user credentials, e.g., usernames and passwords sent in plaintext. Network packets may also contain information about installed operating systems, applications, protocol versions, source, and destination ports, packet and frame sequences, and so on. By analyzing packets frame by frame, adversaries may be able to find misconfigurations and vulnerabilities in services. Some protocols are particularly vulnerable to sniffing; for example, Telnet can expose keystrokes (names and passwords), HTTP can reveal data sent in clear texts, SMTP/NMTP/POP/FTP/IMAP can reveal passwords or data sent in cleartext.
Sniffers usually operate in the data link layer of the OSI model. The objective is to compromise the communication channel before the defender in the upper layers is aware and prevents attacks. Attackers often place physical hardware sniffers or network analyzers if they can manage physical access (or a malicious insider) to an organization network (e.g., connect to the SPAN port of a switch that broadcasts all incoming or outgoing traffic).
Passive sniffing or directly capturing packets is performed for discovering network protocols and services, as well as active hosts and ports [
49]. Many packet capturing and analysis tools are available on the market; for example, SolarWinds Network Performance Monitor,
51 ManageEngine NetFlow Analyzer,
52 tcpdump,
53 WinDump,
54 and Wireshark.
55 These are publicly available tools marketed to network admins, but may be used by adversaries as well. Adversaries can also perform scans using tools and scripts that are customized for a particular vulnerability to remain undetected for a longer period [
158].
Active sniffing involves traffic flooding or spoofing attacks to capture traffic or redirect the traffic towards a host controlled by the attacker. Active sniffing is usually performed in a switched network where the attacker might need to use these techniques to capture network traffic.
•
MAC Flooding: MAC flooding involves flooding a switch with abundant mapping requests so that the switch overflows at some point [121]. Eventually, the switch acts as a hub and starts broadcasting all packets, making it easy for the attacker to capture packets. •
ARP Spoofing: In this techniques, the attacker usually generates a lot of forged ARP requests and reply packets to flood a switch. When flooded with spoofed ARP requests, the switch is set to “forwarding mode” and it is easier for the attacker to capture packets. The attacker can also try to poison the target’s ARP table with forged entries that eventually lead to sophisticated attacks like Denial-of-Service and man-in-the-middle (MITM) [130]. •
MAC Duplicating/Spoofing: The attacker can spoof the MAC address of an active target [27]. By duplicating the MAC address, the attacker can take over someone’s identity. The technique is useful to gain access to the network if the target MAC address is used to authorize network access. However, this attack is easily detectable by the defender. •
DHCP Starvation: In this technique, the attacker sends “DHCP discovery” to the routers and attempts to lease all the available IP addresses [115]. DHCP starvation is sort of a Denial-of-Service (DoS) attack using DHCP requests. The primary reason for using this technique is to set up a rogue DHCP server that provides IP addresses to others joining the network. Then the attacker can establish the wrong IP, gateway, or DNS servers; used to capture packets. •
DNS Poisoning: DNS poisoning is performed by tricking a DNS server into believing the attacker has authentic information that allows the attacker to replace valid IP address entries with fake entries [27]. For example, the attacker can replace a valid IP entry with the IP of a fraud or a phishing site for social engineering or stealing information. The attacker can perform a DNS poisoning attack in two ways: within an internal network, or intranet (LAN), or replace entries stored in a proxy server. DNS poisoning helps the attacker to bypass security toolbars and phishing filters [14]. Table
6 presents the approach, target information, phases, and examples of publicly available tools for different sniffing techniques. Passive sniffing refers to listening to the network traffic where the active sniffing techniques are used to enable attacker capture packets in a switched network. Some of these techniques can be performed both externally or internally; other techniques are used within the local area network. Some remote side-channel attacks (e.g., timing or fault analysis) are used to reveal information by sending payloads and then analyzing the responses.
•
Timing Attack: Leaked timing information from the CPU or memory can be utilized to determine the secret key of a crypto-system or algorithm (e.g., elliptic curve scalar multiplication algorithms). The time samples are gathered using various inputs and placed into a statistical model that predicts the key with a high degree of certainty [
95,
123].
•
Differential Fault Analysis (DFA): DFA is used primarily for performing cryptanalysis on several cryptographic algorithms (e.g., DES). To compute the amount of leaked information in a practical DFA attack, the attacker must first analyze the distribution of the leaked information and restrict the keyspace. The secret key can be discovered by using appropriate information estimate modeling [
126].