For a rootkit to hide a process, it is enough to modify the ActiveProcessLink in the previous and the following EPROCESS objects to skip the EPROCESS of the process it wants to hide. The steps are simple and are given as follows:
- Get the current process's EPROCESS using the PsLookupProcessByProcessId API.
- Follow the ActiveProcessLinks to find the EPROCESS of the process that you want to hide.
- Change the FLink of the previous EPROCESS so that it doesn't point to this EPROCESS but to the next one instead.
- Change the BLink of the next process so that it doesn't point to this EPROCESS but to the previous one instead.
The challenging part in this process is to reliably find the ActiveProcessLinks with all the changes that Windows introduces from one version to another. There are multiple techniques in dealing with the offset of ActiveProcessLinks (and the process ID as well), which are as follows:
- Get the OS version and...