DeepOne is a Python tool designed to expand, exclude, and split multiple IP range formats. It's particularly useful for network administrators and security professionals who need to manage large lists of IP addresses.
- Expands various IP range formats into individual IP addresses
- Excludes specified IP addresses or ranges from the output
- Splits the resulting IP list into multiple files
- Supports multiple input formats for flexibility
DeepOne can handle the following IP range formats:
- CIDR notation (e.g., 192.168.3.0/24)
- Last octet range (e.g., 192.168.3.0-255)
- Full IP range (e.g., 192.168.3.0-192.168.4.155)
- Single IP addresses (e.g., 192.168.3.1)
-
Clone this repository:
git clone https://github.com/yourusername/DeepOne.git cd DeepOne
-
Install the required dependencies:
pip install -r requirements.txt
python deepOne.py [-h] -i INPUT [-e EXCLUDE] [-o OUTPUT] [-s SPLIT]
Option | Description |
---|---|
-i, --input | Path to input file (required) |
-e, --exclude | Path to exclude file |
-o, --output | Name of output file (default: ./output.txt) |
-s, --split | Number of files to split output into (default: 1) |
-h, --help | Show help message and exit |
The input file should contain one IP range per line, using any of the supported formats mentioned above.
The exclude file should contain IP addresses or ranges to be excluded from the final output, one per line. It supports the same formats as the input file.
-
Basic usage:
python deepOne.py -i input.txt -o output.txt
-
Using an exclude file:
python deepOne.py -i input.txt -e exclude.txt -o output.txt
-
Splitting the output into multiple files:
python deepOne.py -i input.txt -o output.txt -s 5
- The script reads the input file and expands each IP range into individual IP addresses.
- If an exclude file is provided, it expands the exclusions and removes them from the result set.
- The script writes the resulting IP addresses to the output file.
- If splitting is requested, it divides the output into the specified number of files.
DeepOne uses pytest for testing. To run the tests:
-
Ensure you have pytest installed:
pip install pytest
-
Run the tests:
pytest deepOneTest.py
The test suite covers various aspects of the DeepOne functionality, including:
- CIDR notation expansion
- Last octet range expansion
- Full IP range expansion
- Single IP handling
- Invalid IP handling
- File processing
For more verbose output, you can use:
pytest -v deepOneTest.py
This will show detailed information about each test as it runs.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.