CyberLearn
← Back to beginner
Beginner

Simple Port Scanner

Async TCP port scanner in C++ [@deniskhud](https://github.com/deniskhud)

Log in to track progress
2–4hC++

What you'll learn

  • TCP socket programming
  • Async I/O patterns
  • Service detection
██████╗  ██████╗ ██████╗ ████████╗    ███████╗ ██████╗ █████╗ ███╗   ██╗███╗   ██╗███████╗██████╗
██╔══██╗██╔═══██╗██╔══██╗╚══██╔══╝    ██╔════╝██╔════╝██╔══██╗████╗  ██║████╗  ██║██╔════╝██╔══██╗
██████╔╝██║   ██║██████╔╝   ██║       ███████╗██║     ███████║██╔██╗ ██║██╔██╗ ██║█████╗  ██████╔╝
██╔═══╝ ██║   ██║██╔══██╗   ██║       ╚════██║██║     ██╔══██║██║╚██╗██║██║╚██╗██║██╔══╝  ██╔══██╗
██║     ╚██████╔╝██║  ██║   ██║       ███████║╚██████╗██║  ██║██║ ╚████║██║ ╚████║███████╗██║  ██║
╚═╝      ╚═════╝ ╚═╝  ╚═╝   ╚═╝       ╚══════╝ ╚═════╝╚═╝  ╚═╝╚═╝  ╚═══╝╚═╝  ╚═══╝╚══════╝╚═╝  ╚═╝

Cybersecurity Projects C++20 License: AGPLv3 CMake

Asynchronous TCP port scanner built with C++ and Boost.Asio for high-concurrency network reconnaissance.

This is a quick overview — security theory, architecture, and full walkthroughs are in the learn modules.

Developed by @deniskhud

What It Does

  • Asynchronous TCP port scanning using Boost.Asio for high concurrency
  • Configurable port ranges from single ports to full 65535 scans
  • Adjustable concurrency level to control scan speed and network load
  • Connection timeout configuration to handle filtered ports gracefully
  • Clean terminal output showing open, closed, and filtered port states

Quick Start

mkdir build && cd build
cmake ..
make
./simplePortScanner --target 192.168.1.1 --ports 1-1024

[!TIP] This project uses just as a command runner. Type just to see all available commands.

Install: curl -sSf https://just.systems/install.sh | bash -s -- --to ~/.local/bin

Building

Requirements: C++20 compiler, Boost library, CMake >= 3.31

./simplePortScanner --target 10.0.0.1 --ports 22,80,443 --concurrency 200
./simplePortScanner --target 172.16.0.5 --ports 1-65535 --timeout 500

Learn

This project includes step-by-step learning materials covering security theory, architecture, and implementation.

ModuleTopic
00 - OverviewPrerequisites and quick start
01 - ConceptsSecurity theory and real-world breaches
02 - ArchitectureSystem design and data flow
03 - ImplementationCode walkthrough
04 - ChallengesExtension ideas and exercises

License

AGPL 3.0