Hello. Today we are going to make a Python up/down host checker "How to Make a Python host checker for Linux" that works on Linux only.You are going to need:¨C
Python 3.4
¨C Internet Connection¨C
Computer with Windows or LinuxIf you haven't got installed Python yet, download it from the following link:
https://www.python.org/downloads/
You can find some of the Python basics in my first tutorial at
http://www.hacking-tutorial.com/hack...y-with-python/

.


Coding How to Make a Python host checker for Linux.

.
Coding is the easy part. Begin from importing sysand socket, then, write the following code:import os # Importing main libsimport sysstart = "" # Setting up variablesrange1 = 0range2 = 0for carg in sys.argv: # Checking for argumentsif carg == "-s":argnum = sys.argv.index(carg)argnum = 1start = sys.argv[argnum]elif carg == "-r1":argnum = sys.argv.index(carg)argnum = 1range1r = sys.argv[argnum]range1 = int(range1r)elif carg == "-r2":argnum = sys.argv.index(carg)argnum = 1range2r = sys.argv[argnum]range2 = int(range2r)print ("[*] Host Scanner launched!") # Informs user about initializeif start == "": # Checks if all the information is providedprint ("[E] No host provided")elif range1 == 0rint ("[E] No range1 provided")elif range2 == 0rint ("[E] No range2 provided")else:if range1 > range2:count = range1 - range2elif range1 < range2:count = range2 - range1for ccount in range(range1, range2): # Counts the IP range to pingtarget = start "." str(ccount)response = os.system("ping " target " 2>&1 >/dev/null") # Sets response to pingif response == 0: # Reads response, checksif it is 0err = 0 # sets err to 0else:err = 1 # sets err to 1if err == 0: # when err is equal to 0print ("[ ] " target " is up!") # Informs user about hosts that are upCode should look like this (comments are cut, do not worry):So, that is pretty easy. The end perimeters in th ping command supresses the commands output.So, save the file, run it from terminal and test this out!