Increase your Ping-Fu!

October 15, 2012 by . 4 comments

User George Duckett came across a weird thing while performing a simple ping:

He performed a simple ping request but missed a ‘dot’.  I assume he meant to ping 192.168.0.72 but instead ended up typing 192.168.072.  What’s really amazing though (as pictured below) was that it worked!!! but not to 192.168.0.72 it sent the ping request to 192.168.0.58 :

enter image description here

So how does this work?

Synetech gave an awesome answer (go up vote it) explaining what happens.  Basically, pings are interpreted by the command line based four parts separated by ‘dots’.  Leaving out the dots means assumed zeros.  For example:

1 part  (ping A)       : 0.0.0.A
2 parts (ping A.B)     : A.0.0.B
3 parts (ping A.B.C)   : A.B.0.C
4 parts (ping A.B.C.D) : A.B.C.D

But that’s not all.  You can send the ping command using multiple formats:

So, there are plenty of ways to represent an (IPv4) IP address. You can use flat or dotted-quad (or dotted-triple, dotted-double, or even dotted-single) format, and for each one, you can use (or even mix and match) decimal, octal, and hexadecimal. For example, you can ping google.com in the following ways:

  • google.com  (domain name)
  • 74.125.226.4  (dotted decimal)
  • 1249763844  (flat decimal)
  • 0112.0175.0342.0004  (dotted octal)
  • 011237361004  (flat octal)
  • 0x4A.0x7D.0xE2.0x04  (dotted hex)
  • 0x4A7DE204  (flat hex)
  • 74.0175.0xe2.4  (ಠ_ಠ)

 

So now you can play around with your friends with your ping-fu mad skilz:

enter image description here

4 Comments

Subscribe to comments with RSS.

  • Tim Murphy says:

    Off topic but why to the bother of pixelating your user name in the command prompt?

  • syss says:

    I also have found this very interesting thing someday.

    One thing should also be mentioned: If you try to ping an “ip” like this: 010.010.010.090 it resolves in a hostname on windows and unix. this is because the 0 at 090 normally indicates an octal number, but the digit 8 and 9 are not in the set of octal numbers anymore. So it is simply interpreted as the host 010 of subdomain 010 of domain 010 of tld 090.

    on windows you can also do some very weird pings

    ping ^0^x^A.^0^1^0^0.^0^0.^5^0

    the caret is the escape character but in this case it does not escape anything because the following characters are not escapeable.

  • Leave a comment

    Log in
    with Stack Exchange
    or