Live data from Hacker News

This is a valid ipv4 address

184.172.10.74

11–20 of 101 posts

Re: This is a valid ipv4 address

#11
post #7

How can I encode any ip address?

The normal way of displaying the ip address for HN is `184.172.10.74`. You then just have to take each 4 parts and multiply it with a power of 256:

    184 * 256^3 + 172 * 256^2 + 10 * 256^1 + 74 * 256^0 == 3098282570

Re: This is a valid ipv4 address

#12
post #5

The decoded URL for this submission is http://184.172.10.74/ — the server for Hacker News. Here's some other encodings you can use for the same address, they're all valid and recognised by most browsers and other software: http://3098282570/ http://7393249866/ http://0xb8.0xac.0x0a.0x4a/ http://0270.0254.0012.0112/ The source for this comment is an XSS filtering bypass tool by RSnake — http://ha.ckers.org/xsscalc.htm…

http://7393249866/ doesn't seem to work in chrome as it doesn't believe it's a link. Entering it directly in the URL-bar doesn't work either. All of the others is shown as `184.172.10.74` on mouse-over.

Re: This is a valid ipv4 address

#13
post #5

The decoded URL for this submission is http://184.172.10.74/ — the server for Hacker News. Here's some other encodings you can use for the same address, they're all valid and recognised by most browsers and other software: http://3098282570/ http://7393249866/ http://0xb8.0xac.0x0a.0x4a/ http://0270.0254.0012.0112/ The source for this comment is an XSS filtering bypass tool by RSnake — http://ha.ckers.org/xsscalc.htm…

I recognize the other formats, but what format is " http://7393249866/" ? It opens about:blank in chrome. How is it distinguished from the format above it?

7393249866 mod 2^32 is 3098282570. I'm not convinced you can do that - although it works in Firefox, telnet and ping don't like it.

Edit: I highly doubt that this is standard behavior. I suspect that implementations that permit this are storing the number in a 32 bit integer and not checking to see that it was truncated.

Re: This is a valid ipv4 address

#15
post #13

Earlier quoted context omitted.

I recognize the other formats, but what format is " http://7393249866/" ? It opens about:blank in chrome. How is it distinguished from the format above it?

7393249866 mod 2^32 is 3098282570. I'm not convinced you can do that - although it works in Firefox, telnet and ping don't like it. Edit: I highly doubt that this is standard behavior. I suspect that implementations that permit this are storing the number in a 32 bit integer and not checking to see that it was truncated.

ping and other command line tools don't mind it for me on OSX, I don't know what the distinction between them would be though.

    $ ping 7393249866
    PING 7393249866 (184.172.10.74): 56 data bytes
    64 bytes from 184.172.10.74: icmp_seq=0 ttl=47 time=259.042 ms

Re: This is a valid ipv4 address

#18
post #5

The decoded URL for this submission is http://184.172.10.74/ — the server for Hacker News. Here's some other encodings you can use for the same address, they're all valid and recognised by most browsers and other software: http://3098282570/ http://7393249866/ http://0xb8.0xac.0x0a.0x4a/ http://0270.0254.0012.0112/ The source for this comment is an XSS filtering bypass tool by RSnake — http://ha.ckers.org/xsscalc.htm…

I didn't use bypass tool you've mentioned.

This small ruby script

    #!/usr/bin/ruby
    a, b, c, d = $*[0].split('.').map(&:to_i)
    i = a * 256**3 + b * 256**2 + c * 256 + d
    puts "dec: http://#{i}"
    puts "hex: http://0x#{i.to_s(16)}"
    puts "oct: http://0#{i.to_s(8)}"
..yields the following:

    % ip2dword 184.172.10.74
    dec: http://3098282570
    hex: http://0xb8ac0a4a
    oct: http://027053005112

Re: This is a valid ipv4 address

#19
post #13

Earlier quoted context omitted.

I recognize the other formats, but what format is " http://7393249866/" ? It opens about:blank in chrome. How is it distinguished from the format above it?

7393249866 mod 2^32 is 3098282570. I'm not convinced you can do that - although it works in Firefox, telnet and ping don't like it. Edit: I highly doubt that this is standard behavior. I suspect that implementations that permit this are storing the number in a 32 bit integer and not checking to see that it was truncated.

It seems to work in Safari as well. I sort of understand the dword format, but why would this be useful, or a standard?
Post reply on HN