1.4 Scanning and Enumeration
After the active and passive reconnaissance stages of system hacking have been completed, scanning is performed. Scanning is used to determine whether a system is on the network and available. Scanning tools are used to gather information about a system such as IP addresses, the operating system, and services running on the target computer.
Scanning is the process of locating systems that are alive and responding on the network. Ethical hackers use it to identify target systems’ IP addresses.
Qlists the three types of scanning.
Port scanning is the process of identifying open and available TCP/IP ports on a system.
Ports are virtual communication endpoints used by network protocols to enable communication between devices.
Port-scanning tools enable a hacker to learn about the services available on a given system. Each service or application on a machine is associated with a well-known port number. For example, a port-scanning tool that identifies port 80 as open indicates a web server is running on that system. Hackers need to be familiar with well-known port numbers.
Common port scanning techniques include SYN scanning (also known as half-open scanning), TCP connect scanning, UDP scanning, and stealth scanning (e.g., using tools like Nmap).
Network scanning
Network scanning involves the comprehensive scanning of an entire network or range of IP addresses to identify active hosts, devices, and network infrastructure components.
Network scanning is a procedure for identifying active hosts on a network, either to attack them or as a network security assessment.
Hosts are identified by their
individual IP addresses.
Network-scanning tools attempt to identify all the live or responding
hosts on the network and their corresponding IP addresses.
Network scanners send probes or packets to target IP addresses, examining responses to determine the status and characteristics of network devices (e.g., routers, switches, firewalls).
Network scanning techniques include ping sweeps, ARP scanning, TCP SYN scanning, OS fingerprinting, and service version detection.
Vulnerability scanning
Vulnerability scanning is the process of proactively identifying the
vulnerabilities of computer systems on a network.
It involves scanning target systems for known security vulnerabilities, weaknesses, misconfigurations, and software flaws that could be exploited by attackers.
Generally, a vulnerability scanner first identifies the operating system and version number, including service packs that may be installed.
Then, the vulnerability scanner identifies weaknesses or vulnerabilities in the operating system. During the later attack phase, a hacker can exploit those weaknesses in order to gain
access to the system.
Vulnerability scanners automate the process of identifying vulnerabilities by comparing system configurations, software versions, and patch levels against a database of known vulnerabilities
Examples of vulnerability scanning tools include Nessus, OpenVAS
CEH Scanning Methodology
The Certified Ethical Hacker (CEH) scanning methodology outlines the systematic approach used by ethical hackers and cybersecurity professionals to conduct network reconnaissance, identify potential vulnerabilities, and assess the security posture of computer networks. It ensures that no system or vulnerability is overlooked and that the hacker gathers all necessary information to perform an attack.
- Check for Live systems
to identify active hosts on the network and Determine which IP addresses are responsive and reachable, indicating live systems.
network scanning techniques, such as ping sweeps or ICMP echo requests is used - Check for Open Ports
identify open ports on live systems.
tools like Nmap to scan for open TCP and UDP ports, revealing potential entry points into the network are used - Service Identification
the services running on open ports are determined by sending probes to each port to gather information about the corresponding services.
Identify the protocols, versions, and configurations of the services running on the open ports. - Banner Grabbing/Os Footprinting
banner grabbing is performed to extract additional information about the services, such as service banners or version strings.
Banner grabbing involves opening a connection to a target system and reading the banner or response sent by the application running on that system.
OS fingerprinting techniques is used to identify the operating system running on the target hosts based on responses to network probes. - Vulnerability Scanning
to identify known security vulnerabilities and weaknesses in the target systems.
Use vulnerability scanning tools like Nessus, OpenVAS, - Draw network diagrams of vulnerable hosts
Documentation of the network architecture and layout is done and network diagrams to visualize the relationships between hosts, subnets, and network segments are created. - Prepare Proxies
proxy servers or intermediary systems to anonymize and obfuscate the source of attacks is created
Proxy service route network traffic through intermediary hosts hiding the attacker's IP, address and location. - Attack
Finally,Exploitation of the vulnerabilities identified during the scanning and reconnaissance phases to gain unauthorized access to target systems.
Ping Sweep Techniques
- The simplest, although not necessarily the most accurate, way to determine whether systems are live is to perform a ping sweep of the IP address range.
- A ping sweep is also known as an ICMP sweep or ping scan.
- It is a network scanning technique used to identify live hosts within a range of IP addresses.
- It involves sending ICMP echo requests (ping) to multiple IP addresses and analyzing the responses to determine which hosts are active and reachable on the network
- All systems that respond with a ping reply are considered live on the network.
- Ping sweep can be performed using command-line utilities or network scanning tools that support ICMP echo requests.
- Common tools include the ping command in Unix/Linux, ping utility in Windows, and network scanning tools like Nmap.
- multiple ICMP echo requests can be sent simultaneously to multiple IP addresses.
- Parallel ping sweep tools can send ICMP echo requests in parallel threads, allowing for faster scanning of large IP address ranges.
- Instead of scanning entire IP address ranges, targeted ping sweeps focus on specific subnets, IP ranges, or network segments.
Detecting Ping Sweeps / its Limitation
- One considerable problem with this method is that personal firewall software and network based firewalls can block a system from responding to ping sweeps.
- Another problem is that the computer must be on to be scanned.
- Most modern intrusion detection systems (IDS) and intrusion prevention systems (IPS) are configured to detect and alert on unusual network activity, including ping sweeps.Ping sweeps generate a significant amount of ICMP traffic, which can trigger alarms in network monitoring systems.
- If ping sweeps do not yield conclusive results due to network defenses or configuration settings, attackers may resort to more intensive port scanning techniques.
Port Scanning
Identifying Service
Service identification is the third step in the CEH scanning methodology
For example, port 80 is commonly associated with HTTP (Hypertext Transfer Protocol) used for web traffic
Port-Scan Countermeasures
minimizes the risk of exposing network vulnerabilities.
- Deploy IDPS- Intrusion Detection and Prevention Systems solutions to monitor network traffic for suspicious or anomalous behavior associated with port scanning activities.
- Firewall Configuration:
Configure firewalls to block or restrict access to unused ports and services.Use stateful inspection and deep packet inspection (DPI) to analyze incoming and outgoing traffic and enforce security policies. - Only needed ports should be kept open. The rest should be filtered or blocked.
- The staff of the organization using the systems should be given appropriate training on security awareness. They should also know the various security policies they’re required to follow.
- Network IDS should be used to identify the OS-detection method used by some common hackers tools, such as Nmap.
- Deploy honeypots and honeynets to deceive and gather information about potential attackers
- Conduct regular security audits and vulnerability assessments to identify and remediate security weaknesses, misconfigurations, and outdated software.
Nmap (Network Mapper) is a powerful open-source network scanning tool used for discovering hosts and services on a computer network, thus creating a "map" of the network.
- TCP Connect Scan:Also known as full connect scan, this technique establishes a full TCP connection with each target port to determine its status (open, closed, or filtered). TCP connect scan is more reliable than SYN scan but may be slower and more easily detected by security devices.
- Xmas Tree scan : sends packets with various flags set (FIN, URG, and PSH).The attacker checks for TCP services by sending XMAS-tree packets,
- SYN stealth scan : this is also known as half-open scanning The hacker send a SYN packet and receives a SYN-ACK back from the server. It’s stealthy because a full TCP connection isn’t opened.
- Null scan : This is an advanced scan that may be able to pass through firewalls undetected or modified. Null scan has all flags off or not set. It only works on UNIX systems.
- Windows scan This type of scan is similar to the ACK scan and can also detect open ports.
- ACK scan This type of scan is used to map out firewall rules. ACK scan only works on UNIX. ACK scan does not attempt to determine whether ports are open or closed but focuses on identifying filtering rules.
If a port is closed, the target system responds with a RST (reset) packet to indicate that no service is listening on that port.
If a port is filtered by a firewall or other network device, the target system may not respond at all, or it may respond with an ICMP error message (e.g., ICMP unreachable).
SYN scans are considered stealthy and less likely to be detected by intrusion detection systems (IDS) and firewall logs compared to full connect scans.
Comments
Post a Comment