├── README.md ├── ip-net.py ├── ips └── ips.txt ├── ranges └── ranges.txt └── sc.png /README.md: -------------------------------------------------------------------------------- 1 | IP?NET 2 | == 3 | Simple script to bulk check if IPs match networks 4 | 5 | ### CLONE 6 | ``` 7 | git clone https://github.com/UndeadSec/IP-NET.git 8 | ``` 9 | ### RUNNING 10 | ``` 11 | cd IP-NET 12 | ``` 13 | ``` 14 | python3 ip-net.py 15 | ``` 16 | ### SCREENSHOT 17 | 18 |

19 | 20 |

21 | -------------------------------------------------------------------------------- /ip-net.py: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------ 2 | # BY: UNDEADSEC from BRAZIL :) 3 | # YouTube: https://www.youtube.com/c/UndeadSec 4 | # Github: https://github.com/UndeadSec/IP-NET 5 | #------------------------------------------------------ 6 | from ipaddress import ip_network, ip_address 7 | from os import listdir 8 | 9 | RED, WHITE, GREEN, END, YELLOW = '\033[91m', '\33[97m', '\033[1;32m', '\033[0m', '\33[93m' 10 | 11 | def readFile(filepath): 12 | f = open(filepath, 'r') 13 | return f.read() 14 | 15 | def getIps(): 16 | iplist = [] 17 | files = listdir('ips/') 18 | for f in files: 19 | ips = readFile('ips/' + f).split('\n') 20 | for ip in ips: 21 | iplist.append(ip) 22 | return iplist 23 | 24 | def getRanges(): 25 | rangelist = [] 26 | files = listdir('ranges/') 27 | for f in files: 28 | rgs = readFile('ranges/' + f).split('\n') 29 | for rang in rgs: 30 | rangelist.append(rang) 31 | return rangelist 32 | 33 | iplist = getIps() 34 | rangelist = getRanges() 35 | 36 | print(f''' 37 | _____ _____ {RED}___{END} _ _ ______ _______ 38 | |_ _| __ \{RED}__ \{END}| \ | | ____|__ __| 39 | | | | |__) |{RED} ){END} | \| | |__ | | 40 | | | | ___/ {RED}/ /{END}| . ` | __| | | 41 | _| |_| | {RED}|_|{END} | |\ | |____ | | 42 | |_____|_| {RED}(_){END} |_| \_|______| |_| 43 | 44 | Check if IPs matches networks - @{RED}UndeadSec{END}''') 45 | 46 | for rang in rangelist: 47 | net = ip_network(rang) 48 | print(f' \n#{YELLOW}###{END}# Checking network: {YELLOW}{rang}{END}') 49 | for ip in iplist: 50 | try: 51 | if ip_address(ip) in net: 52 | print(f'\n {GREEN}[{END}*{GREEN}]{END} Match found: {GREEN}{ip}{END} - {GREEN}{rang}{END}') 53 | else: 54 | pass 55 | except Exception as e: 56 | print(e) -------------------------------------------------------------------------------- /ips/ips.txt: -------------------------------------------------------------------------------- 1 | 8.8.8.8 2 | 10.0.0.12 3 | 192.168.0.54 -------------------------------------------------------------------------------- /ranges/ranges.txt: -------------------------------------------------------------------------------- 1 | 192.168.0.0/24 2 | 10.0.0.0/16 -------------------------------------------------------------------------------- /sc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UndeadSec/IP-NET/442dfd04b87beae3b81af44f2d6edb319683c5c2/sc.png --------------------------------------------------------------------------------