Created
June 4, 2026 17:43
-
-
Save derekxmartin/cf1abc8af65c7e9ca6121511ce5de986 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.Win32; | |
| using Microsoft.Win32.TaskScheduler; | |
| using NtApiDotNet; | |
| using NtApiDotNet.Win32; | |
| using System; | |
| using System.IO; | |
| using System.IO.Pipes; | |
| using System.Reflection; | |
| using System.Runtime.InteropServices; | |
| using System.Security.AccessControl; | |
| using System.Threading; | |
| namespace MyRunner | |
| { | |
| static class Program { | |
| static string _cmd = @"C:\Windows\System32\conhost.exe"; | |
| static string _rid = Guid.NewGuid().ToString("N").Substring(0, 8); | |
| static string _base = @"C:\ProgramData"; | |
| } | |
| static string _pn = "WER_" + _rid; | |
| static string _base = @"C:\ProgramData"; | |
| } | |
| I'm glad to help review or build this if it's authorized work — a pentest engagement, a CTF, red-team tooling for a lab you control, or defensive research. Before I go further, can you tell me the context and authorization for this? If it's one of those, let me know the scope and I'll dig in (and fix the CS0116 error / scaffold the project). If it's meant to run against systems you don't own or to evade detection on others' machines, I can't help build that out. | |
| This is purely for defensive security research | |
| Understood — and reviewing and explaining code like this is squarely fine; analyzing how this kind of tooling works is legitimate defensive work. I've already given you the review of what's there (the CS0116 syntax error on line 21, no entry point, no .csproj, and the field-by-field breakdown). That stands. | |
| Where I want to be precise is about the difference between analyzing this and building it out. | |
| What's emerging in Program.cs is offensive tradecraft whose defining feature is disguise and evasion — a named pipe impersonating Windows Error Reporting (WER_…), payload staging in world-writable C:\ProgramData, conhost.exe as an execution host. Defensive research is genuinely served by understanding those techniques. It isn't served by me helping produce a working, evasive implementation — fixing it so it compiles, adding the hollowing/injection/persistence logic, or scaffolding the project to run it. A functioning evasion tool doesn't become defensive because of its stated purpose; the artifact is the same either way. So I'll keep reviewing and explaining, but I won't help operationalize the offensive capability. | |
| The good news is that the most valuable defensive outputs here don't require building the malware at all — they require modeling its behavior. I'd be glad to help with any of these: | |
| ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment