Sekoia Details RePythonNET Automation for .NET Malware Analysis

· Original article ↗

Summary

Sekoia TDR details a pythonnet/dnlib workflow for decrypting strings in an APT28-modified Covenant Grunt, decompiling .NET malware, and automating analysis through its released RePythonNET-MCP server.

Key points

  • Sekoia describes an APT28-modified Covenant Grunt with randomized function names, encrypted strings, and a custom C2Bridge using Koofr or Filen file transfers.
  • The workflow fingerprints the string-decryption routine by its IL opcodes, retrieves its key from a static constructor, then patches encrypted strings in the binary.
  • The authors combine dnlib and ILSpy through pythonnet to generate decompiled C# for further analysis.
  • RePythonNET-MCP exposes tools for .NET binary analysis, decompilation, navigation, and patching through an MCP server.
  • The server includes upload and download endpoints for submitting samples and retrieving patched binaries.
  • Sekoia presents AI-assisted analysis as a way to automate repetitive work, while noting it is not a silver bullet.

Article Details

Attack Vectors
  • Lure documents delivered via Signal Desktop used VBA macros to trigger execution.
  • A user-level COM hijack established persistence by loading a malicious DLL.
  • Steganography extracted shellcode from a valid PNG file, which then executed the Covenant GruntHTTPStager.
  • APT28's Covenant Grunt used a custom C2Bridge that communicated through file uploads and downloads via Koofr or Filen APIs.
  • The Covenant sample used randomized function names and encrypted strings to hinder analysis.
Defensive Notes
  • The article describes fingerprinting the string-decryption routine through IL opcodes, recovering its key from a static constructor, and patching encrypted strings in place using dnlib and pythonnet.
  • The article describes combining dnlib with ILSpy through pythonnet to produce decompiled C# for analysis, and exposing analysis, decompilation, and patching functions through RePythonNET-MCP.

Indicators of compromise

TypeIndicatorContext
SHA25669609e89b04d8d27dc47bda2971376cfd760abb40ffe325f00d0cf3303be8906SHA-256 hash of the Covenant sample analyzed in the article.

MITRE ATT&CK

Threat Actors

Malware

Tools

Countries

Industries

Related Articles