🧘 IP Ranger Source [PY] 🧘

⚙️ Need : IP List
What does it do ?

It ranges the IPs from f.e.
13.46.120.2

To :
13.46.120.1
13.46.120.2
13.46.120.3
13.46.120.4
...

From 1 to 256.
This commit is contained in:
bl4d3rvnner7 2025-05-18 01:49:04 +02:00 committed by GitHub
parent de728eb2e3
commit 5c18680522
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

32
IP Ranger.py Normal file
View file

@ -0,0 +1,32 @@
# A Function to make everything clean
def Ranger(ip: str) -> None:
# We will use a try-except block to avoid any exceptions
try:
IpArray = ip.split('.')
for i in range(256): # IP Address Can only exceed upto 256
# We will only range the last part of the ip , you can always increase or decrease it
saveFileName.write(f"{IpArray[0]}.{IpArray[1]}.{IpArray[2]}.{i}\n")
except Exception:
print(f"Invalid IP : {ip}")
fileName = input("[+] Your IP List :") # User will input the filename first
with open(fileName, errors="ignore", encoding="utf8") as baseFile: # We use context manager
IpList = list(dict.fromkeys(baseFile.readlines())) # For removing duplicates
saveFileName = open("IP Range.txt", "a") # We will create a new file Names IP Ranges to save those ranges
# We will iterate through the list
for ip in IpList:
Ranger(ip)
print(f"Completed : {ip}") # Finally we will print the status as its completed