Skip to content

Instantly share code, notes, and snippets.

@gavz
Forked from dadevel/main.c
Created May 12, 2024 21:19
Show Gist options
  • Save gavz/66841c06cc6a82426b7d74e0eb6af284 to your computer and use it in GitHub Desktop.
Save gavz/66841c06cc6a82426b7d74e0eb6af284 to your computer and use it in GitHub Desktop.
EFS Trigger
#include <windows.h>
int main() {
HANDLE file = CreateFileA(".\\test.txt", GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_ENCRYPTED|FILE_FLAG_DELETE_ON_CLOSE, NULL);
if (!file || file == INVALID_HANDLE_VALUE) {
return GetLastError();
}
CloseHandle(file);
return 0;
}
@gavz
Copy link
Author

gavz commented May 13, 2024

Code to trigger EFS without GUI interaction:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment