Bueno, sin mas, aqui dejo el codigo, ya lo mejorare ;). Es bastante rapido. Si alguien no entiende lo que hace que se lea HTTP al descubierto (http://foro.portalhacker.net/index.php/topic,120908.0.html)
#include <stdio.h>
#include <winsock.h>
int main()
{
WSADATA wsa;
SOCKET sock;
char peticion[]="GET / HTTP/1.0\r\n\r\n";
char buffer[1024];
struct sockaddr_in dir;
struct hostent *host;
WSAStartup( MAKEWORD(1,1), &wsa);
sock=socket( AF_INET, SOCK_STREAM, 0);
host=gethostbyname( "localhost");
dir.sin_addr=*((struct in_addr *)host->h_addr);
dir.sin_family=AF_INET;
dir.sin_port=htons(80);
if(connect( sock, (struct sockaddr *)&dir, sizeof(struct sockaddr))==-1)
{
return 1;
}
send
( sock
, peticion
, strlen(peticion
),0); recv( sock, buffer, 1023, 0);
closesocket( sock);
return 0;
}
Sa1uDoS