A library for scanning ports and identifying services
Project description
ThePort 2.0.0
ThePort is a Python library for scanning ports and identifying running services on a specified IP address. It allows users to find open ports and check for known vulnerabilities.
Installation
To install ThePort, you can use pip:
pip install theport
Usage
Basic Port Scanning
To scan ports on a specific IP address, use the following example:
import theport
# Example IP address to scan
ip_address = '199.36.158.100'
ports_to_scan = range(1, 1025) # You can specify a custom range of ports
for port in ports_to_scan:
service = theport.identify_service(port)
is_open = theport.scan(ip_address, port)
if is_open:
print(f"Port {port} is open: {service}")
else:
print(f"Port {port} is closed")
Scanning with User-Defined Ports
Users can also specify their own list of ports to scan:
import theport
# Example IP address to scan
ip_address = '199.36.158.100'
# Custom list of ports to scan
custom_ports = [22, 80, 443, 3306, 8080]
for port in custom_ports:
service = theport.identify_service(port)
is_open = theport.scan(ip_address, port)
if is_open:
print(f"Port {port} is open: {service}")
else:
print(f"Port {port} is closed")
Known Vulnerabilities Check
ThePort can also check for known vulnerabilities on specified ports. Below is an example of how to use this functionality:
import theport
# Example IP address to scan
ip_address = '199.36.158.100'
# Custom list of ports to scan
custom_ports = [22, 80, 443]
for port in custom_ports:
service = theport.identify_service(port)
is_open = theport.scan(ip_address, port)
if is_open:
vulnerabilities = theport.check_vulnerability(port)
print(f"Port {port} is open: {service}. Vulnerabilities: {vulnerabilities}")
else:
print(f"Port {port} is closed")
Available Ports
ThePort supports a variety of commonly used ports, including but not limited to:
- HTTP: 80
- HTTPS: 443
- FTP: 21
- SMTP: 25, 587
- MySQL: 3306
- SSH: 22
- Telnet: 23
- RDP: 3389
- PostgreSQL: 5432
- Redis: 6379
- MongoDB: 27017
Feel free to extend the list as per your needs.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
If you would like to contribute to ThePort, please open an issue or submit a pull request. Any help is greatly appreciated!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file theport-2.0.0.tar.gz
.
File metadata
- Download URL: theport-2.0.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fd243b8ea6ff8dc28fda664c033565c9357f722ccb973545ece238176533753 |
|
MD5 | b4b692dcf7cd2dda0f5efd840547e29d |
|
BLAKE2b-256 | 6071e024d81926de9a9493bf3feb779ea4ff507fe2f212ae0e0ab08b2bcda6bd |
File details
Details for the file theport-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: theport-2.0.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aadb5aeba80b42001100eda831d42d224ba72c9d63c6bddb0e263e185362b4a5 |
|
MD5 | 8338269e87af91bdbcf406c9ec10a099 |
|
BLAKE2b-256 | 2c2c29a33a553e33ded8a00a3deb9a255a6213a5d6c17b47565d72a9a387c195 |