Login Register

Small Network Scanner filter_list
Small Network Scanner #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.

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:

//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


        return '%s is Alive' % host

def scan(get, start, end):

    for n in range(start, end):

        ip = get + '.' + str(n)


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]

Sample Input:

Please Input your IP:
Enter Start Range: 10
Enter Range End: 20

Scan speed is slow but works for the purpose and I quite like it Biggrin Hope you guys too Smile

Will be updating it though!
My Blog: http://www.procurity.wordpress.com
Donations: 1HLjiSbnWMpeQU46eUVCrYdbkrtduX7snG


RE: Small Network Scanner #2
how dose a network scanner help?
im new and id like to learn Smile


RE: Small Network Scanner #3
It looks useful.I will do some testing and report back..Nice share!


RE: Small Network Scanner #4
Great! Thanks for sharing. I would love to see your updates.


RE: Small Network Scanner #5
Thanks for the share of the source! Just started out with python will digg through it Smile


Users browsing this thread: 1 Guest(s)