exploit the possibilities

sses-sshauth.txt

sses-sshauth.txt
Posted May 17, 2000
Site sses.net

A vulnerable secure shell distribution is available from the popular Zedz Consultants FTP site (formally known as replay.com). The RedHat Linux RPM ssh-1.2.27-8i.src.rpm contains a PAM patch which contains faulty logic allowing users to essentially pass through the username/password authentication step and gain shell access.

tags | exploit, shell
systems | linux, redhat
MD5 | 95b80c63f273743306ae2cf0b0b7b355

sses-sshauth.txt

Change Mirror Download
Sword & Shield Enterprise Security, Inc. - Security Advisory
www.sses.net, Copyright (c) 2000

Advisory: Secure Shell Authentication Vulnerability
Release Date: May 10, 2000
Application: sshd
Severity: High - A user (local or remote) can log into any account
with a valid login shell.
Status: Affected systems should install alternative version.
Archive: The advisory sses-002-auth-vul.txt
is available at ftp://ftp.sses.net/pub/security/advisories

SUMMARY
-------
A vulnerable secure shell distribution is available from the popular
Zedz Consultants FTP site (formally known as replay.com). The
RedHat Linux RPM ssh-1.2.27-8i.src.rpm contains a PAM patch which
contains faulty logic allowing users to essentially pass through
the username/password authentication step and gain shell access.

It should be stressed that the ssh distribution 1.2.27-7us.rpm
and 1.2.27-7i.rpm available from the web site do not contain this
vulnerability. The vulnerable distribution (1.2.27-8i.src.rpm) is
located in the "incoming" directory at ftp://ftp.zedz.net/pub/
cryptoI/incoming (formerly pub/crypto/incoming). It is also
possible that the distribution could have been obtained from
the pub/crypto/redhat/unsorted directory.

Due to the obscure location of the vulnerable distribution
it is not known at this time how wide spread the impact of
this vulnerability is.

The vulnerable distribution has been removed from the site and
should no longer be accessible.


DESCRIPTION
-----------
The vulnerable ssh distribution is patched with defective logic
related to PAM authentication. The offending code from the patch
file ssh-1.2.27-pam.patch is:

+#ifdef HAVE_PAM
+ {
+ retval = origretval;
+ pampasswd = xstrdup(password);
+ if (retval == PAM_SUCCESS)
+ retval = pam_authenticate ((pam_handle_t *)pamh, 0);
+ if (retval == PAM_SUCCESS || retval == PAM_AUTH_ERR)
+ retval = pam_acct_mgmt ((pam_handle_t *)pamh, 0);
+ xfree(pampasswd);
+ }
+#else /* HAVE_PAM */

Note the last 'if' statement - in essence whether the pam_authenticate()
call is successful or not, the pam_acct_mgmt() call is made overwriting
the contents of retval. Assuming the pam_acct_mgmt() call is
successful, and it tends to be, then the remaining patch code dealing
with PAM authentication opens a session with:

+#ifdef HAVE_PAM
+ {
+ if (retval == PAM_SUCCESS)
+ retval = pam_open_session ((pam_handle_t *)pamh, 0);
+ return (retval == PAM_SUCCESS);
+ }
+#endif /* HAVE_PAM */


By running the patch command patch -p0 -b < ssh-1.2.27-pam.patch we get,

patching file `ssh-1.2.27/acconfig.h'
patching file `ssh-1.2.27/auth-passwd.c'
patching file `ssh-1.2.27/config.h.in'
patching file `ssh-1.2.27/configure.in'
patching file `ssh-1.2.27/sshd.c'

The faulty PAM authentication logic is then inserted into the
auth_password() function in the auth-passwd.c file at lines
745-755 and 879-885.


IMPACT
------
The impact of this bug can be quite severe.

On systems where the /etc/ssh/sshd_config file contains
'PermitRootLogin=yes' the effect is that any remote or
local user can obtain root access by specifying a root
login and entering a non-null password.

Example, if a system (pigpen) configured with the vulnerable ssh server
package has a valid user account (joe) then the command:

% ssh -l joe pigpen
joe@pigpen's password: 123 <--- sshd prompts for password, enter '123'.
... <--- faulty authentication check performed
[joe@pigpen]$ <--- user shell accessed

Checking the syslogs also reveals signs of the problem:

1- May 8 13:12:50 pigpen sshd[13422]: connect from 10.10.10.10
2- May 8 13:12:50 pigpen sshd[13422]: log: Connection from 10.10.10.10
port 1209
3- May 8 13:12:52 pigpen PAM_pwdb[13422]: authentication failure;
(uid=0) -> joe for ssh service
4- May 8 13:12:53 pigpen PAM_pwdb[13422]: (ssh) session opened for user joe
by (uid=0)
5- May 8 13:12:53 pigpen sshd[13422]: log: Password authentication for joe
accepted.


Note the authentication failure recorded by PAM on line 3, but lines 4-5
show the session being opened.

It is important to note a few things here:

1) Even if an account is password locked, if it contains a valid shell
the account can be accessed.

2) Site specific user accounts are not necessary for searching out vulnerable
systems when standard Linux distribution/package accounts like 'gdm',
'postgres', or 'mysql' will do.


This vulnerable SSH RPM has been available since March 1, 2000.


RESOLUTION
----------

De-install: If your ssh installation is vulnerable, you should remove
the vulnerable version and install version 1.2.27-7us.

Use OpenSSH: Another alternative to consider is switching over to openssh
available from http://www.openssh.com.


AFFECTED VERSIONS and SYSTEMS
-----------------------------

RedHat Linux, RPM ssh-1.2.27-8i.src.rpm.

ACKNOWLEDGEMENTS
----------------
The bug discovery, test, demonstration, vendor coordination,
and advisory generation are the results of SSES, Inc. security engineers
John McNeely and Dennis Edmonds.

Thanks to Alex De Joode at Zedz Consultants for a quick response and
removal of the vulnerable distribution.

DISCLAIMER
----------
Although SSES, Inc. intends to provide accurate information, this
advisory does not claim to be complete or usable for any purpose.

NO WARRANTY
-----------
This advisory is provided on an "as is" basis. SSES, Inc. makes no
warranties of any kind, either expressed or implied as to any matter
including, but not limited to, warranty of fitness for a particular
purpose or merchantability, exclusivity or results obtained from use
of the material. SSES, Inc. does not make any warranty of any kind
with respect to freedom from patent, trademark, or copyright infringement.

The supplied advisory is not to be used for malicious purposes and
should be used for informational purposes only.
Login or Register to add favorites

File Archive:

November 2020

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2020 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close