execute_command
Execute system commands locally or remotely via SSH to support memory shell detection operations, such as checking Java environments and monitoring system processes.
Instructions
执行系统命令(本地或通过 SSH 远程执行)
这是一个通用的命令执行工具,可用于:
检查 Java 环境是否正常(java -version)
查看系统进程状态(ps aux)
执行其他辅助命令
注意:内存马检测的核心功能请使用专用工具(list_java_processes、scan_process 等), 此工具仅用于辅助操作。
Args: command: 要执行的 shell 命令 use_ssh: 是否使用 SSH 远程执行 ssh_host: SSH 主机地址(不指定则从环境变量 SSH_HOST 读取) ssh_username: SSH 用户名(不指定则从环境变量 SSH_USERNAME 读取) ssh_password: SSH 密码(不指定则从环境变量 SSH_PASSWORD 读取) ssh_key_path: SSH 私钥路径(不指定则从环境变量 SSH_KEY_PATH 读取) ssh_port: SSH 端口,默认 22(不指定则从环境变量 SSH_PORT 读取) timeout: 命令超时时间(秒),默认 300 秒
Returns: 执行结果,包含 success、stdout、stderr、return_code
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ||
| use_ssh | No | ||
| ssh_host | No | ||
| ssh_username | No | ||
| ssh_password | No | ||
| ssh_key_path | No | ||
| ssh_port | No | ||
| timeout | No |