[plug] BIND and WU-FTPD

Campbell, David (Ex AS17) david.j.campbell at honeywell.com
Fri Mar 2 06:54:53 WST 2001


> Anyone with a bit more c than me like to put some comments in and explain
> Leons sig line.

001   #include <signal.h>
002   #include <time.h>
003   main()
004   {
005       srandom(time(0));
006       for (;;) {
007           int pid = random() % 30000;
008           if (pid > 1 && pid != getpid())
009               kill(pid, random() & 1 ? SIGSTOP : SIGBUS);
010           sleep(10);
011       }
012   }

Line 5, initialise random seed generator based on current time
Line 6, loop forever
Line 7, pick a random process ID (0 to 30000)
Line 8, make sure the process is not current process
Line 9, kill the process with the reason of "Normal Termination" or "Bus
Error"
Line 10, Wait 10 seconds so noone notices it was us.

Leon, been stealing code from M$ again?

David Campbell



More information about the plug mailing list