Skip to main content

Find SSH servers (without NMAP)

DOI ci PyPI Download stats

Platform-independently find SSH servers (or other services with open ports) on an IPv4 subnet in pure Python WITHOUT NMAP. Scan entire IPv4 subnet in less than 1 second using Python standard library asyncio coroutines and a single thread.

The findssh asyncio coroutine TaskGroup uses a single thread and is more than 10x faster than concurrent.futures.ThreadPoolExecutor.

Although speed advantages weren't seen in our testing, findssh works with PyPy as well.

pip install findssh

or from this repo:

git clone https://github.com/scivision/findssh

pip install -e ./findssh

Usage

A canonical way to use FindSSH from other Python scripts is asyncio.


from command line:

python -m findssh

or use project script e.g. from pipx:

findssh

For example, to scan your local subnet for SSH servers:

findssh -p 22 192.168.1.0
  • -s check the string from the server to attempt to verify the correct service has been found
  • -t timeout per server (seconds) useful for high latency connection
  • -b baseip (check other subnet besides your own)
  • -p network port to scan (default 22)

Benchmark

These tests used 500 ms timeout on WiFi.

Coroutine (single thread, fast, lean, recommended):

%timeit findssh.main()

522 ms ± 1.26 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)

Thread pool (100 thread max, slow, heavy):

%timeit findssh.threadpool.main()

1.39 s ± 213 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)

Trying to open too many threads via ThreadPoolExecutor can cause a system error like

OSError: [Errno 24] Too many open files

Thus in practical terms, using coroutines can be significantly faster than threads while using less system resources.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

findssh-2.1.0.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

findssh-2.1.0-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file findssh-2.1.0.tar.gz.

File metadata

  • Download URL: findssh-2.1.0.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for findssh-2.1.0.tar.gz
Algorithm Hash digest
SHA256 e5e75968db2198ef6c1347d662e96f386d042b2ee631a9e3bb0525dcc681fdf2
MD5 c106289f671672dc9536b02124bfb9fb
BLAKE2b-256 beee0774bf4b8a2aace4048beea0f193278a7886c1a42aeb09ea71a0ee57a24d

See more details on using hashes here.

Provenance

The following attestation bundles were made for findssh-2.1.0.tar.gz:

Publisher: publish-python-package.yml on scivision/findssh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file findssh-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: findssh-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for findssh-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e3098f116a77f22f8391adddd8105591d7b5e64aa21a55d1c9c215ffaacc956
MD5 4d4c5fd320f8c4c12d7e1618b74f8bb3
BLAKE2b-256 3afa714675472c522011b1a065a2e0d21b280e0293804064ea802e5fab8a5748

See more details on using hashes here.

Provenance

The following attestation bundles were made for findssh-2.1.0-py3-none-any.whl:

Publisher: publish-python-package.yml on scivision/findssh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 files

2.0.1

2 files

2.0.0

2 files

1.5.0

1 file

1.4.1

1 file

1.4.0

1 file

1.3.0

1 file

1.2.0

1 file

1.1.0.1

1 file

1.1.0

1 file

1.0.9

1 file

1.0.8

2 files

1.0.7

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

0.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page