Hijack system process prohibit open any process (5)

Source: Internet
Author: User

<title>Hijack system process prohibit open any process (5)</title> Functions of the Windows creation process:


This function is hijacked and injected into the explore.exe process.
Now inject into the Evernote test:
#include<stdio.h>#include<windows.h>#include<string.h>#include"Detours.h"#pragma Comment (Lib ,"Detours.lib" )
BOOL(WINAPI * OLDCREATEPROCESSW) (        LPCWSTR Lpapplicationname,        LPWSTR lpCommandLine,        lpsecurity_attributes Lpprocessattributes,        lpsecurity_attributes Lpthreadattributes,        BOOL bInheritHandles,        DWORD dwCreationFlags,        lpvoid Lpenvironment,        LPCWSTR Lpcurrentdirectory,        lpstartupinfow Lpstartupinfo,        lpprocess_information lpprocessinformation) = CREATEPROCESSW;
BOOL WINAPI NEWCREATEPROCESSW (        LPCWSTR Lpapplicationname,        LPWSTR lpCommandLine,        lpsecurity_attributes lpprocessattributes ,        lpsecurity_attributes lpthreadattributes ,        BOOL bInheritHandles,        DWORD dwCreationFlags,        lpvoid lpenvironment,        LPCWSTR lpcurrentdirectory,        lpstartupinfow Lpstartupinfo ,        lpprocess_information lpprocessinformation       ) {messageboxa (0, "The system process has been hijacked!" " , "System Warning" , 0);        return 0;}
void Hook (){
Detourrestoreafterwith (); //Return to its original state,Detourtransactionbegin (); //Intercept startDetourupdatethread (GetCurrentThread ()); //Refresh current threadDetourattach (( void * *) &OLDCREATEPROCESSW, NEWCREATEPROCESSW); //Implement function interceptiondetourtransactioncommit (); //interception takes effect
}
void unhook (){Detourtransactionbegin (); //Intercept startDetourupdatethread (GetCurrentThread ()); //Refresh current threadDetourdetach (( void * *) &OLDCREATEPROCESSW, NEWCREATEPROCESSW); //Undo Intercept functiondetourtransactioncommit (); //interception takes effect}
_declspec(dllexport ) void Go () {messageboxa (0, "System process hijacking succeeded!" " , "System Information" , 0);       int i = 0;        while (i++ <) {Hook ();Sleep (+);       }unhook ();}
Hijacking success:


When you open the Help guide:


From for notes (Wiz)

Hijack system process prohibit open any process (5)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.