Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Nmap Port Scanner

A simple Python tool that scans a target IP or domain for common open ports, then runs Nmap service detection on any ports found open.

This is a learning project built while studying networking and cybersecurity fundamentals (first-year CS student).

How It Works

  1. Performs a fast raw-socket scan on a set of common ports (21, 22, 80, 443, 8080).
  2. For any ports found open, runs nmap -sV to detect the running service and its version.
  3. Prints a clean summary of the results.

Requirements

  • Python 3
  • nmap installed on your system
  • python-nmap library

Install the Python dependency:

pip install python-nmap

Usage

python3 portscan-nmap.py

You'll be prompted to enter a target IP address or domain name.

Note: The Nmap service-detection phase (-sV) may require root privileges:

sudo python3 portscan-nmap.py

Example Output

Enter target IP or domain: scanme.nmap.org

Scanning scanme.nmap.org ...

[CLOSED] Port 21
[OPEN]   Port 22
[OPEN]   Port 80
[CLOSED] Port 443
[CLOSED] Port 8080

Running Nmap on open ports...

Host: 45.33.32.156
State: up

Port 22 | ssh | OpenSSH 6.6.1p1 Ubuntu 2ubuntu2.13
Port 80 | http | Apache httpd 2.4.7

Scan Complete.

Disclaimer

Only scan systems you own or have explicit permission to test. scanme.nmap.org is Nmap's official target for practicing scans.

Author

Mohammad Alsarawi

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages