Computer Security
[EN] securityvulns.ru
no-pyccku





L0pht Security Advisory




L0pht Security Advisory





                      L0pht Security Advisory

       Advisory Name: PamSlam
   Advisory Released: [01/04/00]
         Application: userhelper and PAM on Redhat Linux 6.0/6.1
            Severity: A local user can gain root access.
              Status: Vendor contacted. Fix provided by vendor.
                      Advisory released.
              Author: dildog@l0pht.com
                 WWW: http://www.l0pht.com/advisories.html

Overview:

       Both 'pam' and 'userhelper' (a setuid binary that comes with the
'usermode-1.15' rpm) follow .. paths. Since pam_start calls down to
_pam_add_handler(), we can get it to dlopen any file on disk. 'userhelper'
being setuid means we can get root.

Description:

       The combination of the fact that both userhelper and PAM follow ..
paths allows us to craft up a file that causes userhelper (by way of PAM) to
dlopen any shared object we want as root. The exploit is simple, and utilizes
the '-w' option of userhelper, which lets us specify a program to run with the
privileges designated by PAM. This tries to only execute programs that have
entries in /etc/security/console.apps, but since we get to specify the name,
something like ../../../tmp/myprog gets us a file open path that looks like
/etc/security/console.apps/../../../tmp/myprog. "strcat" is not a good way to
keep a filename below a directory!

       After this hurdle, PAM is called to start up the binary, and it does
the same thing, looking for the filename in /etc/pam.d. If we've placed a rogue
pam.d configuration file in /tmp/myprog, then it can be pointed to
/etc/pam.d/../../../tmp/myprog. In the pam.d configuration file, we get to pick
a few shared libraries to dlopen, so at this point, we get root.

The following exploit demonstrates this vulnerability by creating a
'rootshell library' that creates a shell when dlopened, creating a pam.d-style
configuration file, and then running userhelper with the appropriately dotted
path.


Quick solution:

       Download the fix from RedHat at:

  Intel:
  ftp://updates.redhat.com/6.1/i386/pam-0.68-10.i386.rpm
  ftp://updates.redhat.com/6.1/i386/usermode-1.17-1.i386.rpm

  Alpha:
  ftp://updates.redhat.com/6.1/alpha/pam-0.68-10.alpha.rpm
  ftp://updates.redhat.com/6.1/alpha/usermode-1.17-1.alpha.rpm

  Sparc:
  ftp://updates.redhat.com/6.1/sparc/pam-0.68-10.sparc.rpm
  ftp://updates.redhat.com/6.1/sparc/usermode-1.17-1.sparc.rpm

  Source packages:
  ftp://updates.redhat.com/6.1/SRPMS/pam-0.68-10.src.rpm
  ftp://updates.redhat.com/6.1/SRPMS/usermode-1.17-1.src.rpm

  Red Hat Linux 6.0:

  Intel:
  ftp://updates.redhat.com/6.1/i386/pam-0.68-10.i386.rpm
  ftp://updates.redhat.com/6.1/i386/usermode-1.17-1.i386.rpm
  ftp://updates.redhat.com/6.0/i386/SysVinit-2.77-2.i386.rpm

  Alpha:
  ftp://updates.redhat.com/6.1/alpha/pam-0.68-10.alpha.rpm
  ftp://updates.redhat.com/6.1/alpha/usermode-1.17-1.alpha.rpm
  ftp://updates.redhat.com/6.0/alpha/SysVinit-2.77-2.alpha.rpm

  Sparc:
  ftp://updates.redhat.com/6.1/sparc/pam-0.68-10.sparc.rpm
  ftp://updates.redhat.com/6.1/sparc/usermode-1.17-1.sparc.rpm
  ftp://updates.redhat.com/6.0/sparc/SysVinit-2.77-2.sparc.rpm

  Source packages:
  ftp://updates.redhat.com/6.1/SRPMS/pam-0.68-10.src.rpm
  ftp://updates.redhat.com/6.1/SRPMS/usermode-1.17-1.src.rpm
  ftp://updates.redhat.com/6.0/SRPMS/SysVinit-2.77-2.src.rpm
       
Exploit:

Uudecode the following script. Run the script.




Boing.

dildog@l0pht.com

 [ For more advisories check out http://www.l0pht.com/advisories.html ]


About | Terms of use | Privacy Policy
© SecurityVulns, 3APA3A, Vladimir Dubrovin
Nizhny Novgorod

 
 



Rating@Mail.ru