Git Product home page Git Product logo

gophant0m's Introduction

Svchost is essential in the implementation of so-called shared service processes, where multiple services can share a process to reduce resource consumption. Grouping multiple services into a single process saves computing resources, a consideration that was of particular concern to NT designers because creating Windows processes takes more time and consumes more memory than in other operating systems, such as the Unix family. 1

In a nutshell, this means; on Windows operating systems, svchost.exe manages the service, and the service actually runs as a thread under svchost.exe. Phant0m targets the event log service, finds the process responsible for the event log service, detects and kills the thread responsible for the event log service. Therefore, although the event log service appears to be running on the system (because Phant0m did not terminate the process), it is not actually running (because Phant0m terminated the thread) and the system does not collect logs.

Detect event log service

There are two methods to obtain the event log service

  1. Detect via SCM (Service Control Manager)
  2. Detection via WMI (Windows Management Instrumentation) (to be written)

Kill thread

method one

When each service is registered on a computer running Windows Vista or later, the Service Control Manager (SCM) assigns the service a unique numerical tag (in ascending order). Then, at service creation time, the label is assigned to the TEB of the main service thread. This tag will then be propagated to every thread created by the main service thread. For example, if the Foo service thread creates an RPC worker thread (note: RPC worker threads will not make more use of the thread pool mechanism later), that thread will have the service label of the Foo service. 2

So, in this technique, Phant0m will detect the event log service's thread using the NtQueryInformationThread API to get the thread's TEB address and read the SubProcessTag from the TEB. It then terminates the thread related to the event log service.

Method Two

In this technique, Phant0m detects the name of the DLL associated with the thread. The Windows Event Log Service uses wevtsvc.dll. The full path is %WinDir%\System32\wevtsvc.dll. If a thread is using that DLL, then it is a Windows Event Log Service thread, and then Phant0m terminates that thread.

Usage

-p1 PID_1
       Get the PID of the event log service from the service manager
   -p2 PID_2
       Get the PID of the event log service from WMI
   -t1 Technique_1
       How to use 1
   -t2 Technique_2
       How to use 2

Example

go run main.go -p1 -t1 1

gophant0m's People

Contributors

qi4l avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.