Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Cursed271 authored Sep 8, 2024
0 parents commit a7765d4
Show file tree
Hide file tree
Showing 5 changed files with 857 additions and 0 deletions.
Binary file added IPScan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 83 additions & 0 deletions IPScan.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# ----- License ---------------------------------------------------------------------------------------------------- #

#IPScan Copyright (C) 2022 Steven Pereira
#This program comes with ABSOLUTELY NO WARRANTY.
#This is free software, and you are welcome to redistribute it under certain conditions.

# ----- Import Section --------------------------------------------------------------------------------------------- #

import subprocess
import re
from rich.console import Console

# ----- Global Declaration ----------------------------------------------------------------------------------------- #

console = Console()

# ----- Banner Function -------------------------------------------------------------------------------------------- #

def ascii():
console.print(rf"""[bold yellow]
┌────────────────────────────────────────────────────────────────┐
│ │
│ 8888888 8888888b. .d8888b. │
│ 888 888 Y88b d88P Y88b │
│ 888 888 888 Y88b. │
│ 888 888 d88P "Y888b. .d8888b 8888b. 88888b. │
│ 888 8888888P" "Y88b. d88P" "88b 888 "88b │
│ 888 888 "888 888 .d888888 888 888 │
│ 888 888 Y88b d88P Y88b. 888 888 888 888 │
│ 8888888 888 "Y8888P" "Y8888P "Y888888 888 888 │
│ │
│ +-+-+ │
│ [#c61a09]Made by Cursed271[bold yellow] │
│ +-+-+ │
│ │
└────────────────────────────────────────────────────────────────┘
""")

# ----- Validation Functions --------------------------------------------------------------------------------------- #

def subnet_range(ip):
sub = ip.replace("/24", "")
subval = sub.split(".")
for x in subval:
if not x.isdigit():
console.print("You've entered the wrong Subnet Range")
console.print("Please check your Input")
exit()
else:
i = int(x)
if i >= 0 or i <= 255:
pass
else:
console.print("You've entered the wrong Subnet Range")
console.print("Please check your Input")
exit()

# ----- Scanning Function ------------------------------------------------------------------------------------------ #

def scanner(ip):
subnet_range(ip)
network = ip.replace("0/24", "")
ip_values = []
for host in range(1, 6):
ip_val = network + str(host)
process = subprocess.run('ping -c 1 '+ ip_val,stdout=subprocess.PIPE, shell=True)
if process.returncode == 0:
ip_values.append(ip_val)
console.print(f"{ip_val} IS ALIVE!!")
console.print("Ping completed successfully!")
console.print(f"There are {len(ip_values)} hosts available")

# ----- Main Function ---------------------------------------------------------------------------------------------- #

if __name__ == '__main__':
try:
ascii()
ip = input("Please enter a Subnet Range: ")
scanner(ip)
except KeyboardInterrupt:
print("Forcefully terminated IPScan")

# ----- End -------------------------------------------------------------------------------------------------------- #
Loading

0 comments on commit a7765d4

Please sign in to comment.