Ping

From Hackepedia
Jump to navigationJump to search

ping is a tool written by the late Mike Muus to measure latency and round-trip time between two hosts connected by a network. Often it is also used to simply debug if the other host is up. It works by sending an ICMP type 8 (request) packet to the remote host which replies with an ICMP type 0 (reply) packet. Sometimes there is a firewall preventing a ping from receiving a reply.

This would look like so:

$ ping -c 1 www.yashy.com
PING mail.yashy.com (206.248.137.44): 56 data bytes
--- mail.yashy.com ping statistics ---
1 packets transmitted, 0 packets received, 100.0% packet loss

If you're using a packet sniffer you should see both the request and the reply if things are working unmolested.

# tcpdump -i rl0 host gateway.home.lan
18:13:30.601477 IP laptop.home.lan > gateway.home.lan: ICMP echo request, id 36372, seq 2, length 64
18:13:30.601773 IP gateway.home.lan > laptop.home.lan: ICMP echo reply, id 36372, seq 2, length 64

One of the original DoS was a simple ping flood. If you have more bandwidth then your victim, you can do

# ping -f example.com.

and slow your victim to a grinding halt.

A similar tool to ping would be traceroute.