A simple TCP port scanner written in C++ to check the accessibility of ports on remote IPv4 and IPv6 hosts.
- Check availability of one or multiple TCP ports on an IPv4/IPv6 address
- Uses POSIX sockets and system calls
- Works only on Linux systems
- Built with CMake and C++26 standard
This package is available via Fedora Copr:
sudo dnf copr enable artjom-fedosov/port-scanner
sudo dnf install port-scannergit clone https://github.com/artyom-fedosov/port-scanner.git
cd port-scanner
./scripts/install.shor
git clone https://github.com/artyom-fedosov/port-scanner.git && cd port-scanner && ./scripts/install.sh- Linux operating system
- C++26 compatible compiler
- CMake version 3.16 or higher
To generate the documentation locally, run:
doxygen DoxyfileThe generated HTML documentation will be available in the docs/html directory.
Run the port scanner by specifying an IP address (IPv4 or IPv6) followed by one or more ports to check:
$ port-scanner 192.168.8.1 22 80 443
22 is accessible
80 is not accessible
443 is accessibleNote: In the terminal, accessible ports are displayed in green, while inaccessible ports are shown in red for better readability. The order of the port scan results may vary because the checks are performed concurrently using threads.
You can also scan a range of ports using shell brace expansion (bash):
$ port-scanner 192.168.8.1 {0..65535} | grep "is accessible"This project uses CTest for running unit tests and integrates Valgrind Memcheck to detect memory errors and leaks.
To run the tests, use:
cd build
ctestTo run the tests and see detailed output of any failures:
cd build
ctest --output-on-failureThis project is licensed under the MIT License - see the LICENSE file for details.