Python-based tool which helps to scan the network
Project description
Network Scanner
Hi! I'm Network Scanner. I am a python-based tool which helps to scan the network and check for active hosts within a network by pinging them. I am very fast as I implement concepts of asyncio for concurrent processing.
Installation Instructions
For installing the tool we can use pip installer.
pip install Network-Scanner
Getting Started
This tool accepts command line arguments to perform a "ping-based" concurrent scan.
The tool accepts three command line argument:
- Network ID: the network which needs to be scanned.
Syntax: X.X.X.X/subnet_prefix
Example: 192.168.100.0/24
-
Concurrency level: number of concurrent hosts that are pinged at the same time (accepts int value) (default level 1). The recommeded concurrency level is from 1 to 500. The tool can crash with the concurrency level of the more than 500.
-
Timeout: number of seconds after giving up on pinging a host (accepts int/ float)(default 5s).
Let's start with a simple example:
In this example we would be scanning the network 8.8.8.0/24 with the concurrency level of 500 at the timeout of 1s.
Run the following command in the terminal to test above example:
$ net_scan 8.8.8.0/24 --concurrent 500 --timeout 1
An output.txt file will be created in the same directory from where the command was executed, which would contain the output of network scan.
How it works?
Lets summarize the working of tool in steps:
-
The journey of the tool starts with taking the command line inputs for Network_ID, Concurrency_Level and Timeout.
-
Once the inputs are taken, we fetch the IP addresses of all the hosts within the mentioned Network using
ipaddress
python package. -
Then we have used Semaphores to maintain the concurrency in the tool. We have assigned the input of Concurrency_Level to semaphores.
-
After setting up the concurrency level we have created tasks to ping the ip addresses. We have individual tasks for all the ip addresses in the network.
-
Once the tasks are created we have kept those tasks on the event_loop to execute then concurrently.
-
After the execution of pings to all the hosts, the ping-reply is printed in a text file named "output.txt".
This repository is licensed under the MIT license. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for Network_Scanner-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cc628a3f43733db7a7d0dada77e358a44166272b495aaefba0394aa1ceb3c1c |
|
MD5 | c66ce38975b7124c61332609aae70051 |
|
BLAKE2b-256 | 108c04ca5040840c2f0df27134fc2e4474dab7f0b971f3a174275ec7b3249435 |