From: "sMoTo" To: Subject: Question concerning proftpd exploit Date: Thu, 6 Nov 2003 13:42:17 +0100 Message-ID: <000001c3a463$6d510650$02000a0a@lady> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0001_01C3A46B.CF156E50" Sender: owner-selinux@tycho.nsa.gov List-Id: selinux@tycho.nsa.gov This is a multi-part message in MIME format. ------=_NextPart_000_0001_01C3A46B.CF156E50 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello, I have created a SELinux System running a vulnerable proftpd daemon (see http://xforce.iss.net/xforce/alerts/id/154). My ps listing in enforcing mode looks like this: PID CONTEXT COMMAND 1 system_u:system_r:init_t init 2 system_u:system_r:kernel_t [keventd] 3 system_u:system_r:kernel_t [ksoftirqd_CPU0] 4 system_u:system_r:kernel_t [kswapd] 5 system_u:system_r:kernel_t [bdflush] 6 system_u:system_r:kernel_t [kupdated] 9 system_u:system_r:kernel_t [kjournald] 828 system_u:system_r:syslogd_t syslogd -m 0 832 system_u:system_r:klogd_t klogd -x 869 system_u:system_r:ftpd_t proftpd: (accepting connections) 878 system_u:system_r:sshd_t /usr/sbin/sshd 900 system_u:system_r:sendmail_t sendmail: accepting connections 909 system_u:system_r:sendmail_t sendmail: Queue runner@01:00:00 f 921 system_u:system_r:httpd_t /usr/sbin/httpd 930 system_u:system_r:gpm_t gpm -t imps2 -m /dev/mouse 939 system_u:system_r:crond_t crond 947 system_u:system_r:local_login_t login -- root 948 system_u:system_r:local_login_t login -- root 949 system_u:system_r:getty_t /sbin/mingetty tty3 950 system_u:system_r:getty_t /sbin/mingetty tty4 951 system_u:system_r:getty_t /sbin/mingetty tty5 952 system_u:system_r:getty_t /sbin/mingetty tty6 953 system_u:system_r:httpd_t /usr/sbin/httpd 954 system_u:system_r:httpd_t /usr/sbin/httpd 955 system_u:system_r:httpd_t /usr/sbin/httpd 956 system_u:system_r:httpd_t /usr/sbin/httpd 957 system_u:system_r:httpd_t /usr/sbin/httpd 958 system_u:system_r:httpd_t /usr/sbin/httpd 959 system_u:system_r:httpd_t /usr/sbin/httpd 960 system_u:system_r:httpd_t /usr/sbin/httpd 961 root:sysadm_r:sysadm_t -bash 1012 root:sysadm_r:sysadm_t -bash 1064 root:sysadm_r:sysadm_t ps -e --context The proftpd daemon runs in its own domain. ftpd_t The open source proof of concept exploit code gains a root shell on my Red Hat 8.0 System without running in enforcing mode. I ran the system with a maintenance kernel. If I would switch to enforcing mode, what would happen? Does the exploit gain a root shell with privileges system_u:system_r:ftp_t? Is this possible? Which security feature of SELinux handles such attacks? Which avc loggings should I see? Best regards. ### Oliver Fritz ### Singerstrasse 80 ### 10243 Berlin ------=_NextPart_000_0001_01C3A46B.CF156E50 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hello,

 

I have created a = SELinux System running a vulnerable proftpd daemon (see http://xforce.iss.net/xforce/alerts/id/154). My ps listing in enforcing = mode looks like this:

 

PID CONTEXT       &nbs= p;            = ;            =   COMMAND

    1 system_u:system_r:init_t           &nbs= p;     init

    2 system_u:system_r:kernel_t       &nbs= p;       [keventd]

    3 system_u:system_r:kernel_t       &nbs= p;       [ksoftirqd_CPU0]

    4 system_u:system_r:kernel_t       &nbs= p;       [kswapd]

    5 system_u:system_r:kernel_t       &nbs= p;       [bdflush]

    6 system_u:system_r:kernel_t       &nbs= p;       [kupdated]

    9 system_u:system_r:kernel_t       &nbs= p;       [kjournald]

  828 system_u:system_r:syslogd_t       &nbs= p;      syslogd -m = 0

  832 system_u:system_r:klogd_t       &nbs= p;        klogd -x

  869 system_u:system_r:ftpd_t       &nbs= p;         proftpd: (accepting connections)

  878 system_u:system_r:sshd_t       &nbs= p;         /usr/sbin/sshd

  900 system_u:system_r:sendmail_t       &nbs= p;     sendmail: accepting connections

  909 system_u:system_r:sendmail_t          &nbs= p;  sendmail: Queue runner@01:00:00 = f

  921 system_u:system_r:httpd_t       &nbs= p;        /usr/sbin/httpd

  930 system_u:system_r:gpm_t       &nbs= p;          gpm -t imps2 -m /dev/mouse

  939 system_u:system_r:crond_t       &nbs= p;        crond

  947 system_u:system_r:local_login_t       &nbs= p;  login -- root    

  948 system_u:system_r:local_login_t       &nbs= p;  login -- root    

  949 system_u:system_r:getty_t       &nbs= p;        /sbin/mingetty tty3

  950 system_u:system_r:getty_t       &nbs= p;        /sbin/mingetty tty4

  951 system_u:system_r:getty_t       &nbs= p;        /sbin/mingetty tty5

  952 system_u:system_r:getty_t       &nbs= p;        /sbin/mingetty tty6

  953 system_u:system_r:httpd_t       &nbs= p;        /usr/sbin/httpd

  954 system_u:system_r:httpd_t       &nbs= p;        /usr/sbin/httpd

  955 system_u:system_r:httpd_t       &nbs= p;        /usr/sbin/httpd

  956 system_u:system_r:httpd_t       &nbs= p;        /usr/sbin/httpd

  957 system_u:system_r:httpd_t       &nbs= p;        /usr/sbin/httpd

  958 system_u:system_r:httpd_t       &nbs= p;        /usr/sbin/httpd

  959 system_u:system_r:httpd_t       &nbs= p;        /usr/sbin/httpd

  960 system_u:system_r:httpd_t       &nbs= p;        /usr/sbin/httpd

  961 root:sysadm_r:sysadm_t       &nbs= p;           -bash

 1012 root:sysadm_r:sysadm_t       &nbs= p;           -bash

 1064 root:sysadm_r:sysadm_t        =        &nbs= p;   ps -e --context

 

The proftpd daemon = runs in its own domain. ftpd_t

 

The open source proof = of concept exploit code gains a root shell on my Red Hat 8.0 System without running in enforcing mode. I ran the system with a maintenance kernel. = If I would switch to enforcing mode, what would happen? Does the exploit gain a = root shell with privileges system_u:system_r:ftp_t? Is this possible? =

Which security feature = of SELinux handles such attacks? Which avc = loggings should I see?

 

 

Best regards.

 = ;

### = Oliver Fritz

### Singerstrasse 80

### = 10243 Berlin

 

------=_NextPart_000_0001_01C3A46B.CF156E50-- -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with the words "unsubscribe selinux" without quotes as the message.