dsh-remote-rea: Fetching Remote Binaries via SSH in DSH for Static Reverse Engineering with REA

Introduction

When performing reverse engineering tasks within DSH (DeepSeek Harness), the common practice is to place samples locally and manually invoke toolchains like Ghidra, IDA, or REA. When samples reside on remote servers or in isolated environments, one must SSH login, locate files, copy them locally, and then describe the paths within the session—this fragmented process hinders agents from collecting structured results via a unified contract.

The following introduces the community plugin dsh-remote-rea (maintained by ccr-wer): It allows registering remote hosts within DSH, performing SSH pre-flight checks and pulling target files, then invoking remote REA (and optional Ghidra backends) for read-only static analysis, saving summaries and Evidence to the local data directory. The plugin emphasizes “analysis-only, no exploitation” and does not support using Windows as a remote shell target.

What is this

dsh-remote-rea is a “remote connection + reverse analysis” plugin within the DSH ecosystem. The current version is 0.1.1, released under MIT. It is categorized under Model Inference capabilities on SkillHub. Repository: https://github.com/ccr-wer/dsh-remote-rea, Directory Page: https://www.skillhub.cn/plugins/ccr-wer/dsh-remote-rea.

The host side connects to the remote via the pure-JS ssh2 library; the analysis side relies on remotely installed Node and REA (or npx rea-agents). This plugin does not read passwords from tool arguments; the host library is a prerequisite for subsequent fetching and analysis.

Three Tools and Invocation Relationships

The plugin exposes three tools to DSH. Usage requires maintaining host aliases first, followed by fetching or analysis.

Tool Function Key Inputs
remote_hosts CRUD for host library: alias, auth method, connectivity test, import from ~/.ssh/config action + alias, etc.
remote_fetch_binary Pre-check (exists / size / type / sha256) → Fetch → Local sha recalculation & comparison → Write JSON report alias, remotePath (absolute path)
remote_rea_analyze Detect capability surface after fetch, select provider/operation, dispatch analysis subcommands, persist Evidence and output summary alias, remotePath, optional provider

When provider is not specified in remote_rea_analyze, it automatically routes. The routing scope is the intersection of the “REA advertisement surface” and “verified CLI bindings” (checked via --help); if an item is missing, the corresponding subcommand will not be dispatched.

Support Scope and Pre-check Behavior

Host: Windows / macOS / Linux are all supported; Node >=18 (declared in package.json, author’s dev environment uses 24.x on Windows and 22.22.1 on WSL).

Remote:

  • OS must be a POSIX shell (Linux / macOS). If MINGW*, MSYS*, CYGWIN*, or Windows* are detected at runtime, it will refuse directly and prompt to use a POSIX shell target.
  • Remote Node must be 22.19+ / 24.11+ / 26+ (23 and 25 are unsupported); if not met, it only reports version requirements and does not dispatch any rea commands.
  • Remote requires GNU coreutils or a degradable subset; stat, file, etc., have documented degradation paths on BSD/macOS (e.g., using wc -c for size, guessing type by extension if the command fails, and noting this in the report).

If the remote lacks both global rea and npx, it will prompt to install Node 22.19+ or install rea globally.

Security Boundaries and Data Persistence

The design principles are clearly stated:

  1. Analysis-only, no exploitation: Does not execute targets, inject code, or modify artifacts.
  2. Privilege escalation hard gate: Checked before every remote command dispatch; hitting sudo or --break-system-packages throws an error and prevents dispatch.
  3. Write-type REA operations: The binding table lacks verified CLIs marked with mutates_artifact; routing relies on whitelists rather than runtime interception based on effects.
  4. Passwords excluded from tool arguments: Password-based auth only accepts the environment variable name passwordEnv; lists/details are sanitized projections.

Data root directory priority: $REVERSE_HOME → $DSH_HOME → ~/.reverse.

  • Reports: <data-root>/reports/fetch-<alias>-<ts>.json, analyze-<alias>-<ts>.json
  • Fetched samples: <data-root>/targets/<filename>
  • Evidence: <data-root>/evidence/<evidence_id>.json, path written in the report’s analysis.evidencePath

The tool return body does not contain raw remote stdout or full Evidence; it only provides summaries and paths.

Installation and Activation

Install and mount within the DSH home directory (commands from the project README):

cd <DSH home> && DSH_HOME=<DSH home> dsh plugin --profile web add dsh-remote-rea
cd <project root> && DSH_HOME=<DSH home> dsh --profile web --host 127.0.0.1 --no-open

ssh2 / cpu-features require pnpm to allow build scripts. Add the following to the profile’s pnpm-workspace.yaml:

allowBuilds:
  cpu-features: true
  ssh2: true

After installation, restart dsh web and force refresh the browser. If using the desktop profile, the plugin is managed within the Electron app; command-line installation for this profile will be rejected.

Typical Usage (Workflow)

  1. Register aliases using remote_hosts (can import from ~/.ssh/config), and perform test connectivity checks if necessary.
  2. Call remote_fetch_binary for known absolute paths; confirm pre-check and sha256 consistency before proceeding to deep analysis.
  3. Call remote_rea_analyze; if Ghidra deep analysis is required and the environment is ready, explicitly pass provider:"ghidra" (see limitations below).

For real-machine regression, the repository provides step-by-step test scripts (e.g., node test/run-controller-tests.mjs, node test/run-analyze-tests.mjs, etc.), which can target registered host libraries via --alias and --store.

Ghidra and Other Known Limitations

It is recommended to read the “Known Limitations” section in the README thoroughly before use:

  • Ghidra path is integrated but not verified in the author’s environment; automatic routing does not include Ghidra. It is only used when provider:"ghidra" is explicitly specified and REA readiness is deemed available. You need to prepare a Ghidra 12.1.x unpacked directory and set GHIDRA_INSTALL_DIR, as well as JDK 21 on the PATH.
  • rea-artifact-graph findings=0 is structural; deep analysis still relies mainly on the Ghidra route.
  • Cold cache warm-up may take several minutes; the default npxTimeoutMs is 600000, which can be overridden per call.
  • npx --yes rea-agents@latest version may drift; lock a specific version number when troubleshooting.

Use Cases and Notes

Suitable for: Teams or individuals already working within DSH sessions, with samples on Linux/macOS remotes, who wish for the agent to complete “Register Host → Fetch → REA Static Analysis → Local Structured Persistence” according to tool contracts.

Notes:

  • The plugin runs with current DSH process privileges; please read the source code and license before installation, and understand the actual implications of SSH and remote commands.
  • SkillHub is a community directory site and has no official affiliation with DeepSeek / High-Flyer; star and classification information is subject to the directory page.
  • The pnpm peers check missing peer warnings for @deepseek-ai/dsh-tools / @deepseek-ai/cordis may be static false positives under the DSH profile; they are actually provided by the DSH runtime and can be ignored if within the peer range.

Conclusion

dsh-remote-rea consolidates remote sample acquisition and REA reverse analysis into three tools within DSH. It constrains the operation surface using a host library, pre-checks, sha verification, and privilege escalation gates, making it suitable for “analysis-only, no exploitation” POSIX remote scenarios. For further implementation details and testing methods, see the GitHub Repository and the SkillHub Directory Page.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye