Better HN
topnewbestaskshowjobs
Log inSign up

123048713

5 karma · joined May 14, 2020 (6y ago) · 1 submissions

Submissions

comment 6y ago · link · parent

You can have a lot more fun than that if you want to break things. An IP address has lots of valid formats nobody uses.

    ;; ANSWER SECTION:
    wikipedia.org.  599 IN A    208.80.154.224
Lets try this in decimal:

http://3494943456/

Sort of cool, but what happens if we overflow it by adding 232?

    >>> 3494943456 + 2**32
http://7789910752/

I mean that's cool, but how far can we go?

    >>> 3494943456 + (2**32) ** 2

http://18446744077204495072/

So that still works, what about going further?

    >>> 3494943456 + (2**32) ** 100

http://19769064789825639936542264398379633403153906826257738...

Going further actually breaks some browsers (Firefox can handle longer than Internet Explorer for example), breaks web servers because they log the full version before it is transformed, and even acts as a fingerprinting vector. The limit is usually in the several hundred kilobyte range, and depending on the way that the underlying operating system handles it, things get seriously broken very quickly.