Thursday, November 20, 2014

URL Magic - Rare IP address notations

URL (Uniform Resource Locator). We might have heard in this WWW era. Forgetting the intricate details of its implementation, an URL simply means a web address. The RFC of the URI can be found here. This post is just about its rare formats. (For details, refer to the section 7.4 in the RFC)

Rare formats
These rare formats are just for fun. This is not widely used because, it's hard for people to remember and you have to decode it everytime. Nevertheless, this is a good way to hide bookmarks or you can use it as prank with your friends.

Hexadecimal and octal notation
Get the IP address of your favorite website by pinging it. Convert each octet into different format. Paste it in the URL area of the browser. It would still work.
For instance, pinging google.com gives this IP 173.194.113.168 for me. This is the cryptic notation of the same IP. This would still work. :-)

http://0xad.0xc2.0161.168

How about this?

http://0XADC271A8
http://2915201448

The above are 32-bit representation of the IP addresses. Every octet is just represented in its hexadecimal form. In the second format the hexadecimal number is converted to an Integer.

Another notation is that the IP address is split into two parts.

http://0xad.0xC271A8

In the above, the first octet is interpreted as it is and the rest are just coalesced into one.

It's really fun to know about this. Start fooling your friends ;-)

Page Counter