Skip to main content

ssh mitm server for security audits supporting public key authentication, session hijacking and file manipulation

Project description

ssh-mitm - intercept ssh traffic Tweet

CodeFactor Documentation Status PyPI downloads GitHub PRs Welcome

man in the middle (mitm) server for security audits supporting public key authentication, session hijacking and file manipulation

SSH-MITM example

SSH-MITM 0.5.6 is available as AppImage - 2021-06-08

SSH-MITM is available as AppImage. Just download it, make it executable and start it.

$ wget https://github.com/ssh-mitm/ssh-mitm/releases/download/0.5.6/ssh-mitm-x86_64.AppImage
$ chmod +x ssh-mitm-x86_64.AppImage
$ ./ssh-mitm-x86_64.AppImage

Full Changelog

Features

  • Hijacking and logging of terminal sessions
  • support for ssh commands (e.g. git over ssh)
  • SCP and SFTP
    • store files
    • replace files
    • inject additional files
  • Agent Forwarding
  • Port Forwarding
  • Check and test clients against known vulnerabilities
  • Plugin support

Installation of SSH-MITM

The first step to using any software package is getting it properly installed.

To install SSH-MITM, simply run this simple command in your terminal of choice:

$ pip install ssh-mitm

If you want to install all supported plugins for ssh-mitm you can install them with:

$ pip install ssh-mitm[plugins]

Quickstart

Starting an intercepting mitm-ssh server with password authentication and session hijacking is very simple.

All you have to do is run this command in your terminal of choice.

$ ssh-mitm --remote-host 192.168.0.x

Now let's try to connect to the ssh-mitm server. The ssh-mitm server is listening on port 10022.

$ ssh -p 10022 user@proxyserver

You will see the credentials in the log output.

2021-01-01 11:38:26,098 [INFO]  Client connection established with parameters:
    Remote Address: 192.168.0.x
    Port: 22
    Username: user
    Password: supersecret
    Key: None
    Agent: None

Session hijacking

Getting the plain text credentials is only half the fun. When a client connects, the ssh-mitm starts a new server, which is used for session hijacking.

2021-01-01 11:42:43,699 [INFO]  created injector shell on port 34463.
                                connect with: ssh -p 34463 127.0.0.1

To hijack the session, you can use your favorite ssh client. This connection does not require authentication.

$ ssh -p 34463 127.0.0.1

After you are connected, your session will only be updated with new responses, but you are able to execute commands.

Try to execute somme commands in the hijacked session or in the original session.

The output will be shown in both sessions.

Important note

SSH-MITM should not be used as a jump host!

It's intended to be used during security audits and not for separating networks.

If you need a jump host with audit capabilities (for security compliences), you can find a comparison of jump hosts in SSH-MITM's documentation.

Contributing

Pull requests are welcome.

For major changes, please open an issue first to discuss what you would like to change.

See also the list of contributors who participated in this project.

Project details


Release history Release notifications | RSS feed

This version

0.5.6

Download files

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

Source Distribution

ssh-mitm-0.5.6.tar.gz (35.2 kB view details)

Uploaded Source

Built Distribution

ssh_mitm-0.5.6-py3-none-any.whl (48.7 kB view details)

Uploaded Python 3

File details

Details for the file ssh-mitm-0.5.6.tar.gz.

File metadata

  • Download URL: ssh-mitm-0.5.6.tar.gz
  • Upload date:
  • Size: 35.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for ssh-mitm-0.5.6.tar.gz
Algorithm Hash digest
SHA256 73d625507205d6a607e4859875fa913a96133ec1b4fc38c703bce4162bf43677
MD5 d35b4bb201785e7b15c1a91d234f19d1
BLAKE2b-256 eb16b8aac81b194e5a8ed2504c6bebaec4c31f20baa058448b6114afd19acc8b

See more details on using hashes here.

File details

Details for the file ssh_mitm-0.5.6-py3-none-any.whl.

File metadata

  • Download URL: ssh_mitm-0.5.6-py3-none-any.whl
  • Upload date:
  • Size: 48.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for ssh_mitm-0.5.6-py3-none-any.whl
Algorithm Hash digest
SHA256 49d54a01e2c73266c9f45265a280f570ed18acabd4d4b9c837d65e840abe53db
MD5 f4ddb36c9676bc97480d7062a84b3a13
BLAKE2b-256 42d665839cde9e010ed5ab96e8771383861eeb15c253eff7a3d8f932a5bb8b71

See more details on using hashes here.

Supported by

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