diff --git a/ip.py b/ip.py new file mode 100644 index 000000000000..84d85a62c03c --- /dev/null +++ b/ip.py @@ -0,0 +1,34 @@ +import os +import platform + +def ping(ip): + param = '-n' if platform.system().lower() == 'windows' else '-c' + command = ['ping', param, '1', ip] + return os.system(' '.join(command)) == 0 + +def main(): + print("=== Simple Network Ping Sweep ===") + subnet = input("Enter subnet (example: 192.168.1.): ") + + print("\nScanning...\n") + alive = [] + + for i in range(1, 255): + ip = subnet + str(i) + if ping(ip): + print(f"[+] Reachable: {ip}") + alive.append(ip) + + print("\n=== Scan Complete ===") + if alive: + print("Active Hosts:") + for host in alive: + print(host) + else: + print("No active hosts found.") + +if __name__ == "__main__": + main() + + + \ No newline at end of file diff --git a/readme b/readme new file mode 100644 index 000000000000..b3e58f24ba83 --- /dev/null +++ b/readme @@ -0,0 +1,11 @@ +This is a simple beginner-friendly Python project that sweeps a subnet and shows which IP addresses respond to a ping request. + +## ✨ Features +- Works on Windows, Linux, and macOS +- Very easy for beginners to understand +- Scans IPs from `.1` to `.254` +- No external libraries required + +## 🚀 How to Run +```bash +python ip.py