chevron_left chevron_right
Login Register invert_colors photo_library


Stay updated and chat with others! - Join the Discord!
Thread Rating:
  • 0 Vote(s) - 0 Average


Small Network Scanner filter_list
Author
Message
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:

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]

Sample Input:

Code:
Please Input your IP: 192.168.1.1
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

Reply

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

Reply

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

Reply

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

Reply

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

Reply






Users browsing this thread: 1 Guest(s)