From 5c18680522ad096adfa2d3ac73cada615fea99f6 Mon Sep 17 00:00:00 2001 From: bl4d3rvnner7 <136976682+bl4d3rvnner7@users.noreply.github.com> Date: Sun, 18 May 2025 01:49:04 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=98=20IP=20Ranger=20Source=20[PY]=20?= =?UTF-8?q?=F0=9F=A7=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ⚙️ 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. --- IP Ranger.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 IP Ranger.py diff --git a/IP Ranger.py b/IP Ranger.py new file mode 100644 index 0000000..b201bf2 --- /dev/null +++ b/IP Ranger.py @@ -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 \ No newline at end of file