Skip to content
Asyncio concurrent Python finds SSH servers (or other services with open ports) on an IPv4 subnet, WITHOUT NMAP
Branch: master
Clone or download
Latest commit bc8f187 Jul 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Update FUNDING.yml May 24, 2019
archive reenable matlab Jul 15, 2019
findssh don't use proactoreventloop on Windows Jul 15, 2019
tests reenable matlab Jul 15, 2019
.appveyor.yml py35 compatible Jul 15, 2019
.codeclimate.yml codeclimate Nov 3, 2017
.coveragerc ci template Jan 22, 2019
.flake8 CI template Apr 24, 2019
.gitattributes travis osx Oct 22, 2017
.gitignore ignore [ci skip] May 30, 2018
.lgtm.yml meta Feb 22, 2019
.travis.yml py35 compatible Jul 15, 2019
FindSSH.py use asyncio.wait_for instead of asyncio.as_completed Jul 15, 2019
LICENSE.txt asyncgen Jun 18, 2019
README.md use asyncio.wait_for instead of asyncio.as_completed Jul 15, 2019
findssh.m reenable matlab Jul 15, 2019
mypy.ini meta [skip ci] Jun 5, 2019
setup.cfg py35 compatible Jul 15, 2019
setup.py template Jul 8, 2018

README.md

DOI

Build Status Coverage percent Build status Language grade: Python PyPi versions Maintainability PyPi Download stats

Find SSH servers (without NMAP)

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

The asyncio coroutine method uses ONE thread and is significantly faster than concurrent.futures.ThreadPoolExecutor, even (perhaps especially) with hundreds of threads in the ThreadPool.

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

Matlab findssh.m works similarly.

Install

Just run FindSSH.py directly. To allow use from other programs, you can install by:

pip install findssh

or from this repo:

pip install -e .

Usage

from command line:

findssh

Command line options

  • -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)
You can’t perform that action at this time.