welcome to roni's digital world
Roni Biju

Python Port Scanner — Multithreaded TCP Scanner

  • Created By: Roni Biju
  • Programming Language: Python

Python Port Scanner — Multithreaded TCP Scanner

A hands-on TCP port scanner written in Python. Built to demonstrate socket programming, multithreading, and security automation — ideal as a compact portfolio project to discuss in interviews.

This project is a hands-on implementation of a TCP port scanner written in Python. The goal was to go beyond theory and build a small, explainable tool that implements socket-based scanning, manages concurrency with worker threads, and produces clear, reproducible results suitable for demonstrations and interviews.

What it does

  • Scans a target host for open TCP ports using a comma-separated list (e.g., 22,80,443) or a port range (e.g., 1-1024).
  • Uses a configurable pool of worker threads to scan ports in parallel for faster results.
  • Resolves hostnames to IP addresses and performs basic service-name lookup for open ports when available.
  • Prints live progress to the console and can write timestamped results to a file for later review.

Why I built it

I built this tool to practice and demonstrate practical networking and security fundamentals (sockets, port enumeration, and service detection). It’s intentionally compact so I can walk through the code easily during interviews and explain design choices like concurrency, parsing strategies, and output formatting. The project also demonstrates how small automation scripts can significantly speed up routine security tasks.

Technical highlights

  • Language: Python 3 (standard library only)
  • Core modules: socket, threading, queue, argparse
  • Key features: multithreading, port-range parsing, service lookup, configurable timeout and thread count, optional file output
  • Repository contents: port_scanner.py, README.md, and example output files/screenshots
  • Run example: python port_scanner.py <target> -p 1-1024 -t 100 -T 1.0 -o results/scan.txt

Learning outcomes & recruiter value

This project demonstrates an understanding of TCP/IP fundamentals and practical port enumeration techniques. It shows the ability to write clear, maintainable scripts and to document work for non-technical and technical audiences alike — a valuable skill for SOC, incident response, and penetration testing roles. Because the code is small and well-documented, it’s easy to present as part of a technical screening or interview discussion.

Ethics & usage

Important: This tool is provided for educational purposes only. Only scan hosts you own or have explicit authorization to test. Unauthorized scanning may be illegal and unethical.

Snapshots