[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-114072":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":15,"stars30d":16,"stars90d":14,"forks30d":14,"starsTrendScore":14,"compositeScore":17,"rankGlobal":9,"rankLanguage":9,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":9,"pushedAt":23,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":14,"starSnapshotCount":14,"syncStatus":27,"lastSyncTime":28,"discoverSource":29},114072,"WinRM-PtH-BOF","AlexLinov\u002FWinRM-PtH-BOF","AlexLinov","WinRM pass-the-hash BOF with NTLMv2 authentication and signed, encrypted WSMan traffic",null,"C",58,5,51,0,4,7,45.03,"MIT License",false,"main",true,[],"2026-11-18 14:26:41","2026-11-19 11:05:06","# WinRM-PtH-BOF\n\nA standalone, C2-agnostic Beacon Object File (BOF) for executing commands over WinRM using NTLMv2 pass-the-hash authentication.\n\nThe BOF handles NTLM authentication, session signing and sealing, and encrypted WSMan communication directly in memory. No Mimikatz, SSPI, credential injection, or external executable is required.\n\nAn optional AxScript extension is included for AdaptixC2.\n\n> For authorized security testing and research only.\n\n## Features\n\n- Native NTLMv2 pass-the-hash authentication using a supplied NT hash.\n- NTLM MIC generation when required.\n- Session signing, sealing, and encrypted WSMan communication.\n- Remote command execution with output retrieval.\n- No local process spawning or LSASS credential modification.\n- Standalone x64 and x86 BOF builds.\n- Optional AdaptixC2 integration supporting Beacon, Gopher, and Kharon agents.\n\n## Requirements\n\n- A C2 framework with a compatible BOF loader.\n- MinGW-w64 (`x86_64-w64-mingw32-gcc` and `i686-w64-mingw32-gcc`) for compilation.\n- A target with WinRM enabled over HTTP (TCP 5985 by default).\n- A valid NT hash for an account authorized to execute commands through WinRM.\n\n**Note:** HTTPS\u002F5986 is not currently supported.\n\n## Build\n\nCompile both architectures:\n\n```bash\nmake\n```\n\nThe compiled BOFs are generated in the `bin\u002F` directory.\n\nThese objects are designed to work with compatible BOF loaders. Framework-specific argument handling may vary.\n\n## AdaptixC2 Integration\n\nAdaptixC2 support is provided through the included `winrm_pth.axs` script. This integration is optional and is not required by the BOF itself.\n\n1. Compile the project using `make`.\n2. Load `winrm_pth.axs` through **AxScript → Script Manager**.\n3. Run `help winrm_pth` in your Windows agent console.\n\nThe script automatically selects the appropriate BOF for the agent architecture and registers `winrm_pth` as a standalone command without conflicting with the Extension Kit's `invoke` command.\n\n## Usage\n\n```text\nwinrm_pth \u003Ctarget> \"\u003Ccommand>\" DOMAIN\\username \u003CNT_HASH> [-t milliseconds] [-P port]\n```\n\nExample:\n\n\u003Cimg width=\"1141\" height=\"390\" alt=\"image\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F4033f8d5-032e-4be3-91f7-29b8e60561d8\" \u002F>\n\nFor local accounts, use the target computer name instead of the domain, such as `SERVER01\\Administrator`.\n\nThe command shown above uses the optional AdaptixC2 integration. Other compatible C2 frameworks can execute the compiled BOF using their supported argument-packing and execution mechanisms.\n\n## How It Works\n\nThe BOF performs the NTLMv2 authentication exchange using the supplied NT hash, then derives the session keys needed to protect WinRM communication.\n\nWSMan requests are encrypted and signed using NTLM session security. Responses are decrypted and verified before processing.\n\nCommands execute remotely through `cmd.exe \u002Fc`, with output returned to the agent. Response buffering is limited to 256 KiB.\n\nWinHTTP automatic authentication and redirects are disabled for each request to avoid unintended credential use.\n\n## Roadmap\n\n###  PowerShell Remoting Fallback (PSRP)\n\n- [ ] Automatically fall back to PowerShell when a verified `w:AccessDenied` SOAP fault occurs.\n- [ ] Reuse existing NTLM authentication, signing\u002Fsealing, and WSMan transport.\n- [ ] Implement PSRP runspace, pipeline execution, output handling, and cleanup.\n- [ ] Preserve existing `cmd.exe \u002Fc` command behavior during fallback.\n- [ ] Display which backend (CMD or PowerShell) executed the command.\n- [ ] Prevent fallback on authentication (401), signature validation, or connection failures.\n\n## References\n\n- [MS-NLMP: NT LAN Manager Authentication](https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fopenspecs\u002Fwindows_protocols\u002Fms-nlmp\u002F)\n- [MS-WSMV: Encrypted Data Layout](https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fopenspecs\u002Fwindows_protocols\u002Fms-wsmv\u002F3fc54d8b-b087-486e-9f50-8253e9e30b43)\n","这是一个用于红队渗透测试的 Beacon 对象文件（BOF），支持通过 WinRM 协议实现 NTLMv2 协议下的无凭证注入式哈希传递（Pass-the-Hash）远程命令执行。其核心功能包括：纯内存内完成 NTLMv2 认证、MIC 生成、WSMan 通信的签名与加密，无需调用 Mimikatz、SSPI 或修改 LSASS 进程。项目以 C 编写，提供 x86\u002Fx64 双架构 BOF，兼容支持 BOF 加载的 C2 框架（如 Cobalt Strike、AdaptixC2 等）。适用于已启用 WinRM（HTTP\u002F5985）且拥有合法 NT 哈希凭证的内网横向移动场景，仅限授权安全测试使用。",2,"2026-11-24 04:47:53","CREATED_QUERY"]