On 1/18/06, Michael Halcrow <[EMAIL PROTECTED]> wrote:
> Heh. Here, I've got something to throw in root's crontab:
>
> #include <sys/types.h>
> #include <sys/stat.h>
> #include <fcntl.h>
> #include <unistd.h>
> #include <stdlib.h>
> #include <time.h>
> #include <stdio.h>
>
> int main()
> {
> int fd;
> unsigned long offset;
> char buf;
>
> srand(time(NULL));
> offset = rand() % 2000000;
> buf = offset % 255;
> fd = open("/proc/kcore", O_WRONLY); /* You need SE Linux ;-) */
> if (fd == -1) {
> printf("Run me as root\n");
> return 1;
> }
> lseek(fd, offset, SEEK_SET);
> write(fd, &buf, 1);
> close(fd);
> return 0;
> }
Or for the lazy:
while true; do
cat /dev/random > /proc/kcore
done
/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/