🌐Network Hack : Able to ping Google but not Facebook 👨🏼‍💻

Tamim Dalwai
4 min readDec 18, 2020

--

PING → Google ✅ || Facebook ❌

Hola folks, Welcome again !!!!!

In this article, i am going to manipulate my system in such a manner that it can be able to ping the google but not facebook…sounds impossible ???

Not at all, it is possible to do so 💡…Then Let’s get started.

First of all let’s discuss some interesting terminologies related to network.

🔰 WHAT ARE ROUTERS ?

A router is a networking device that forwards data packets between computer networks. Routers perform the traffic directing functions on the Internet. Data sent through the internet, such as a web page or email, is in the form of data packets. A packet is typically forwarded from one router to another router through the networks that constitute an internetwork (e.g. the Internet) until it reaches its destination node.

A router is connected to two or more data lines from different IP networks. When a data packet comes in on one of the lines, the router reads the network address information in the packet header to determine the ultimate destination. Then, using information in its routing table or routing policy, it directs the packet to the next network on its journey.

🔰 WHAT IS ROUTING TABLE ?

Arouting table is analogous to a distribution map in package delivery. Whenever a node needs to send data to another node on a network, it must first know where to send it. If the node cannot directly connect to the destination node, it has to send it via other nodes along a route to the destination node. Each node needs to keep track of which way to deliver various packages of data, and for this it uses a routing table. A routing table is a database that keeps track of paths, like a map, and uses these to determine which way to forward traffic.

The primary function of a router is to forward a packet toward its destination network, which is the destination IP address of the packet. To do this, a router needs to search the routing information stored in its routing table. The routing table contains network/next hop associations. These associations tell a router that a particular destination can be optimally reached by sending the packet to a specific router that represents the next hop on the way to the final destination. The next hop association can also be the outgoing or exit interface to the final destination.

!~ Command : 
# route -n : to check routing table in the system
route -n
192.168.42.129 : is the default gateway provided by the router by which can travel to internet world.

🔰 OBTAINING IP OF GOOGLE & FACEBOOK ?

Let’s obtain ip addresses of www.google.com & www.facebook.com with the help of ping command :

!~ commands:  
# ping www.google.com
# ping www.facebook.com
ping facebook
ping google
!~ OBTAINED IP ADDRESSES : 
FACEBOOK = 157.240.16.35
GOOGLE = 172.217.160.196

🔰 DELETING UNIVERSAL ROUTE RULE :

By default router provides route rules in the table. In which first rule is defined as 0.0.0.0 , which is actually universal ip address(any ip in the world).That rule is the reason to get connect with the internet’s all the ip addresses. So we are going to delete this rule because we want to manually add ip addresses of google in this table so that it can only able to ping google.

!~ commands:
# route -n : to get route table information
# route del -net 0.0.0.0 : removing route rule from table
0.0.0.0 rule is removed

After deleting this rule, now if you try to ping facebook or google it fails, as we have deleted universal rule from routing table.

PING FAILED

🔰 ADDING GOOGLE IP RULE TO ROUTE TABLE :

Now let’s add google’s ip address rule in the table, so that it can reach to the google.com

!~ commands: 
# route add -net 172.217.160.0 netmask 255.255.255.0 gw 192.16842.129 enp0s3

Let’s check the route table again to verify whether rule is added to the table.

Rule is added successfully

🔰 FINAL TEST :

All setup is done…now let’s ping www.google.com

PING www.google.com

That’s great, our system is pinging to google ✅. Now let’s try to ping facebook.

PING www.facebook.com

SUCCEED 👍, So as you can see our system is able to connect to google but not facebook. I hope you liked this article…

😃 Thanks for reading ! 😃

✍Keep Learning, Keep Sharing✍

--

--

No responses yet