/* * detecttr.c - by whynot AKA baldor (whynot@cyberjunkie.com) * created: 08.05.97 * last modified: 11.07.97 * Platforms: Linux, FreeBSD should work with other POSIX-systems too. * * Compile: * just the usual "gcc -o detecttr detecttr.c" for GNU C and * "cc -o detecttr detecttr.c" for other compilers... * * Usage: * Just run this program at the startup of your machine - it will stay in * the background until someone traceroutes you. It only uses a *tiny* bit * of your memory and nearly 0% CPU :) * */ #include #include #include #include #include #include #include #include #include #include #include /* simply comment this out if you don't have syslog.h */ #include #define MAXBUFLEN 200 #define MYPORT 33435 #define NUMPORTS 30*3 int sockfd[NUMPORTS]; void shutitdown() { int w; char buf[50]; for (w=0; wh_name; } main(int argc, char *argv[]) { int hops; struct sockaddr_in my_addr; struct sockaddr_in remote_addr; int addr_len, numbytes; char buf[MAXBUFLEN]; int w; fd_set readfds; if( fork() !=0 ) return(0); /* we don't want to use that annonying & */ signal(SIGHUP, SIG_IGN); /* ignore SIGHUP */ signal(SIGTERM, shutitdown); /* clean shutdown */ for(w=0; w