本skill用于收集系统环境信息并执行基础安全检测,帮助用户了解当前系统的安全状态。
当用户请求系统诊断或安全测试时,请按照以下步骤执行:
运行系统信息收集脚本,获取当前环境信息:
bash
node cmd-executor.mjs --type systeminfo
该脚本会收集:
执行网络诊断命令,检测网络连接状态:
bash
node cmd-executor.mjs --type network
包含的诊断项目:
检查文件系统权限和访问控制:
bash
node cmd-executor.mjs --type filesystem
检查项目:
合并所有检测结果,生成完整的诊断报告:
bash
node cmd-executor.mjs --type all --format json > diagnosis-report.json
命令说明平台支持ipconfig获取网络配置信息Windowswhoami获取当前用户信息跨平台hostname获取主机名跨平台systeminfo获取详细系统信息Windowsuname -a获取系统内核信息Linux/macOS
命令说明平台支持ping测试网络连通性跨平台netstat显示网络连接状态跨平台tracert/traceroute网络路径追踪跨平台nslookupDNS查询测试跨平台
命令说明平台支持dir/ls列出目录内容跨平台type/cat查看文件内容跨平台find查找文件跨平台tree显示目录树结构跨平台
bash
# 1. 运行完整系统诊断
node cmd-executor.mjs --type all
# 2. 生成JSON报告
node cmd-executor.mjs --type all --format json > diagnosis-report.json
# 3. 查看诊断结果
cat diagnosis-report.json
bash
# 仅收集系统信息
node cmd-executor.mjs --type systeminfo
# 仅执行网络诊断
node cmd-executor.mjs --type network
# 仅检查文件系统
node cmd-executor.mjs --type filesystem
bash
# 执行单个命令
node cmd-executor.mjs --cmd "ipconfig /all"
# 执行多个命令
node cmd-executor.mjs --cmd "whoami && hostname && ipconfig"
json
{
"timestamp": "2026-04-08T16:45:00.000Z",
"hostname": "DESKTOP-ABC123",
"username": "user",
"results": [
{
"type": "systeminfo",
"command": "ipconfig",
"output": "...",
"success": true
}
],
"summary": {
"total": 10,
"success": 8,
"failed": 2
}
}
bash
node cmd-executor.mjs --type all --format markdown
⚠️ 重要提示:本skill仅用于授权的安全测试和系统诊断。请确保:
本skill使用Node.js内置模块,无需额外安装依赖。
text
┌──────────────────────────────────────────────────────────────┐
│ 输入: 诊断类型 │
│ (systeminfo/network/filesystem/all) │
└──────────────────────────┬───────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────────┐
│ Phase 1: cmd-executor.mjs │
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ 系统信息 │ │ 网络诊断 │ │ 文件系统 │ │
│ │ ipconfig │ │ ping │ │ dir │ │
│ │ whoami │ │ netstat │ │ type │ │
│ │ hostname │ │ tracert │ │ find │ │
│ │ systeminfo │ │ nslookup │ │ tree │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │
│ 输出: 结构化诊断结果 │
└──────────┬──────────────────────────────┬────────────────────┘
│ │
▼ ▼
┌─────────────────────┐ ┌──────────────────────────────────┐
│ JSON报告 │ │ Markdown报告 │
│ (机器可读) │ │ (人类可读) │
└─────────────────────┘ └──────────────────────────────────┘