Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import os
- global lis
- print("Scanning the Subnet : ")
- subnet_input = '192.168.1.0'
- subnet_input = subnet_input.split('.')
- for x in range(0,255):
- subnet_input[3] = x
- str(subnet_input)
- new_sub = str(subnet_input[0])+'.'+str(subnet_input[1])+'.'+str(subnet_input[2])+'.'+str(subnet_input[3])
- res = os.system("ping -c 4 {}".format(new_sub))
- if res==0:
- print("{} is Alive".format(new_sub))
- str(new_sub)
- lis = lis + " " + new_sub
- else:
- continue
- print("[*] ALL ALIVE HOSTS ARE : ")
- for i in lis:
- print(i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement