Build a Web Based TCP Port Scanner


This tutorial provides detailed steps to build a tool that takes host and port range inputs, performs a scan with Nmap, and showcases results on a webpage through Python scripting and HTML templates.



In the previous project, we developed a Python port scanner that leveraged threading and sockets to scan TCP ports. While effective, there's room for improvement using third-party packages.

In this project, we'll enhance our port scanner by integrating the python-nmap library, offering more robust scanning capabilities. Furthermore, we'll build a web application using Flask to provide a user-friendly interface for our scanner. This step-by-step project will guide you through the process, ensuring you can follow along and build upon your existing knowledge.

👀 Preview

🎯 Tasks

In this project, you will learn:

  • How to set up a Flask project and organize its structure
  • How to use Flask-WTF to create and handle web forms securely
  • How to implement Flask routes to handle web page requests and submissions
  • How to utilize the Nmap library in Python to conduct port scans
  • How to display scan results dynamically on a webpage using Flask and HTML templates
  • How to apply basic Tailwind CSS to enhance the frontend design

🏆 Achievements

After completing this project, you will be able to:

  • Demonstrate a foundational understanding of web development with Flask, including routing, template rendering, and form handling
  • Apply practical experience with integrating Python scripts with web interfaces
  • Exhibit proficiency in using the Nmap library for network scanning tasks
  • Utilize Flask-WTF for form creation and validation in a web application
  • Showcase familiarity with using Tailwind CSS for styling web pages and enhancing user interface design
  • Create a functional web-based application that interacts with backend Python scripts to perform network scans




Labby is the LabEx teacher.