A library for scanning ports and identifying services
Project description
ThePort
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 = '192.168.1.1'
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 = '192.168.1.1'
# 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 = '192.168.1.1'
# 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-0.1.0.tar.gz
.
File metadata
- Download URL: theport-0.1.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 | 26fd71c71343cddef47a6adaabeb43c555488c75d322a8d10eb7fa819b8582a1 |
|
MD5 | c52cd4ef7e5c2efb15abb4d09487a262 |
|
BLAKE2b-256 | b9d965054d92b59258ced7971167d708c4d8298fa2fd2bc2bea573ebc6c32655 |
File details
Details for the file theport-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: theport-0.1.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 | 7bb7feec4c1b8d26f251ace7fae9473ac10c4123809c04e647d91d401e919cc6 |
|
MD5 | 76554413ac748b6d59b3758ba6e412ff |
|
BLAKE2b-256 | fcf14e209a12365e7e4217c8d597ed0a0359656e9627cd8f969a836b51c26935 |