Skip to main content

A new way to query the ports of a given hostname of IP address

Project description

Welcome to portcheckerio 👋

PyPI PyPI - Python Version GitHub license Pytest CodeQL

This repository is the counterpart script which ports portchecker.io

This package is a nice alternative way to using tools like nc to query the port connectivity. The main benefits is that it will work with hostnames, IPv4 and IPv6 addresses (if your client has IPv6 of course). You can also query multiple ports at the same time and receive a sweet JSON response.

Installation

Portchecker can be installed from PyPI using pip or your package manager of choice:

pip install portcheckerio

Usage

CLI

You can use Portchecker as a CLI tool using the portcheck command.

Example:

$ portcheck --host google.com --ports 443
{
    "2a00:1450:4009:815::200e": {
        "type": "ipv6",
        "results": [
            {
                "port": 443,
                "connectable": true
            }
        ]
    },
    "172.217.16.238": {
        "type": "ipv4",
        "results": [
            {
                "port": 443,
                "connectable": true
            }
        ]
    }
}

You can query multiple ports for a given host in the same command:

$ portcheck --host google.com --ports 443 22
{
    "172.217.16.238": {
        "type": "ipv4",
        "results": [
            {
                "port": 443,
                "connectable": true
            },
            {
                "port": 22,
                "connectable": false
            }
        ]
    },
    "2a00:1450:4009:815::200e": {
        "type": "ipv6",
        "results": [
            {
                "port": 443,
                "connectable": true
            },
            {
                "port": 22,
                "connectable": false
            }
        ]
    }
}

📝 To Do

  • Add more tests
  • Add the option to query RFC1918 addresses
  • Add the option to increase the timeout limit

🏠 Homepage

Demo

Author

👤 Dan Hand

🤝 Contributing

Contributions, issues and feature requests are welcome.
Feel free to check issues page if you want to contribute.

Show your support

Give a ⭐️ if this project helped you!

Any donations to help the running of the site is hugely appreciated!

📝 License

Copyright © 2019 Dan Hand.
This project is MIT licensed.



This README was generated with ❤️ by readme-md-generator

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

portcheckerio-0.1.3.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

portcheckerio-0.1.3-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file portcheckerio-0.1.3.tar.gz.

File metadata

  • Download URL: portcheckerio-0.1.3.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for portcheckerio-0.1.3.tar.gz
Algorithm Hash digest
SHA256 1d0d32aac7880cec9e58509c96438cc17580e9ab34e42ef53f9209a4022ecf3c
MD5 2de1d3a172143e95be5e1eff99f4a1f4
BLAKE2b-256 42b156c77d93cb9ea578e503c7c012e6886e0d1f9300918fa4794f7df69cc322

See more details on using hashes here.

File details

Details for the file portcheckerio-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: portcheckerio-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for portcheckerio-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9db895bd2b9e8724aec9785ba3b3fb69395b220af6a6ee9279dd72390aa1995d
MD5 ec1f7b1bdce44a49c040e562c06b34d8
BLAKE2b-256 5efc3738785f94f8e096c8dd847f704294b6c4c57a8b63a3ddf4e216ef5abd94

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page