Stage 4. - Network Connectivity
Ping
The next stage is to test the values that have been set during stages #1-3, allowing us to verify the network connection.
A method to do this, is to 'ping' a remote device. We can do this by sending out a IMCP echo request, and then waiting to see if we hear a IMCP response back.
However, depending on the remote device that was choose to be pinged - if they have a firewall in place and how its configured, it may not response back to a IMCP request.
In the example below, we used 'google.com'. The response back was 4 successful replies. The result of all of this, means we have successfully been able to communicate with the device at 'google.com'.
Code:
root@kali ~$ ping -c 4 google.com
PING google.com (62.252.173.153) 56(84) bytes of data.
64 bytes from m409-mp1-cvx1c.lan.ntl.com (62.252.173.153): icmp_req=1 ttl=128 time=16.3 ms
64 bytes from m409-mp1-cvx1c.lan.ntl.com (62.252.173.153): icmp_req=2 ttl=128 time=73.6 ms
64 bytes from m409-mp1-cvx1c.lan.ntl.com (62.252.173.153): icmp_req=3 ttl=128 time=60.0 ms
64 bytes from m409-mp1-cvx1c.lan.ntl.com (62.252.173.153): icmp_req=4 ttl=128 time=16.1 ms
--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3006ms
rtt min/avg/max/mdev = 16.166/41.539/73.633/25.757 ms
root@kali ~$
Errors in the following example indicate that there might be an issue with the DNS (either it is set to a bad value or the address that was requested doesn't exists - such as the case in this example):
Code:
root@kali ~$ ping -c 4 google232323232l32hj3k23k23k2jk32.com
ping: unknown host google232323232l32hj3k23k23k2jk32.com
root@kali ~$
This is a demonstration when there is an issue with the route (the gateway address):
Code:
root@kali ~$ ping -c 4 google.com
PING google.com (62.252.173.153) 56(84) bytes of data.
From 192.168.91.250 icmp_seq=1 Destination Host Unreachable
From 192.168.91.250 icmp_seq=2 Destination Host Unreachable
From 192.168.91.250 icmp_seq=3 Destination Host Unreachable
From 192.168.91.250 icmp_seq=4 Destination Host Unreachable
--- google.com ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 3048ms
pipe 3
root@kali ~$
Traceroute
This shows the amount of 'hops' (each router/gateway the packet is passed through), which have been taken to reach the remote machine (as well as display the path it took).
Note: Each device is separate and may have a firewall enabled on it, which as a result, will not display their result.
Code:
root@kali ~$ traceroute www.kali.org
traceroute to www.kali.org (50.116.53.73), 30 hops max, 60 byte packets
1 * * *
2 10.20.252.1 (10.20.252.1) 15.346 ms 15.253 ms 15.143 ms
3 * * *
4 brnt-bb-1c-ae4-0.network.virginmedia.net (213.106.244.69) 20.310 ms 20.378 ms 18.794 ms
5 brhm-bb-1c-et-410-0.network.virginmedia.net (62.253.175.210) 20.126 ms brhm-bb-1c-et-700-0.network.virginmedia.net (62.253.175.206) 21.258 ms 21.514 ms
6 * * *
7 linx.peer.nac.net (195.66.224.94) 92.073 ms 92.301 ms 89.861 ms
8 0.e3-2.tbr2.tl9.nac.net (209.123.11.145) 88.845 ms 90.246 ms 0.e3-2.tbr1.tl9.nac.net (209.123.11.141) 89.182 ms
9 0.e1-4.tbr2.mmu.nac.net (209.123.10.77) 91.806 ms 0.e1-4.tbr1.mmu.nac.net (209.123.10.101) 91.278 ms 0.e1-4.tbr2.mmu.nac.net (209.123.10.77) 93.700 ms
10 vlan805.esd1.mmu.nac.net (209.123.10.34) 94.203 ms 87.709 ms vlan803.esd2.mmu.nac.net (209.123.10.30) 87.830 ms
11 207.99.53.42 (207.99.53.42) 90.761 ms 207.99.53.46 (207.99.53.46) 91.333 ms 91.299 ms
12 cloudproxy81.sucuri.net (50.116.53.73) 149.309 ms 146.124 ms 146.148 ms
root@kali ~$