A beginner-friendly Python CLI project that performs basic, non-destructive security checks:
- Scans a list of common TCP ports
- Detects open TCP ports
- Checks common HTTP security headers
- Identifies missing security headers
- Displays exposed server information
- Provides basic suggestions for missing headers
- Includes a locally hosted Flask application for safe testing
Use only on systems you own or have explicit permission to test.
cli-vulnerability-scanner/
├── .gitignore
├── scanner.py
├── test_app.py
├── requirements.txt
└── README.md
First download or clone the source code and follow these steps.
Run these commands one by one:
- cd cli-vulnerability-scanner
- py -m venv .venv
- .venv\Scripts\Activate.ps1
- pip install -r requirements.txt
Run these commands one by one:
- cd cli-vulnerability-scanner
- python3 -m venv .venv
- source .venv/bin/activate
- pip install -r requirements.txt
Open Terminal 1(Ctrl+ALt+T) and run:
"python3 test_app.py"
The test application should run at:http://127.0.0.1:5000
Open Terminal 2 and run:
"python3 scanner.py"
The scanner will ask you to enter a website URL:
'Enter website URL: http://127.0.0.1:5000'
- The user enters a website URL.
- The scanner extracts the hostname from the URL.
- It checks a predefined list of common TCP ports.
- It sends an HTTP request to the target website.
- It checks whether common security headers are present or missing.
- It displays exposed server information when available.
- It prints basic security suggestions in the terminal.
The scanner currently checks:
Content-Security-PolicyX-Frame-OptionsX-Content-Type-OptionsStrict-Transport-SecurityReferrer-Policy
The scanner currently checks these ports:
"21, 22, 23, 25, 53, 80, 443, 3306, 5000, 8080"
This is a learning project and is not a replacement for professional tools such as Nmap, Nikto, Nessus, OpenVAS, or Burp Suite.
The current version:
- Does not perform SQL injection testing
- Does not perform XSS testing
- Does not attempt authentication bypass
- Does not exploit detected issues
- Does not perform CVE or software-version vulnerability lookups
- Does not save scan results as JSON
- Does not support custom port arguments from the command line
A clean result does not prove that a system is fully secure.
Dev Saini