🖥️
Windows DFIR
  • Introduction
  • Windows Artifacts
    • Windows Quick Tips
      • Windows Command Line
      • Workstation File/Folder Locations
      • Server File/Folder Locations
    • Account Usage
      • Authentications SAM Artifacts
        • Last Login
        • Last Failed Login
        • Last Password Change
      • Authentications (Windows Event Log)
        • Logon ID
      • Group Membership
        • Event ID: 4798
        • Event ID: 4799
      • RDP
        • Source System Artifacts - Quick Reference
        • Destination System Artifacts - Quick Reference
      • SSH
      • Rouge Local Accounts
      • CrowdStrike Searches
        • Event Name - UserLogon
        • Event Name - UserLogonFailed
        • Event Name - UserLogonFailed2
        • Event Name - SsoApplicationAccess
    • Browser Usage
      • History & Downloads
        • Viewing History Files - DB Browser
        • Transition Types
      • Auto-Complete Data
      • Bookmarks
      • Browser Preferences
      • Cache
      • Cookies
      • Extensions
      • Super Cookies (HTML5 Web Storage)
      • Media History
      • Private Browsing
      • Session Restore
      • Stored Credentials
      • Suggested/Frequent Sites
      • DB Browser Queries
        • Firefox
        • Chrome
        • Media History
      • PowerShell Scripts
        • Browser Extension Finder
        • Browser History Finder
    • Processes
      • at.exe
      • explorer.exe
      • lsass.exe
      • lsaiso.exe
      • PuTTy.exe
        • X11 Forwarding
      • runtimebroker.exe
      • services.exe
      • smss.exe
      • System
      • svchost.exe
        • Services
      • winlogon.exe
      • wininit.exe
    • Cloud Storage
    • Deleted File or File Knowledge
      • WordWheelQuery (Win 7+)
      • ACMRU (Win XP)
      • Internet Explorer file:///
      • Last Visited MRU
      • Thumbs.db (Win XP)
      • Thumbcache
      • Recycle Bin
      • User Typed Paths
      • Windows Search Database
    • File Download
      • Zone.Identifer
      • Open/Save Most Recently Used (MRU)
      • Email
      • Drive By Downloads
        • Malvertising
      • Web Browsing
        • Cache Files
      • CrowdStrike Searches
        • MoTW
    • Folder/File Opening/Creation
      • Recent Files
      • Office Recent Files
      • Shell Bags
      • .lnk Files
      • Jump Lists
        • AppIDs
      • Prefetch
      • Index.dat file://
      • PowerShell Scripts
        • .lnk Files
    • Persistence
      • Registry
        • NTUSER.DAT & HKU\SID
        • Run and Run Once
        • Shell Folders and UserInit Key
        • Services
        • Logon Scripts
        • Office Add-ins
        • Winlogon Shell
        • Image File Execution Options (IFEO)
        • AppInit_DLLs
        • Scheduled Tasks
      • Scheduled Tasks
        • Scheduled Task Destination System Artifacts
        • Scheduled Task Source System Artifacts
      • Startup
      • Tool: AutoRuns
      • Accounts
      • WMI Event Consumers
        • WMI: Source System Artifacts
        • WMI: Destination System Artifacts
        • WMI: PowerShell Analysis
      • PowerShell Scripts
        • Startup Programs
      • CrowdStrike Searches
        • Files Written to Startup Folder
        • Files Written to Startup Folder from the Internet
        • Local Account Creation/Deletion
        • Azure Account Creation/Deletion
        • Scheduled Tasks
    • Physical Location
      • Time zone
      • Wireless SSID
      • Network History (Vista/Win7–11)
      • Cookies
      • Browser Search Terms
    • Program Execution
      • Prefetch
        • Decoding Prefetch Files with Eric Zimmerman's PECmd Tool
      • BAM/DAM
      • CapabilityAccessManager
      • UserAssist
      • Last Visited MRU
      • RunMRU
      • MUI Cache
      • ShimCache
      • Amcache
      • Jump Lists
    • Shadow Copies
      • VSC Permissions
      • Event ID 8193: Volume Shadow Copy Service Error
    • USB Usage
      • Key Identification
      • Drive Letter and Volume Name
      • Connection Timestamps
      • User
      • Volume Name
      • Plug & Play Event Log
    • Windows Services
      • DoSvc (Delivery Optimization)
    • System Information
    • Event IDs
      • Authentication / Account
        • 4624 - Authentication Success
          • Logon Types
        • 4625 - Authentication Failure
          • SubStatus Codes
        • 4634 - Account Logoff
        • 4648 - Explicit Credentials Success
        • 4672 - Special Privileges
        • 4720 - Account Creation
        • 4722 - Account Enabled
        • 4732 - Addition to Local Group
        • 4738 - Account Changed
        • 4776 - Kerberos Authentication Attempt
          • Substatus Codes
        • 4771 - Kerberos Failure
        • 4768
      • File System
        • 1006
        • 4688 - Process Created
        • 4663
        • 4656
        • 6416
        • 20001
        • 20003
  • Windows DFIR & MITTR
    • Initial Access
      • Content Injection
      • Drive-by Compromise
        • Watering Hole Attack
        • Microsoft Files (Payload Execution)
        • Exploit Delivery
        • Viewing Browser History Files
      • Phishing
    • Execution
    • Persistence
    • Privilege Escalation
    • Defense Evasion
    • Credential Access
      • Logon ID
    • Discovery
    • Lateral Movement
    • Collection
    • Command and Control
    • Exfiltration
    • Impact
  • SOC Related
    • Cached Credentials
    • Domain Controller Password Spraying
Powered by GitBook
On this page
  • Overview
  • Security Implications:
  • Command Line Options and Analysis
  • The “K” Flag
  • The “S” Flag
  • The “P” Flag

Was this helpful?

  1. Windows Artifacts
  2. Processes

svchost.exe

PreviousSystemNextServices

Last updated 1 year ago

Was this helpful?

The most common filename for malware is svchost.exe

The process svchost.exe is a fundamental component of the Windows operating system, acting as a generic host process for services that are executed from dynamic-link libraries (DLLs). Understanding svchost.exe is crucial for both system administration and cybersecurity, as it is involved in many core system functions and can be a target for malicious activities. Unfortunately, I couldn't access the specific article from nasbench.medium.com to provide additional insights as requested. However, I can still provide a comprehensive overview based on the details provided and general knowledge of svchost.exe.

Overview

  • Image Path: %SystemRoot%\system32\svchost.exe indicates that svchost.exe resides in the system32 directory of the Windows installation, which is a protected system folder.

  • Parent Process: The most common parent process is services.exe, which is responsible for starting, stopping, and interacting with system services.

  • Number of Instances: There are typically many instances of svchost.exe running on a Windows system, often at least 10. This is because Windows isolates different services into separate instances of svchost.exe for management and security purposes.

  • User Account: The user account under which an instance of svchost.exe runs can vary. It often runs under system accounts like Local System, Network Service, or Local Service. In Windows 10, some instances also run under the context of the logged-on user.

  • Start Time: Instances of svchost.exe are usually started within seconds of the system booting up. However, it's possible for new instances to start post-boot, such as at user logon, depending on when services are initiated.

  • Command Line Example: C:\Windows\System32\svchost.exe -k netsvcs

    • The -k argument specifies the service group that the svchost.exe instance is hosting. Multiple instances will have different -k values depending on the services they are managing.

    • View the page for a extensive list of Windows Services.

  • Description:svchost.exe serves as a generic host process for Windows services that run from DLLs. To manage and group similar services, Windows uses unique “-k” parameters with svchost.exe. Some common “-k” parameters include DcomLaunch, RPCSS, and netsvcs, among others. This system allows Windows to compartmentalize services for better management and security.

Security Implications:

Due to its ubiquitous presence in Windows systems, svchost.exe is a popular target for malware. Malicious actors may disguise malware as svchost.exe or run malicious services through it. Vigilance and regular system scanning are advised to detect such anomalies.

  • Windows 10 Changes: Starting with Windows 10 version 1703, Microsoft introduced changes to how services are grouped in svchost.exe for systems with more than 3.5 GB of RAM. Instead of grouping similar services together, most services run in their own instance of svchost.exe. This change can result in a system running more than 50 instances of svchost.exe, which might seem alarming but is normal for enhancing system performance and security.

Command Line Options and Analysis

svchost.exe's behavior and specific services it hosts can be controlled through command-line flags, notably the "-k", "-s", and "-p" flags. Let's delve into the functionalities and implications of these flags.

The “K” Flag

  • Functionality: The "-k" flag is used to specify a service group. When svchost.exe is launched with this flag, it looks up the service group in the registry path HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Svchost.

  • Registry Interaction: This registry key contains values for Service Host Groups, each of which references the services that should be launched under the specified group. For example, if svchost.exe is executed with -k UnistackSvcGroup, it will refer to this registry key to determine the services included in the "UnistackSvcGroup".

  • Service Loading: After identifying the services associated with the "-k" flag value, svchost.exe loads each service from its corresponding registry key at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\[Service Name]. This mechanism allows multiple services to be hosted within a single svchost.exe instance, enhancing system efficiency.

The “S” Flag

  • Selective Service Loading: Besides the "-k" flag, svchost.exe may also use the "-s" flag. This flag specifies that only a single service, identified by the flag from a selected group, should be loaded. For instance, using -s CDPUserSvc within the "UnistackSvcGroup" would result in only the "CDPUserSvc" service being loaded, ignoring other services in the group.

  • Usage Context: The "-s" flag offers a more granular control over service loading, enabling specific services within a group to be isolated and launched independently.

The “P” Flag

  • Enforcing Policies: The "-p" flag is less commonly understood but plays a crucial role in enforcing certain policies for the svchost.exe process. These policies include DynamicCodePolicy, BinarySignaturePolicy, and ExtensionPolicy.

  • Implications: The use of the "-p" flag indicates that svchost.exe will adhere to specific security and operational policies, affecting how the services are executed and interacted with. The policies enforced by this flag can significantly impact the security posture of the services hosted by svchost.exe.

For more information on svchost.exe and it's flags,

services
read this article.