Small Network Scanner 08-17-2013, 07:24 AM
#1
I though that instead of using others made tools to find out hosts which are online in a given IP range, I should rather make my own with python.
Here's the code:
Uses Subprocess to work with Linux built-in Ping. It takes your IP and range as input then scans the IP's in that range using the ping module whether they are online or offline. Here's an image of it's working:
![[Image: ygdOZFb.png]](http://i.imgur.com/ygdOZFb.png)
Sample Input:
Scan speed is slow but works for the purpose and I quite like it
Hope you guys too
Will be updating it though!
Remember that I've made this only for Linux, you'll have to modify it to be able to use it with Windows
Here's the code:
Code:
//Coded By Ex094
//Python 3
import subprocess, locale, socket
encoding = locale.getdefaultlocale()[1]
def ping(host):
response = subprocess.Popen(["/bin/ping", "-c1", "-w10", host], stdout=subprocess.PIPE).stdout.read()
if 'Unreachable' in response.decode(encoding):
return '%s is Offline' % host
else:
return '%s is Alive' % host
def scan(get, start, end):
for n in range(start, end):
ip = get + '.' + str(n)
print(ping(ip))
rand = input('Please input your IP: ')
ip_start = int(input('Enter Start Range: '))
ip_end = int(input('Enter Range End: '))
scan(rand[:7], ip_start, ip_end)Uses Subprocess to work with Linux built-in Ping. It takes your IP and range as input then scans the IP's in that range using the ping module whether they are online or offline. Here's an image of it's working:
![[Image: ygdOZFb.png]](http://i.imgur.com/ygdOZFb.png)
Sample Input:
Code:
Please Input your IP: 192.168.1.1
Enter Start Range: 10
Enter Range End: 20Scan speed is slow but works for the purpose and I quite like it
Hope you guys too
Will be updating it though!


![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)