CLI Tools

A collection of high-performance security & network tools.

TCP Port Scanner

A minimal, single-threaded TCP port scanner written in C. Designed for educational purposes to demonstrate the fundamentals of TCP connect-based scanning.

Overview

The scanner tests a range of TCP ports on a target IP by attempting a full TCP connection (connect()).

Key characteristics:

Build & Run

Compile:

gcc -o scanner scanner.c

Run:

./scanner <IP> <Start Port> <End Port>

Example:

./scanner 127.0.0.1 80 100

Output Meaning

Example Use Cases

Notes & Limitations

Comparison with Nmap

Feature This Scanner Nmap
Scan Speed Sequential Parallel
Scan Technique TCP connect Multiple
Service Detection No Yes
OS Detection No Yes
Extensibility No NSE scripts

Troubleshooting

If you see [ERROR]:

  1. Verify the IP address
  2. Check network connectivity
  3. Ensure outbound connections are allowed
  4. Confirm you have permission to scan the target

Future Improvements

Possible extensions to improve functionality and performance:


Disclaimer: Scan only systems you own or have explicit authorization to test. Unauthorized port scanning may be illegal.