Created
February 1, 2020 13:49
-
-
Save shelld0n/405ea7ad34309d56becd6c807fcdd91d to your computer and use it in GitHub Desktop.
Revisions
-
shelld0n created this gist
Feb 1, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ // Duplicate Tokens for system process and store them in tokenHandle Console.WriteLine("your journey just started"); IntPtr test = myAPI.OpenProcess(myAPI.ProcessAccessFlags.QueryInformation, true, pid); if (test == IntPtr.Zero) Console.WriteLine("No Handle to process !"); IntPtr tokenHandle; bool result_token = myAPI.OpenProcessToken(test, myAPI.TOKEN_READ | myAPI.TOKEN_IMPERSONATE | myAPI.TOKEN_DUPLICATE, out tokenHandle); Console.WriteLine(result_token); //End of getting the handle of token of SYSTEM process