Welcome to HBH! If you had an account on hellboundhacker.org you will need to reset your password using the Lost Password system before you will be able to login.

More Winsock Help


ghost's Avatar
0 0

I have been continuing work on my winsock. My latest project is to make a program that will fetch the login prompt text from my router's(192.168.1.1) telnet prompt.The code mentioned below executes but shows a string I cannot make any sense of(its the same string always).

#include<windows.h>
main()
{
      
      
WSADATA wsaData;
int starterr = WSAStartup(MAKEWORD(2,2), &wsaData);
SOCKET mysock = socket(AF_INET,SOCK_STREAM,0);
sockaddr_in anews;
anews.sin_port = htons(23);
anews.sin_addr.s_addr = inet_addr("192.168.1.1");
anews.sin_family = AF_INET;
connect(mysock,(sockaddr*)&anews, sizeof(anews));
char buf[200];
recv(mysock, buf, sizeof(buf), 0);
MessageBox(0,buf,"sd",0);
}

Thanks in advance for any suggestions.:)


ghost's Avatar
0 0

popen


ghost's Avatar
0 0

popen