This script is a simple port scanner written in Bash. It utilizes netcat
(nc
) to scan specified ports on a given IP address. It supports both a fast scan of predefined common ports and a full scan of a specified port range.
./scanner.sh IP [OPTIONS]
-F
: Fast scan using predefined common ports.-p
: Port range for full scan (e.g.,1-1024
).-h
: Display help message.
-
Fast Scan:
./scanner.sh 192.168.1.1 -F
-
Full Scan with Specified Port Range:
./scanner.sh 192.168.1.1 -p 1-1024
-
Display Help Message:
./scanner.sh -h
-
Ensure that
nc
(netcat) is installed on your system.sudo apt-get install netcat
- is_nc_available: Checks if
nc
(netcat) is available. - usage: Displays the usage message.
- scan: Performs the actual port scanning using
nc
.
- ip: The target IP address to be scanned.
- fast: An array of common ports used for the fast scan.
Feel free to fork this repository, submit issues, and send pull requests. We appreciate all contributions that help improve this script!
This project is licensed under the MIT License - see the LICENSE file for details.
This script is inspired by various open-source network tools and tutorials available online.
https://github.com/0x25/bashPortScanner