This Repository is a collection of different ethical hacking tools and malware's for penetration testing and research purpose written in python, ruby, rust, c++, go and c.
JavaScript algorithmsartificial-intelligencebugbountycryptographycyber-threat-intelligencecybersecurity-projectsethical-hackinghacking-toolsmalwarenessusnetwork-monitoringnetwork-securitynmapportscannerpythonpythonprojectsthreat-intelligencevirus-scanning
Create PingScanNetwork.py
Abdul Wahab Junaid755acb993645
diff --git a/Python Tools/Subprocess_Modules/PingScanNetwork.py b/Python Tools/Subprocess_Modules/PingScanNetwork.pynew file mode 100644index 0000000..c4ae218--- /dev/null+++ b/Python Tools/Subprocess_Modules/PingScanNetwork.py@@ -0,0 +1,26 @@+#!/usr/bin/env python+import subprocess+import sys+import argparse++parser = argparse.ArgumentParser(description='Ping Scan Network')++# Main arguments+parser.add_argument("-network", dest="network", help="NetWork segment[For example 182.185.167.51]", required=True)+parser.add_argument("-machines", dest="machines", help="Machines number",type=int, required=True)++parsed_args = parser.parse_args()++for ip in range(1,parsed_args.machines+1):+ ipAddress = parsed_args.network +'.' + str(ip)+ print("Scanning %s " %(ipAddress))+ if sys.platform.startswith('linux'):+ # Linux+ output = subprocess.Popen(['/bin/ping','-c 1',ipAddress],stdout = subprocess.PIPE).communicate()[0]+ elif sys.platform.startswith('win'):+ # Windows+ output = subprocess.Popen(['ping', ipAddress], stdin=PIPE, stdout=PIPE, stderr=PIPE).communicate()[0]+ output = output.decode('utf-8')+ print("Output",output)+ if "Lost = 0" in output or "bytes from " in output:+ print("The Ip Address %s has responded with a ECHO_REPLY!" % ipAddress)