We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a051ab5 commit 2cbb398Copy full SHA for 2cbb398
ip.py
@@ -0,0 +1,34 @@
1
+import os
2
+import platform
3
+
4
+def ping(ip):
5
+ param = '-n' if platform.system().lower() == 'windows' else '-c'
6
+ command = ['ping', param, '1', ip]
7
+ return os.system(' '.join(command)) == 0
8
9
+def main():
10
+ print("=== Simple Network Ping Sweep ===")
11
+ subnet = input("Enter subnet (example: 192.168.1.): ")
12
13
+ print("\nScanning...\n")
14
+ alive = []
15
16
+ for i in range(1, 255):
17
+ ip = subnet + str(i)
18
+ if ping(ip):
19
+ print(f"[+] Reachable: {ip}")
20
+ alive.append(ip)
21
22
+ print("\n=== Scan Complete ===")
23
+ if alive:
24
+ print("Active Hosts:")
25
+ for host in alive:
26
+ print(host)
27
+ else:
28
+ print("No active hosts found.")
29
30
+if __name__ == "__main__":
31
+ main()
32
33
34
0 commit comments