Skip to content

Commit 3938358

Browse files
authored
Merge pull request #3 from The5imon/documentation
Release Documentation
2 parents 011e5c6 + 6a32221 commit 3938358

File tree

8 files changed

+141
-8
lines changed

8 files changed

+141
-8
lines changed

README.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,43 @@
1-
# SSH-MITM Plugins
1+
# SSH-MITM Plugins
2+
3+
![SSH-MITM example](https://ssh-mitm.at/img/mitm-example.png)
4+
5+
With version 0.4.0 the [ssh-mitm](http://ssh-mitm.at/) projects locks the features
6+
shipping with the core functionality of the program. It is now preferred that any additions to the
7+
feature-set is made through the modular capabilities that the ssh-mitm project is built upon. Using
8+
entrypoints in combination with modules anyone can make their own ssh-mitm plugins.
9+
10+
This projects adds some advanced features to the ssh-mitm server that furthers its capabilities
11+
to realise security audits.
12+
13+
## Installation
14+
15+
Installing the ssh-mitm server including these plugins is very simple:
16+
17+
$ pip install ssh-mitm-plugins
18+
19+
The current version of the ssh-mitm server will be installed and additional advanced features
20+
will be available through these plugins. The ssh-mitm server will operate normally as described
21+
by the [ssh-mitm project](#ssh-mitm).
22+
23+
## Plugins
24+
25+
Following advanced features will be made available through the modular runtime compilation of
26+
the ssh-mitm server.
27+
28+
#### SSH
29+
* stealthshell - improving on the *injectorshell*, this ssh interface will
30+
make hijacking of a ssh session undetectable
31+
* scriptedshell - perfect for security audits and information gathering, this ssh interface executes
32+
a script on the remote machine and stores the output on the ssh-mitm server
33+
34+
For a more detailed look at the plugins usage and operation refer to the
35+
[documentation](http://ssh-mitm-plugins.readthedocs.io).
36+
37+
## SSH-MITM
38+
39+
**For more information about the core functionality of the ssh-mitm server visit:**
40+
41+
* Github - https://github.com/ssh-mitm/ssh-mitm
42+
* Website - http://ssh-mitm.at
43+
* Documentation - http://docs.ssh-mitm.at

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# Add any Sphinx extension module names here, as strings. They can be
2828
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
2929
# ones.
30-
extensions = ['recommonmark', 'sphinx_rtd_theme']
30+
extensions = ['recommonmark', 'sphinx_rtd_theme', 'sphinx.ext.autosectionlabel']
3131

3232
# Add any paths that contain templates here, relative to this directory.
3333
templates_path = ['_templates']

docs/index.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@
66
SSH-MITM Plugins Documentation
77
============================================
88

9+
Home
10+
======
11+
912
.. toctree::
1013
:maxdepth: 2
11-
:caption: Contents:
1214

13-
injectorshell
14-
scriptedshell
15+
start
16+
ssh-interfaces
17+

docs/injectorshell.rst

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1-
Injectorshell
2-
=================
1+
injectorshell
2+
===============
33

4+
Included in the original `ssh-mitm <http://ssh-mitm.at/>`_ suit this is a detailed documentation
5+
by its creator.
6+
7+
The injectorshell ssh interface allows the operator of the ssh-mitm server to serve out shell access over
8+
the network that correspond to a hijacked ssh session. Within these injected shells one is able to
9+
execute commands on the remote host using the ssh session created by the original client. Contrary to the
10+
mirrorshell there can be multiple injected shells per ssh session. All these shells - including the client itself -
11+
share their environment but are served answers individually.
12+
13+
Using the ``--ssh-injector-enable-mirror`` option injected shells can print the input of the user to their screen.
14+
This differs from the mirrorshell which always displays output on the injected as well as the clients shell. The injectorshell
15+
tries its best to not leak any unwanted output to the users session so that they can operate normally.
16+
17+
By default injector shell access is limited to the local maschine ``localhost`` but can be opened up to any
18+
network using the ``--ssh-injector-net NET/IF`` parameter. Due to the fact that access to the injector shells is
19+
not authenticated doing this should be thoroughly thought through.
20+
21+
For ease of use a private key can be used for a more consistent integrity check. It can be set with the
22+
``--ssh-injector-key ID`` parameter. If this is not done a new one will be generated each time the server is spun up.
23+
24+
.. note::
25+
It should also be noted that shell environment can be affected by any injector shell and is not accounted for when
26+
considering stealth. This means environment variables or the working directory for example can be changed by any
27+
injector shell and will alert the original shells owner of faulty operation.
28+
29+
.. important::
30+
It is also important to mention that when multiple injector shells are inserting commands into the same hijacked ssh
31+
session at the same time discrepancies are not accounted for. Keystrokes are collectively merged at the server and the
32+
responses are served accordingly. This is also true for the clients interactive ssh session. A advanced edition of the
33+
injectorshell - the :ref:`stealthshell` - fixes both these problems.

docs/scriptedshell.rst

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1-
Scriptedshell
1+
scriptedshell
22
===============
33

4+
When working through a security audit gathering information is one of the most important steps.
5+
6+
The scriptedshell ssh interface is first and foremost an information gathering tool but due to its
7+
functionality it can also be used for different use cases. This plugin will execute a shell script
8+
when a new ssh session is opened by a client. The output of the script will be stored locally on the
9+
ssh-mitm machine under their respective session name.
10+
11+
.. note::
12+
Stored script output is taken from the server as-is with some ANSI control characters removed.
13+
14+
The ``--ssh-script SCRIPT`` parameter declares the location of the script.
15+
16+
The ``--ssh-out-dir DIR`` parameter indicates where the output of each session script execution should be stored.

docs/ssh-interfaces.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
SSH Interfaces
2+
============================================
3+
4+
.. toctree::
5+
:maxdepth: 2
6+
7+
injectorshell
8+
stealthshell
9+
scriptedshell

docs/start.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Start
2+
======
3+
4+
With version 0.4.0 the [ssh-mitm](http://ssh-mitm.at/) projects locks the features
5+
shipping with the core functionality of the program.
6+
It is now preferred that any additions to the
7+
feature-set is made through the modular capabilities that the ssh-mitm project is built upon. Using
8+
entrypoints in combination with modules anyone can make their own ssh-mitm plugins.
9+
10+
Here you will find detailed feature-oriented documentation of the creators
11+
additions to the ssh-mitm project.

docs/stealthshell.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
stealthshell
2+
=================
3+
4+
As an upgrade to the :ref:`injectorshell` (implementation in `ssh-mitm <http://ssh-mitm.at/>`_ done by me) the stealthshell
5+
provides a way to workaround the problem of interfering with the clients interactive session.
6+
It only executes injected commands when the shell of the user wont be affected. As long as the interactive shell of the
7+
client is not typing or executing a command input from the injector shells is halted and put in a waiting queue.
8+
9+
Using the ``--ssh-injector-super-stealth`` option the injector shells will only send whole commands instead of
10+
every keystroke. This further eliminates unwanted behavior. Unfinished commands from the injector shells are not seen
11+
by the server and the user of the interactive shell will never be surprised by input they never typed. This, however,
12+
will limit the terminal functionality of the injector shell. Because the server only responds to the whole command,
13+
terminal features like command auto-completion when pressing tab or command history with the up and down keys will not
14+
work correctly.
15+
16+
17+
.. note::
18+
Environment considerations of the :ref:`injectorshell` are still uphold by the stealthshell. Discrepancy problems
19+
described by the :ref:`injectorshell` are solved by this newer edition (client cannot be interrupted by injected keystrokes BUT
20+
unfinished injected strokes will be seen by the server). Only with the ``--ssh-injector-super-stealth`` option will the
21+
discrepancy between the user and all injector shells not occur. It is recommended that the ``--ssh-injector-super-stealth``
22+
option is used in combination with the ``--ssh-injector-enable-mirror`` option to see more clearly when commands
23+
can be executed.
24+
25+
For a more detailed look at the plugins operation refer to the :ref:`injectorshell` documentation.

0 commit comments

Comments
 (0)