All Projects → ncouture → Mockssh

ncouture / Mockssh

Licence: other
Mock an SSH server and define all commands it supports (Python, Twisted)

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects
dsl
153 projects

Projects that are alternatives of or similar to Mockssh

lobbyboy
A lobby boy will create a VPS server when you need one, and destroy it after using it.
Stars: ✭ 212 (+98.13%)
Mutual labels:  ssh, ssh-server
Docker Sshd
Minimal Alpine Linux Docker image with sshd exposed and rsync installed
Stars: ✭ 291 (+171.96%)
Mutual labels:  ssh, ssh-server
tarssh
A simple SSH tarpit inspired by endlessh
Stars: ✭ 98 (-8.41%)
Mutual labels:  ssh, ssh-server
Secure Wireguard Implementation
A guide on implementing a secure Wireguard server on OVH (or any other Debian VPS) with DNSCrypt, Port Knocking & an SSH-Honeypot
Stars: ✭ 200 (+86.92%)
Mutual labels:  ssh, ssh-server
Ssb
Secure Shell Bruteforcer — A faster & simpler way to bruteforce SSH server
Stars: ✭ 832 (+677.57%)
Mutual labels:  ssh, ssh-server
Bastillion
Bastillion is a web-based SSH console that centrally manages administrative access to systems. Web-based administration is combined with management and distribution of user's public SSH keys.
Stars: ✭ 2,730 (+2451.4%)
Mutual labels:  ssh, ssh-server
Colab Ssh
Connect to Google Colab using SSH
Stars: ✭ 249 (+132.71%)
Mutual labels:  ssh, ssh-server
Dos ssh
Use BIOS ram hacks to make a SSH server out of any INT 10 13h app (MS-DOS is one of those)
Stars: ✭ 139 (+29.91%)
Mutual labels:  ssh, ssh-server
Ansible Ssh Hardening
This Ansible role provides numerous security-related ssh configurations, providing all-round base protection.
Stars: ✭ 746 (+597.2%)
Mutual labels:  ssh, ssh-server
Bastillion Ec2
A web-based SSH console to execute commands and manage multiple EC2 instances simultaneously running on Amazon Web Services (AWS).
Stars: ✭ 410 (+283.18%)
Mutual labels:  ssh, ssh-server
Ssh
Easy SSH servers in Golang
Stars: ✭ 2,254 (+2006.54%)
Mutual labels:  ssh, ssh-server
Sshportal
🎩 simple, fun and transparent SSH (and telnet) bastion server
Stars: ✭ 978 (+814.02%)
Mutual labels:  ssh, ssh-server
Ssh2docker
🐳 standalone SSH server that connects you to your Docker containers
Stars: ✭ 159 (+48.6%)
Mutual labels:  ssh, ssh-server
Leash
Browser Shell
Stars: ✭ 108 (+0.93%)
Mutual labels:  emulator, ssh
Wolfssh
wolfSSH is a small, fast, portable SSH implementation, including support for SCP and SFTP.
Stars: ✭ 142 (+32.71%)
Mutual labels:  ssh, ssh-server
sshsyrup
A low-to-medium interaction SSH Honeypot with features to capture terminal activity and upload to asciinema.org
Stars: ✭ 84 (-21.5%)
Mutual labels:  ssh, ssh-server
Sshserver
This is a tutorial on how to build a basic SSH Server in C#, but you are welcome to try following in any language.
Stars: ✭ 114 (+6.54%)
Mutual labels:  ssh, ssh-server
Coco
Jumpserver ssh/ws server
Stars: ✭ 139 (+29.91%)
Mutual labels:  ssh, ssh-server
Ssh Mitm
ssh mitm server for security audits supporting public key authentication, session hijacking and file manipulation
Stars: ✭ 335 (+213.08%)
Mutual labels:  ssh, ssh-server
Wssh
WSSH Is a tool for brute forcing servers that has port 22 open via ssh, wssh is probably the fastest ssh brute forcer available
Stars: ✭ 21 (-80.37%)
Mutual labels:  ssh, ssh-server

MockSSH

Mock an SSH server and all commands it supports.

Purpose

This project was developed to emulate operating systems behind SSH servers in order to test task automation without having access to the real servers.

There has been user interest in using MockSSH to perform end-to-end unit tests against SSH servers and as such a threaded version of MockSSH server is available as of version 1.4 (thanks to Claudio Mignanti).

Installation

MockSSH depends on libraries that do not support Python 3k.

mkvirtualenv -p `which python2` mocksshenv
pip install mockssh

MockSSH in Python

MockSSH aims to be as easy to use as possible.

Refer to the mock_cisco.py and mock_F5.py in the examples/ directory for an overview on how to use it.

MockSSH in LISP

Efforts were invested in simplifying the use of MockSSH with HyLang.

As a result a DSL is released with this project and resides in the mocksshy/ directory.

Using the DSL will allow you to use MockSSH by writing something that is closer to a configuration file than a program.

For comparison, here are two MockSSH servers implementations providing the same functionality:

Python

import MockSSH

def passwd_change_protocol_prompt(instance):
    instance.protocol.prompt = "hostname #"
    instance.protocol.password_input = False

def passwd_write_password_to_transport(instance):
    instance.writeln("MockSSH: password is %s" % instance.valid_password)

command_passwd = MockSSH.PromptingCommand(
    name='passwd',
    password='1234',
    prompt="Password: ",
    success_callbacks=[passwd_change_protocol_prompt],
    failure_callbacks=[passwd_write_password_to_transport])

users = {'admin': '1234'}

commands = [command_passwd]

MockSSH.runServer(commands,
                  prompt="hostname>",
                  interface='127.0.0.1',
                  port=2222,
                  **users)

HyLang

(import MockSSH)
(require mocksshy.language)


(mock-ssh :users {"testuser" "1234"}
          :host "127.0.0.1"
          :port 2222
          :prompt "hostname>"
          :commands [
  (command :name "passwd"
           :type "prompt"
           :output "Password: "
           :required-input "1234"
           :on-success ["prompt" "hostname#"]
           :on-failure ["write" "Pass is 1234..."]))

Unit Testing with MockSSH

As shown from the unit tests in the tests/ directory, it is possible to use a threaded MockSSH server to perform end-to-end unit tests against mocked SSH services.

Note that this may not be the right approach depending on your use case as only one Twisted reactor can run at the same time and reactors cannot be restarted.

Credits

MockSSH is derived from kippo, an SSH honeypot.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].