PortIP
PortIP is a Python package that allows you to ping websites and scan for open ports. It is also available for Linux terminals.
Installation
Using pip
You can install this library using pip:
pip install portip
Using apt-get (Linux)
To install PortIP on a Linux machine, use the following command:
sudo apt-get install portip
Motive Of The Project
Network administrators and security enthusiasts often need a tool to quickly check the status of network services and open ports on a server. This can help in ensuring that only necessary services are exposed and identify potential vulnerabilities. As a network enthusiast myself, I developed this tool to make the process straightforward and efficient.
This package is designed to be easy to use, even for those who are not proficient in Python programming. By following a few simple steps, you can scan websites for open ports and check their connectivity.
Structure Of The Project
portip/
│
├── portip/
│ ├── __init__.py
│ └── portip.py
│
├── CONTRIBUTING.md
├── LICENSE
├── README.md
└── setup.py
Usage (Windows Terminal / MAC Terminal)
After installing the package, you can use the following commands in your terminal or command prompt:
Ping a Website:
To ping a website and check its connectivity, use the following command:
python3 -m portip.portip 1 --url google.com
This command will ping google.com with the default number of requests (4 by default).
Scan for Open Ports:
To scan a website for open ports, use the following command:
python3 -m portip.portip 2 --url google.com
This command will scan google.com for open ports using the default settings (scanning ports 1 to 1000 with 100 threads).
Advanced Scanning Features:
You can enable advanced scanning features to improve port scanning accuracy. Use the --advanced flag with the scan command:
python3 -m portip.portip 2 --url google.com --advanced
This command will enable advanced scanning features while scanning google.com for open ports.
Specify Port Range:
If you want to specify a custom port range (e.g., ports 1-1000), use the --port-range option:
python3 -m portip.portip 2 --url google.com --port-range 1-1000
This command will scan google.com for open ports within the specified port range.
Adjust Number of Threads:
To change the number of threads used for port scanning, use the --threads option:
python3 -m portip.portip 2 --url google.com --threads 50
This command will scan google.com for open ports using 50 threads instead of the default 100.
Replace google.com with the URL of the website you want to ping or scan. Adjust the command-line options as needed to customize the behavior of the PortIP tool.
Feel free to reach out if you have any questions or encounter any issues!
Usage (Linux Terminal)
After installing the package, you can use the following commands in your terminal or command prompt:
Additional Setup on Linux
Before using the portip command, you need to ensure that the portip.py script is properly configured for use on a Linux machine.
-
Install
dos2unix:If you haven't already installed
dos2unix, you can do so using the following command:sudo apt-get install dos2unix
-
Convert Line Endings:
Navigate to the directory containing
portip.pyand run the following command to convert the line endings of the script file to Unix-style:dos2unix portip.pyThis command ensures that the script can be executed properly on a Linux machine.
Using the portip Command
Ping a Website:
To ping a website and check its connectivity, use the following command:
portip 1 --url google.com
This command will ping google.com with the default number of requests (4 by default).
Scan for Open Ports:
To scan a website for open ports, use the following command:
portip 2 --url google.com
This command will scan google.com for open ports using the default settings (scanning ports 1 to 1000 with 100 threads).
Advanced Scanning Features:
To enable advanced scanning features while scanning for open ports, use the --advanced flag:
portip 2 --url google.com --advanced
This command will enable advanced scanning features while scanning google.com for open ports.
Specify Port Range:
To specify a custom port range (e.g., ports 1-1000) for scanning, use the --port-range option:
portip 2 --url google.com --port-range 1-1000
This command will scan google.com for open ports within the specified port range.
Adjust Number of Threads:
To change the number of threads used for port scanning, use the --threads option:
portip 2 --url google.com --threads 50
This command will scan google.com for open ports using 50 threads instead of the default 100.
Replace google.com with the URL of the website you want to ping or scan. Adjust the command-line options as needed to customize the behavior of the PortIP tool.
Feel free to reach out if you have any questions or encounter any issues!
Contribution
If you want to contribute to this project, please follow the instructions in the CONTRIBUTING.md file.
Happy Hacking! 🚀
Metadata
Release files for portip 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| portip-1.1.0.tar.gz | 6.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| portip-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.0 kB
Release files / portip-1.1.0.tar.gz
| Download URL | portip-1.1.0.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e272ba8927d56e87d6e757a15ef4abf26095232cb56e9403184209e595e07e1e
|
|
BLAKE2b-256 checksum How to use checksums |
8c00f032788c854a4a5d75952a462a2dd04de3163ec495c809561b9b2a7b5a53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.3
|
Release files / portip-1.1.0-py3-none-any.whl
| Download URL | portip-1.1.0-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
07b4d9c12da69d808d6c41d9d6e174d07b38b0a9e7e7cec3f491105352835959
|
|
BLAKE2b-256 checksum How to use checksums |
823f4f184ddd614332b5413f188555c65acb9ed86e95fa09ee3b7e255ce0cf54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.3
|
Security for portip 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.