i.crave.beer – The online home of Joshua Skorich

1st March 2014

IP Manipulator

I finally got around to posting my IP Manipulator to Github. The purpose of the project is to convert (manipulate) an IP address into various forms.

IP addresses are valid in decimal, octal, and hexadecimal formats. Dotted notation is also valid , so suffixes can be grouped together.

Basic usage:
./IP_Manipulator.py 192.168.1.1

Output to stdin:

IP Address Manipulator
-------------------------------------
192.168.1.1 ----> 192.168.1.1
192.168.1.1 ----> 192.168.257
192.168.1.1 ----> 192.11010305
192.168.1.1 ----> 3232235777
192.168.1.1 ----> 0xc0.0xa8.0x1.0x1
192.168.1.1 ----> 0xc0.0xa8.0x101
192.168.1.1 ----> 0xc0.0xa80101
192.168.1.1 ----> 0xc0a80101
192.168.1.1 ----> 0300.0250.01.01
192.168.1.1 ----> 0300.0250.0401
192.168.1.1 ----> 0300.052000401
192.168.1.1 ----> 030052000401

Output to a file without header info is also simply accomplished via:
./IP_Manipulator.py 192.168.1.1 -f output.txt

Output.txt example:

192.168.1.1
192.168.257
192.11010305
3232235777
0xc0.0xa8.0x1.0x1
0xc0.0xa8.0x101
0xc0.0xa80101
0xc0a80101
0300.0250.01.01
0300.0250.0401
0300.052000401
030052000401

Project available at https://github.com/joshuaskorich/IP-Manipulator

Designed for Python 2.X