SOC Prime Bias: Critical

17 Jul 2026 09:01 UTC

SharpViewStateKing and the Anatomy of a Stealthy Implant Framework

Author Photo
SOC Prime Team linkedin icon Follow
SharpViewStateKing and the Anatomy of a Stealthy Implant Framework
shield icon

Detection stack

  • AIDR
  • Alert
  • ETL
  • Query

Summary

The Canadian Centre for Cyber Security identified SharpViewStateKing as a modular implant framework built for stealthy targeting of ASP.NET environments. By abusing compromised ViewState parameters, the framework executes plugins entirely in memory, allowing it to operate in an effectively stateless manner and evade traditional file-based detection. Its encrypted HTTP and HTTPS traffic further helps the activity blend into legitimate web communications.

Investigation

The investigation began after analysts found a web shell on a public-facing Microsoft IIS server. Examination of endpoint telemetry and process memory showed that the implant used dynamically generated C# plugins to perform actions such as file upload, remote command execution, and host reconnaissance. Researchers relied on the Assemblyline platform to decompile the C# bytecode and expose the framework’s internal logic.

Mitigation

Defenders should rebuild any potentially affected hosts and replace the encryption and validation keys associated with ASP.NET applications. Patching relevant vulnerabilities, including those affecting SharePoint as referenced in the report, is also critical. Monitoring child processes launched by the IIS w3wp.exe worker process can help uncover unauthorized activity connected to the implant.

Response

If SharpViewStateKing activity is identified, organizations should review EDR and NDR telemetry for signs of lateral movement, including creation of new accounts or deployment of tools such as SoftEther VPN. All passwords and credentials tied to the compromised system should be considered exposed and rotated immediately. Security teams should also confirm whether Microsoft Defender exclusions were changed without authorization.

Attack Flow

Simulation Execution

Prerequisite: The Telemetry & Baseline Pre-flight Check must have passed.

Rationale: This section details the precise execution of the adversary technique (TTP) designed to trigger the detection rule. The commands and narrative MUST directly reflect the TTPs identified and aim to generate the exact telemetry expected by the detection logic. Abstract or unrelated examples will lead to misdiagnosis.

  • Attack Narrative & Commands: An adversary has identified a vulnerable ASP.NET application and intends to deploy the SharpViewStateKing framework to maintain persistence and intercept session data. To do this, the attacker sends a series of HTTP requests that utilize the __VIEWSTATE and __SCROLLPATH parameters to deliver an exploit payload. By using these specific parameters, the attacker attempts to blend in with standard ASP.NET traffic, hoping to evade signature-based detection that only looks for traditional web shell paths.

  • Regression Test Script:

    # Simulation script to trigger the SharpViewStateKing detection rule
    $targetUri = "http://localhost/Login.aspx"
    
    # Payload 1: Testing __VIEWSTATE parameter detection
    Write-Host "[*] Simulating exploit attempt with __VIEWSTATE..."
    $payload1 = "__VIEWSTATE=MZ................[Simulated_Malicious_Payload]"
    Invoke-WebRequest -Uri "$targetUri?$payload1" -Method Get
    
    # Payload 2: Testing __SCROLLPATH parameter detection
    Write-Host "[*] Simulating exploit attempt with __SCROLLPATH..."
    $payload2 = "__SCROLLPATH=/etc/passwd"
    Invoke-WebRequest -Uri "$targetUri?$payload2" -Method Get
    
    Write-Host "[+] Simulation complete. Check SIEM for alerts."
  • Cleanup Commands:

    # No specific cleanup required as these are stateless HTTP GET requests.
    # However, if any files were dropped during a real attack, they should be removed.
    Write-Host "[*] Simulation cleanup: No persistent artifacts created."