xploiting
unread,Sep 30, 2008, 11:13:52 AM9/30/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Código Fuente (España)
Hola, estoy programando un cliente de irc en C. Consigo conectar,
mando el nick, devuelvo el ping, y mando el user ident, pero no hay
manera de pasar de ahí. He comprobado que el servidor recibia los
comandos porque registré el tráfico con wireshark, y vi como el
servidor me mandaba los ACK cada vez que enviaba un comando.
Como puedo superar el paso de user ident? alguna idea?
Gracias, he aquí el codigo:
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#define PORT 6667
#define MAXDATASIZE 100
#define MAX 1000
int main(int argc, char *argv[])
{
int fd, numbytes,a;
char buf2[MAX];
char buf[MAXDATASIZE], mensaje[20], mensaje2[200];
struct hostent *he;
struct sockaddr_in server;
he=gethostbyname(argv[1]);
fd=socket(AF_INET, SOCK_STREAM, 0);
server.sin_family=AF_INET;
server.sin_port=htons(PORT);
server.sin_addr=*((struct in_addr *)he->h_addr);
bzero(&(server.sin_zero),8);
connect(fd, (struct sockaddr *)&server,sizeof(struct sockaddr));
numbytes=recv(fd,buf,MAXDATASIZE,0);
buf[numbytes]='\0';
printf("Mensaje del Servidor: %s\n",buf);
send(fd,"nick spycka",211,0);
numbytes=recv(fd,buf,MAXDATASIZE,0);
buf[numbytes]='\0';
printf("Mensaje del Servidor: %s\n",buf);
gets(mensaje);
send(fd,mensaje,211,0);
send(fd,"user ident pereira ramos josu",50,0);
numbytes=recv(fd,buf2,MAX,0);
buf2[numbytes]='\0';
printf("%s\n",buf2);
close(fd);