by nwh · 13y ago · 0 comments
Here's some other encodings you can use for the same address, they're all valid and recognised by most browsers and other software:
The source for this comment is an XSS filtering bypass tool by RSnake — http://ha.ckers.org/xsscalc.html
http://184.11274826/ http://184.172.2634/
The rule here is that the last (but apparently only the last) numeric component may encode multiple bytes.
127.0.0.1 == 127.1
10.0.0.1 == 10.1
192.168.0.1 == 192.168.1
Which system do you use that this works on?
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://027053005112Edit: 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 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 ms4.2.2.1 or 0x04020201?
Mostly readability and speed of typing, I would think.
Does anyone know why Facebook does that?
http://[0:0:0:0:0:ffff:b8ac:a4a]
http://asdf:qwerty@3098282570/
http://asdf:qwerty@[0:0:0:0:0:ffff:b8ac:a4a]:80
(Might get a security/phishing warning on the last two links in some browsers.)