Login Register


[C++] Protect Process filter_list
Author
Message
[C++] Protect Process #1
First you need to include (Visual Studio IDE): 
#include "stdafx.h"
#include <Windows.h>
#include <Aclapi.h>
#include <Sddl.h>

Here is the code:


Code:
BOOL ProtectProcess() { HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, GetCurrentProcessId()); SECURITY_ATTRIBUTES sa; TCHAR * szSD = TEXT("D:P")  ;  TEXT("(D;OICI;GA;;;BG)");     // Deny access to                                       // built-in guests         TEXT("(D;OICI;GA;;;AN)") ;   // Deny access to                                       // anonymous logon sa.nLength = sizeof(SECURITY_ATTRIBUTES); sa.bInheritHandle = FALSE; if (!ConvertStringSecurityDescriptorToSecurityDescriptor(szSD, SDDL_REVISION_1, &(sa.lpSecurityDescriptor), NULL)) return FALSE; if (!SetKernelObjectSecurity(hProcess, DACL_SECURITY_INFORMATION, sa.lpSecurityDescriptor)) return FALSE; return TRUE; }
Just simply call: ProtectProcess() in your main.
NOTE: Admin accounts will be able to bypass this.


RE: [C++] Protect Process #2
Seems interesting! Thanks for sharing this! Smile


RE: [C++] Protect Process #3
Nice of you to share this, keep it up.


RE: [C++] Protect Process #4
Thanks guys, I will be sharing more of my sources later. I hope people will find use for all my random codes Smile


RE: [C++] Protect Process #5
Very nice, thanks for sharing! Smile


RE: [C++] Protect Process #6
I see this is reposted from forum to forum without anyone even aware of the redundancy here with those TEXT macro strings... And it's not even complete/proper; LocalFree() is never called to free the return buffer.
- mostly braindead monkeys on this forum.


RE: [C++] Protect Process #7
(07-29-2015, 05:58 AM)bitm0de Wrote: I see this is reposted from forum to forum without anyone even aware of the redundancy here with those TEXT macro strings... And it's not even complete/proper; LocalFree() is never called to free the return buffer.

This is right. Reporting this thread.
[img=0x150]http://imgur.com/BD5LxZb.png[/img]
I'm done being an autism.  








Users browsing this thread: 1 Guest(s)