Whole "Ping" section in MD // The name ping comes from the sound of a sonar pulse. You send out a signal and listen for the echo to come back. In networking, the ping command does the same thing. It sends a small test packet to a remote host and waits for a reply. This simple exchange tells you whether the target is reachable over the network and whether it is online and responding. How Ping Works Ping uses the ICMP protocol (Internet Control Message Protocol). It sends an ICMP Echo Request packet (type 8). If the target receives the packet and is permitted to answer, it sends back an ICMP Echo Reply (type 0). This exchange is very lightweight and fast, which is why ping became the standard first check before spending time on more detailed scanning. Basic Usage On Linux and macOS, use the -c flag to specify the number of packets to send. bash ping -c 5 MACHINE_IP You can also ping a hostname, in which case DNS resolution happens first. bash ping -c 5 https[:]//tryhackme[.]com/ On Windows, the equivalent flag is -n. cmd ping -n 5 MACHINE_IP If you omit the count on Linux, ping runs indefinitely. Press Ctrl+C to stop it. You can force a specific IP version using the -4 and -6 flags. This is useful in dual-stack environments where a hostname resolves to both IPv4 and IPv6 addresses. On some systems, ping6 is available as a standalone command for IPv6. bash ping -4 -c 5 MACHINE_IP ping -6 -c 5 MACHINE_IPV6 Interpreting the Output: Successful Ping The following example shows a target that is alive and allows ICMP. bash user@AttackBox$ ping -c 5 MACHINE_IP PING MACHINE_IP (MACHINE_IP) 56(84) bytes of data. 64 bytes from MACHINE_IP: icmp_seq=1 ttl=64 time=4.812 ms 64 bytes from MACHINE_IP: icmp_seq=2 ttl=64 time=4.278 ms 64 bytes from MACHINE_IP: icmp_seq=3 ttl=64 time=4.941 ms 64 bytes from MACHINE_IP: icmp_seq=4 ttl=64 time=4.503 ms 64 bytes from MACHINE_IP: icmp_seq=5 ttl=64 time=4.845 ms --- MACHINE_IP ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4098ms rtt min/avg/max/mdev = 4.078/4.504/4.941/0.?? ms The target answered all five requests, confirming it is online and reachable. The 0% packet loss confirms a clean network path. The round trip time of approximately 0.5 ms is very low, indicating the target is likely on the same local network. The TTL (Time To Live) field deserves particular attention. Although “Time” appears in the name, TTL actually represents the maximum number of routers (hops) a packet can pass through before being dropped. Each router along the path decrements the TTL by one. The initial TTL value is set by the operating system, which makes it a useful indicator for OS fingerprinting. Linux typically uses a starting TTL of 64, while Windows typically uses 128. However, intermediate routers decrement this value before it reaches you. A TTL of 58 in response is likely indicative of a Linux system: it is six hops away, not a different operating system. Interpreting the Output: No Reply bash user@AttackBox$ ping -c 5 MACHINE_IP PING MACHINE_IP (MACHINE_IP) 56(84) bytes of data. From ATTACKBOX_IP icmp_seq=1 Destination Host Unreachable From ATTACKBOX_IP icmp_seq=2 Destination Host Unreachable From ATTACKBOX_IP icmp_seq=3 Destination Host Unreachable From ATTACKBOX_IP icmp_seq=4 Destination Host Unreachable From ATTACKBOX_IP icmp_seq=5 Destination Host Unreachable --- MACHINE_IP ping statistics --- 5 packets transmitted, 0 received, +5 errors, 100% packet loss, time 4098ms There are several common reasons for receiving no reply. The lab machine may be powered off, crashed, or still booting. A router or firewall along the path may be blocking ICMP requests. The target may be behind NAT that drops ICMP. Windows Firewall blocks ping by default on most versions. Corporate firewalls, cloud providers such as AWS, Azure, and GCP, and modem WAFs and DNS frequently block ICMP completely. Your network or machine may also be blocking outgoing ICMP. Quick Reference Result Most likely meaning Next step Fast replies, low or no packet loss Target is online and allows ICMP Proceed to port scanning “Destination Host Unreachable” Target is down or no route exists Check if the machine is powered on 100% packet loss with no error message ICMP is filtered or blocked Try TCP/UDP host discovery with Nmap High latency or packet loss Network congestion, long distance, or filtering Investigate the path with traceroute // Result Most likely meaning Next step Fast replies, low or no packet loss Target is online and allows ICMP Proceed to port scanning “Destination Host Unreachable” Target is down or no route exists Check if the machine is powered on 100% packet loss with no error message ICMP is filtered or blocked Try TCP/UDP host discovery with Nmap High latency or packet loss Network congestion, long distance, or filtering Investigate the path with traceroute