Convert an IPv4 address between dotted-decimal and octal notation.
Octal IP notation represents each octet in base-8 with a leading zero prefix (e.g. 192 decimal = 0300 octal). This format is recognized by some network utilities and programming languages, and has security relevance since leading-zero octets can be misinterpreted.
Decimal to octal per octet
octal_octet = '0' + base8(decimal_octet)
Some URL parsers interpret leading-zero octets as octal (e.g. 0300 = 192 decimal), while others treat them as decimal with a leading zero. This inconsistency can be exploited to bypass security filters that check IP addresses as strings.
Many Unix/Linux network utilities (ping, curl) and C-based socket libraries interpret leading-zero octets as octal per POSIX conventions. Windows and some modern parsers may not, leading to cross-platform inconsistencies.