10/26/24
[v0.4] Added Multithreading
10/23/24
[v0.3.9] Opened Open-Source Git Issue For Fixing Output With JSON
10/10/24
[v0.3.5] Added JSON and CSV Outputs, Updated Protocols
10/05/24
[v0.3] Added Argument Flags To CLI
09/19/24
[v0.2] Added Images to Project
09/17/24
[v0.1] Initial Creation
PortSentinel, also known as PortSent, is a lightweight port scanner designed to help you identify open ports on a target IP address. It provides actionable security recommendations for each open port, and also fetches geolocation information for the target. With options for scanning custom port ranges, commonly vulnerable ports, and outputting results in formats like JSON or CSV, PortSent is a versatile tool for network security enthusiasts and professionals.
- Port Scanning: Scan a specific range of ports or use the
--common
flag to scan the most commonly vulnerable ports (like FTP, SSH, HTTP, etc.). - Geolocation Information: Automatically fetches the city, region, and country of the target IP using geolocation services.
- Security Recommendations: Provides security recommendations for each open port based on industry best practices.
- Customizable Output Formats: Export scan results in JSON or CSV formats for easy integration with other tools or reporting.
- Common Vulnerable Ports Scan: Quickly scan ports that are commonly exploited in real-world attacks, such as FTP (21), SSH (22), HTTP (80), HTTPS (443), SMB (445), and more.
-
Clone the Repository:
git clone https://github.com/connorgladish/portsentinel.git cd portsentinel
-
Install Dependencies:
pip install -r requirements.txt
Make sure you have Python 3.x installed.
-
Make the Script Executable (Optional):
chmod +x portsent.py
-
Move to Global Path (Optional):
To make it available globally, you can move the script to
/usr/local/bin/
:sudo mv portsent.py /usr/local/bin/portsent
To perform a basic port scan on a target IP (default scans ports 1-65535):
python3 portsent.py <TARGET_IP>
python3 portsent.py <TARGET_IP> -p 1-100
To scan the most commonly vulnerable ports:
python3 portsent.py <TARGET_IP> --common
You can specify output formats using -f
and save the results to a file using -o
:
-
JSON format:
python3 portsent.py <TARGET_IP> --common -o scan_results.json -f json
-
CSV format:
python3 portsent.py <TARGET_IP> -p 1-100 -o scan_results.csv -f csv
{
"target": "192.168.1.1",
"geolocation": "Nashville, Tennessee, US",
"open_ports": [
{
"port": 22,
"status": "open",
"recommendation": "SSH: Disable password-based authentication. Use SSH keys instead. Consider moving SSH to a non-standard port."
},
{
"port": 80,
"status": "open",
"recommendation": "HTTP: Redirect traffic to HTTPS. Use an SSL certificate to secure web traffic."
}
]
}
This project is licensed under the MIT License. See the LICENSE
file for details.
Contributions are welcome! Feel free to submit a pull request or open an issue to report any bugs or suggest new features.
If you encounter any issues, feel free to reach out via GitHub issues.
This tool is intended for educational purposes and ethical use only. Always ensure you have permission before scanning a network or device. Misuse of this tool may violate laws or regulations.