NetProbe is a TCP-based port scanner developed in C++ using the Windows Winsock API.
The application performs connection-based scanning to detect open TCP ports on a target host within a user-specified port range.
This project demonstrates practical knowledge of:
- TCP/IP networking fundamentals
- Socket programming using Winsock2
- Non-blocking I/O
- Timeout handling with
select() - Modular object-oriented C++ design
The scanner performs a TCP connect scan by attempting to establish a full TCP handshake with each port.
- TCP connect-based port scanning
- Non-blocking socket configuration
- Timeout-controlled connection attempts
- Class-based modular architecture
- Custom port range scanning
- Windows-compatible implementation
NetProbe-TCP-Scanner/
├── src/
│ ├── main.cpp
│ ├── scanner.cpp
│ ├── scanner.h
├── build/
└── README.md
For each port in the specified range:
- A TCP socket is created using Winsock.
- The socket is set to non-blocking mode.
- A connection attempt is initiated using
connect(). - The
select()function is used with a timeout to determine whether the connection succeeds. - If the socket becomes writable within the timeout period, the port is considered open.
- The socket is closed and the scan proceeds to the next port.
This approach reduces blocking delays and improves scanning efficiency compared to simple blocking connect calls.
From the project root directory:
g++ src/main.cpp src/scanner.cpp -o build/scanner.exe -lws2_32Run the executable:
build\scanner.exeExample input:
Enter target IP: 127.0.0.1
Enter start port: 1
Enter end port: 100 Example output:
Scanning 127.0.0.1...
[OPEN] Port 8000Scan complete.
- TCP three-way handshake
- Open vs closed port behavior
- Blocking vs non-blocking sockets
- Timeout-based connection handling
- Windows Socket API (Winsock2)
- Connection-oriented scanning logic
- Performs TCP connect scanning (not SYN scan).
- Sequential scanning (single-threaded).
- Does not perform service detection or banner grabbing.