The Spanner logo
    • Home
    • Blog
      • Blog home
      • RSS
    • Login
    • Home
    • Blog
      • Blog home
      • RSS
    • Login
    The Spanner logo

    The Spanner
    Web security blog

    Made by Gareth Heyes
    Follow me on Twitter: @garethheyes

    Javascript for hackers!

    Hackvertor logo
    Shazzer logo
    My Github account
    Recent posts
    Pure-CSS 3D world collision detection How to write a Hackvertor tagIntroducing Feedworm: A Privacy-First RSS Reader That Lives in DevToolsSpeedy RSVP extensionAutoVaderHackvertor history and tag finderShadow Repeater v1.2.3 releaseBurp Hackvertor v2.1.24 releaseHacking roomsXSSing TypeErrors in SafarivalueOf: Another way to get thisMaking the Unexploitable Exploitable with X-Mixed-Replace on FirefoxThe curious case of the evt parameterCSS-Only Tic Tac Toe ChallengeRewriting relative urls with the base tag in SafariBypassing DOMPurify with mXSSNew IE mutation vectorHow I smashed MentalJSMentalJS DOM bypassAnother XSS auditor bypassXSS Auditor bypassBypassing the IE XSS filterUnbreakable filterMentalJS bypassesmXSSJava SerializationBypassing the XSS filter using function reassignmentRPOSandboxed jQueryX-Domain scroll detection on IE using focusEpic fail IEnew operatorDecoding complex non-alphanumeric JavaScriptHacking FirefoxDOM ClobberingBypassing XSS AuditorThe evolution of codeNon-Alpha PHP in 6-7 charsetTweetable PHP-Non AlphaMentalJS for PHP

    IP conversion

    By Gareth Heyes (@hackvertor)

    Published 17 years 9 months ago • Last updated March 22, 2025 • ⏱️ 2 min read

    ← Back to articles

    I've been busy investigating URLs recently and I thought my Hackvertor tool had all ways of changing a IP covered. But after researching stuff over the weekend I found that it is lacking in certain areas. For example you can convert two octets to octal or hex and there wasn't really a easy way of doing this with the current tags.

    Decoding this stuff can also be useful especially if you are analysing malware and want a quick way to decode a few obscured IPs. The decoders detect if you are trying to decode full IP addresses or part of an IP.

    The tags supported are ip2dword which converts a IP to a decimal number, it includes the ability to encode it a few times with the parameter. This is possible because the unused hex numbers are discarded by the application, examples of how to use this are available below. ip2hex and ip2oct allow you to encode a full or part of a IP address (the rightmost part) with hex or octal. Each tag has a alternative decode.

    Examples

    I'll use Google's IP as a example 216.239.59.99

    First we can use ip2dword to convert it to decimal:- dword conversion

    It also supports a parameter which allows you to encode it a few more times:- dword multiple

    You can also encode part of the IP and the tags are clever enough to detect this automatically:- dword part encode

    Finally I'll show you how to use the octal and hex encoding in full or part of a IP address, I've included a part decode example as well which decodes the last two octets of the IP:- hex, octal and decoding

    ← Back to articles