I tried to crack (brute force) my pri­vate SSH key I use, but I couldn’t find a work­ing tool for Win­dows, so I mod­i­fied a sim­ple pri­vate key cracker done by anonymous@echo.or.id. I also tweaked it a bit, I increased the per­for­mance and added a basic benchmark.

Update 19.10.2007: new ver­sion (0.3) added, increased per­for­mance about 50%.

1
2
3
4
5
6
7
8
9
ssh-privkey-crack v0.3 made by anonymous@echo.or.id,
enhanced by michu@neophob.com

Usage: ssh-privkey-crack [DSA or RSA pri­vate key file] [-v|-q]
–v: ver­bose mode
–q: quite mode
Exam­ple:
$ john-mmx –std­out –incre­men­tal | ssh-privkey-crack id_dsa
$ ssh-privkey-crack id_dsa < dictionary

Here is a sam­ple out­put of a suc­cess­fully attack:

1
2
3
4
5
6
7
8
9
10
11
12
ssh-privkey-crack v0.3 made by anonymous@echo.or.id,
enhanced by michu@neophob.com

key­header:
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,256BD3BB384A1DDC

try­ing inf keys/s, # of tested keys: 3001.
—————————————————– — -
Passphrase match: .
Found pass­word after 0 sec­onds and 3107 tries.
——————————————————- — -

This brute force method is not really fast, I com­pute about 15’000 keys / s on a P4 (4000 Bogo Mips).