Skip to main content

Generate a list of IPs for a given Network ID

Project description

# IPGenerator

####################################
__Program__: IPGenerator
__version__: 0.3
__Author__ : Boumediene Kaddour
__Email__ : snboumediene@gmail.com
__Website__: http://www.pentestingskills.com
####################################

This is a very simple third-party python module that generates list of ALL IPs for a given network, the module provides a couple of other information as well, through out the Class IPGen for instance, you can get the first IP, the last IP, the BROADCAST address or the network ID, in addition, you can generate the list of IPs which is returned as a list.
The module provides another Class for performing an informtion gathering, for example you can use the localIP() method to get the local IP address, or you can use other methods to get other info like MASK(), GATEWAY(), GW_MAC() ... etc.


Requirements:

No third-party mudules are needed, which means the tool has been built from scratch, i'm using only the AF_INET, SOCK_STREAM and inet_ntoa socket methods.

Usage::

# Generating List of IPs
>>> from IPGenerator import IPGen, Netinfo
>>> ip = IPGenerator("172.16.122.1/28")
>>> ip.isNetOK()
>>> True
>>> ip.IPGen()

172.16.122.1
172.16.122.2
172.16.122.3
172.16.122.4
172.16.122.5
172.16.122.6
172.16.122.7
172.16.122.8
172.16.122.9
172.16.122.10
172.16.122.11
172.16.122.12
172.16.122.13
172.16.122.14

# Getting the local IP address
>>> LIP = Netinfo()
>>> print "The local IP address is: %s "%LIP

>>> The local IP address is: 172.16.122.99

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for IPGenerator, version 0.3
Filename, size File type Python version Upload date Hashes
Filename, size IPGenerator-0.3.tar.gz (3.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page