Podcast Summary: Endpoint Security Got You Down? No PowerShell? No Problem.
Podcast: Talkin' Bout [Infosec] News
Host: Black Hills Information Security
Episode: BHIS PODCAST: Endpoint Security Got You Down? No PowerShell? No Problem.
Guest: Marcello Salvati
Date: March 6, 2019
Main Theme
This episode, hosted by Black Hills Information Security and featuring red teamer Marcello Salvati, explores advanced endpoint security evasion techniques by leveraging lesser-known aspects of the .NET Framework. The focus is specifically on executing post-exploitation payloads without PowerShell—a critical red team tactic now that endpoint defenses often target PowerShell. Marcello introduces and demonstrates “BYOI” (Bring Your Own Interpreter) payloads, discusses how the Silent Trinity offensive tool operationalizes these ideas, and dives deep into detection challenges.
Key Discussion Points and Insights
1. Setting the Stage: Evolving Red Team Techniques
- The approach discussed is rooted in existing .NET capabilities but spins them in a novel direction for offensive operations.
- Instead of relying on PowerShell (now heavily monitored and restricted in many environments), red teamers can use other interoperable .NET languages to execute attacks (00:29-03:31).
- Quote:
"This is more of like a spin on an old technique... to completely understand how this is even possible, we all have to know some key framework concepts." – Marcello (00:29)
2. .NET Assemblies Explained
- A .NET assembly is essentially a precompiled blob of code that any .NET language can execute (.exe or .dll). This is distinct from "native" executables or DLLs compiled in C or C++ (03:31-04:56).
- Interoperability is key: C#, F#, PowerShell, and third-party .NET languages (e.g., IronPython, IronRuby, Boolang) can interoperate seamlessly.
- Quote:
"The key thing to understand here is that all of these languages are built on the same exact framework... these languages are completely interoperable with each other." – Marcello (05:06)
3. Why Attackers Love C# and .NET
- The
Assembly.Load()function allows loading a .NET assembly directly from a byte array, making reflective in-memory execution trivial—akin to built-in DLL injection (06:04-07:28). - Audience Q&A:
"Does that essentially mean you can write PowerShell, pepper it with Ruby and Python, then compile it into a .NET compatible exe and it will just work?"
"Yes, incredibly enough, yes that..." – Marcello (07:41)
4. Embedding Interpreter Engines: PowerShell Runspaces and Beyond
- Tools like Powerline and Offensive PowerShell scripts often embed C# into PowerShell, or vice versa, by exploiting .NET's interoperability (09:22-11:45).
- Key evasion: All of PowerShell’s advanced logging and constraint mechanisms are confined to the PowerShell runtime, not the .NET framework. So using other .NET languages sidesteps those defenses (11:45-14:11).
- Quote:
"All of the defenses that are in place for PowerShell are confined to the PowerShell runtime... all those go away immediately the minute you switch to a different .NET language..." – Marcello (11:45)
5. "Engine Inception": Interpreter Stacking
- You can nest interpreters—embedding IronPython inside IronRuby inside Boolang, for instance—for highly obfuscated payload execution (14:11-15:03).
- Quote:
"It's called an engine inception. You can nest multiple engines within each other." – Marcello (14:18)
6. Weaponizing with Silent Trinity
- Silent Trinity is Marcello’s tool that automates these concepts:
- Uses stagers (C#/PowerShell/MSBuild) to launch interpreters
- Communicates with C2 via fully encrypted channels (Elliptic Curve Diffie Hellman, AES 256, HMAC)
- Can dynamically load scripting engines (IronPython, Boolang) and execute payloads (28:21-32:24)
- Demo highlights: Autocompletion UI, asynchronous agent, supports IronPython and Boolang modules (32:31-38:35).
7. Advantages of BYOI vs. Traditional Payloads
- BYOI advantages:
- Less compiling; faster retooling
- Scripting languages allow rapid modular payload development
- Ephemeral code execution—payloads "disappear" from memory after execution
- Downsides:
- Requires .NET 4.0+ (because of reliance on the dynamic keyword), though this may be circumvented with time (25:53-28:21)
8. Bypassing Modern Defenses
- MSBuild stager is especially potent for bypassing application whitelisting (AppLocker, Bit9).
- As of the episode date, there are few effective mechanisms for detecting these attacks; Event Tracing for Windows (ETW) offers possibilities, but no enterprise-scale solutions exist (46:28-48:48).
- Detection: Currently, detection relies on fragile IOCs (e.g., assembly names loaded into app domains). Future work aims for even stealthier memory management (45:16-51:15).
9. Real-World Impact and Audience Reaction
- Live demo: IronPython message box and mimikatz modules running on fully protected endpoints. The agent remains fully asynchronous (38:35-41:17).
- Audience responses: "Ooh, so many ideas how to screw with DFIR," amazement at defense bypasses, and interest in immediate experimentation (38:46-40:10).
- Quote:
"A lot of people are loving this. And one guy said, or Jim said, ooh, so many ideas how to screw with DFIR." – Co-host (38:46)
10. Future Directions and Cat-and-Mouse Game
- .NET 4.8+ promises possible built-in AMSI (antimalware) integration, but most environments have not yet adopted it (52:57).
- Ongoing research focuses on better compartmentalizing malicious assemblies post-execution and expanding interpreter support.
- Quote:
"At the end of the day, we're going back to the cat and mouse game. So this is basically the era of when PowerShell offensive tradecraft were discovered." – Marcello (53:25)
Notable Quotes and Moments (with Timestamps)
- On .NET Interoperability:
"These languages are completely interoperable with each other." (05:06) - On Assembly Loading Bypass:
"It's basically reflective dll, reflective PE injection built natively into a language." (09:22) - On Interpreter Stacking:
"Engine inception... you can literally embed infinite amount of engines within each other." (14:18) - On Limitation by .NET Version:
"As of right now, none of this sound Trinity won't work on machines that have .NET version installed less than 4.0." (25:53) - On Future/Detection:
"We're going back to the cat and mouse game again because of the Amzi integration..." (52:57)
Timestamps for Key Segments
- [00:29] – Setting the stage, .NET basics
- [06:04] – Why C# is powerful for red teams
- [09:22] – Embedding interpreters and PowerShell bypass
- [11:45] – Defensive blind spots and migration to C#
- [14:11] – Interpreter nesting (“engine inception”)
- [16:42] – DLL dependencies and operational evasion
- [23:22] – BYOI payloads vs. C# payloads: pros and cons
- [28:21] – Silent Trinity: features and advances
- [32:31] – Demo: running modules and asynchronous tasks
- [36:59] – Modules (IronPython and Boolang), message box/mimikatz demo
- [41:51] – Mouse shaker (Boolang demo), assembly execution
- [45:45] – Detection, process and memory artifacts
- [52:57] – Future outlook, detection arms race
Closing Thoughts
For Defenders:
This episode is both a wake-up call and a technical deep-dive into the next phase of post-exploitation. Traditional defensive tools, especially those focused on PowerShell, must expand to include deeper .NET framework visibility. Detection today is tricky and fragile. As Marcello underscores: we’re in for another round of red-team/blue-team escalation.
For Offenders/Red Teamers:
Marcello's approach provides a new, modular, scripting-friendly path for endpoint compromise—even on PowerShell-locked or EDR-heavy environments—and offers rapid flexibility for varied targets.
Final words:
"At the end of the day, we're going back to the cat and mouse game." – Marcello Salvati (53:25)
For more on this technique, tool, and ongoing research, visit Black Hills Information Security’s blog and YouTube, or follow Marcello on Twitter (handle mentioned at [52:31]).
![BHIS PODCAST: Endpoint Security Got You Down? No PowerShell? No Problem. - Talkin' Bout [Infosec] News cover](/_next/image?url=https%3A%2F%2Fimg.transistor.fm%2FAukI425sRBc3M3UIa9lVng7qjeNeYEQ8BZfzCEXhALs%2Frs%3Afill%3A0%3A0%3A1%2Fw%3A1400%2Fh%3A1400%2Fq%3A60%2Fmb%3A500000%2FaHR0cHM6Ly9pbWct%2FdXBsb2FkLXByb2R1%2FY3Rpb24udHJhbnNp%2Fc3Rvci5mbS8xZTA1%2FZWZhNDcxZGM4ZTFj%2FZGJhMTMwNmYzMmJj%2FZjBkNi5wbmc.jpg&w=1200&q=75)