exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

qpoppassd.txt

qpoppassd.txt
Posted Apr 30, 2003
Authored by Xpl017Elz | Site inetcop.org

INetCop Security Advisory #2003-0x82-016 - Qpopper v4.0.x poppassd, the utility that allows users to change their mail passwords, is setuid root and allows for a definable path to smbpasswd. In doing so, a local attacker can easily escalate to root privileges.

tags | advisory, local, root
SHA-256 | 20cb7ad78ee34a4462fc2669a4d2d11d3fe2de2037bd5095118d7d9b3abee361

qpoppassd.txt

Change Mirror Download

========================================
INetCop Security Advisory #2003-0x82-016
========================================


* Title: Qpopper v4.0.x poppassd local root exploit


0x01. Description


Qpopper poppassd is a program that changes system passwords thus allowing users
to change their mail passwords.
We found security bug to poppassd that is included to basis to Qpopper v4.0.x.
Through this security bug, allow root user's authority to general user.
For reference, poppassd is daemon that is executed by root (uid 0).

example>
/etc/services: epass 106/tcp poppassd
/etc/inetd.conf: epass stream tcp nowait root /usr/sbin/tcpd poppassd

Vulnerability can presume as following.
There is dochild() function to 711 lines of 'password/poppassd.c' code.

__
...
170 #define PASSWD_BINARY "/usr/bin/passwd" /* TBD: config.h */
171 #define SMBPASSWD_BINARY "/usr/bin/smbpasswd" /* TBD: config.h */
...
711 int dochild (int master, char *slavedev, char *userid, int smb)
712 {
...
781 if (!smb)
782 {
784 setregid ( pw->pw_gid, pw->pw_gid ); // It's natural.
785 setreuid ( pw->pw_uid, pw->pw_uid ); // It's natural. ;-)
786
787 execl ( pwd_binary, "passwd", NULL ); // ok, is executed by general user.
788
789 err_msg ( HERE, "can't exec %s", pwd_binary );
790 exit ( 1 );
791 }
792 else
793 {
794 TRACE ( trace_file, POP_DEBUG, HERE, "...changing smb password" );
795 execl ( smb_binary, "smbpasswd", userid, NULL ); // Ooops, is executed by root user.
796
797 err_msg ( HERE, "can't exec %s", smb_binary );
798 exit ( 1 );
799 }
800 }
...
--

Setuid of "/usr/bin/smbpasswd" is not established.
Certainly, "/usr/bin/smbpasswd" may be executed as root competence.
Root setuid of poppassd is established.

--
[x82@xpl017elz password]$ cat Makefile | grep install
# * - Added patch by Steven Champeon to fix install and lib.
installdir = ${exec_prefix}/bin
INSTALL = /usr/bin/install -c
install:
${INSTALL} -m 4755 -o root -g 0 poppassd ${installdir}/poppassd; \
echo "Installed poppassd as ${installdir}/poppassd"
[x82@xpl017elz password]$ pwd
/qpopper4.0.5/password
[x82@xpl017elz password]$ ls -al /usr/local/bin/poppassd
-rwsr-xr-x 1 root root 108300 Apr 17 00:55 /usr/local/bin/poppassd
[x82@xpl017elz password]$ poppassd -?
poppassd [-?] [-d] [-l 0|1|2] [-p [passd-path]] [-R] [-s [smbpasswd-path]]
[-t trace-file] [-v] [-y log-facility]
[x82@xpl017elz password]$
--

Fatal vulnerability !! It happens because general user can control smbpasswd's path.
'-s' option capacitates it.


0x02. Vulnerable Packages


It's poppassd version that is included to qpopper regardless of improved version.

--
[x82@xpl017elz /tmp]$ poppassd -v
poppassd version 4.0.5b2
[x82@xpl017elz /tmp]$
--

Vendor site: https://www.qualcomm.com/

qpopper4.0.5 (Inclusion)
-qpopper4.0.5.tar.gz
+Linux
+*BSD
+SunOS
+AIX
+IRIX
+SCO_SV
+Other
qpopper4.0.4 (Inclusion)
-qpopper4.0.4.tar.gz
qpopper4.0.3 (Inclusion)
-qpopper4.0.3.tar.gz
qpopper4.0.x

beta version: qpopper4.0.*


0x03. Exploit


We finished exploit. (Tested it in Linux.)


[x82@xpl017elz /tmp]$ ./0x82-Local.Qp0ppa55d -u x82 -p mypasswd

Qpopper v4.0.x poppassd local root exploit.
by Xpl017Elz

[+] make code.
[+] execute poppassd.
200 xpl017elz poppassd v4.0.5b2 hello, who are you?
[+] input username.
200 your password please.
[+] input password.
200 your new password please.
[+] input fake new password.
[+] wait, 2sec.
[+] Ok, exploited successfully.
[*] It's Rootshell !

[root@xpl017elz /root]# id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
[root@xpl017elz /root]#


0x04. Patch


It is vendor's share that trim vulnerability.
Can reduce danger that remove setuid simply, or designate wheel group.

# chmod -s poppassd

or,

# chgrp wheel poppassd
# chmod o-rx poppassd
# chmod u+s poppassd

And, very excellent poppassd package version exists.
poppassd in Qpopper package does not use for the present. :-p

--


P.S: Sorry, for my poor english.


--
By "dong-houn yoU" (Xpl017Elz), in INetCop(c) Security.

MSN & E-mail: szoahc(at)hotmail(dot)com,
xploit(at)hackermail(dot)com

INetCop Security Home: https://www.inetcop.org (Korean hacking game)
My World: https://x82.i21c.net & https://x82.inetcop.org

GPG public key: https://x82.inetcop.org/h0me/pr0file/x82.k3y
--

Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    8 Files
  • 9
    Nov 9th
    3 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    14 Files
  • 12
    Nov 12th
    20 Files
  • 13
    Nov 13th
    63 Files
  • 14
    Nov 14th
    18 Files
  • 15
    Nov 15th
    8 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    18 Files
  • 19
    Nov 19th
    7 Files
  • 20
    Nov 20th
    0 Files
  • 21
    Nov 21st
    0 Files
  • 22
    Nov 22nd
    0 Files
  • 23
    Nov 23rd
    0 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

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close