JumpServer 资产代填配置
JumpServer 的 Web 资产代填功能通过 Selenium 自动化填写登录表单,支持三种模式:禁用、基本、脚本。
基本代填:适用于用户名、密码、登录按钮在同一页面的简单表单
脚本代填:适用于多步骤登录、AJAX 异步、SPA、Shadow DOM 等复杂场景
一、基本代填即可的系统
1. 路由器/网关(仅密码登录)
部分设备登录页只有密码框(ReyeeOS 系统),没有用户名输入框。
用户名选择器留空,资产账号用户名随意填占位值。
2. NVIDIA SN2700交换机
标准 HTML 表单 POST 提交。
二、脚本代填的系统
3. 群晖 DSM(两步登录)
先用户名→下一步→再密码→登录,必须脚本模式。
[
{
"step": 1,
"value": "{USERNAME}",
"target": "name=username",
"command": "type"
},
{
"step": 2,
"value": "",
"target": "css=.login-btn",
"command": "click"
},
{
"step": 3,
"value": "",
"target": "2",
"command": "sleep"
},
{
"step": 4,
"value": "{SECRET}",
"target": "name=current-password",
"command": "type"
},
{
"step": 5,
"value": "",
"target": "css=.login-btn",
"command": "click"
}
]4. 雷池 WAF 管理面板
React SPA,可能跳 TOTP 验证。
[
{
"step": 1,
"value": "{USERNAME}",
"target": "name=username",
"command": "type"
},
{
"step": 2,
"value": "{SECRET}",
"target": "name=password",
"command": "type"
},
{
"step": 3,
"value": "",
"target": "css=button[type='submit']",
"command": "click"
},
{
"step": 4,
"value": "",
"target": "2",
"command": "sleep"
},
{
"step": 5,
"value": "",
"target": "css=button[type='submit']",
"command": "click"
}
]5. TrueNAS
最大坑点。Angular 组件使用了 ViewEncapsulation.ShadowDom,Selenium 默认无法定位 Shadow DOM 内部的元素。
[
{
"step": 1,
"value": "",
"target": "4",
"command": "sleep"
},
{
"step": 2,
"value": "{USERNAME}",
"target": "css=.username-input input",
"command": "type"
},
{
"step": 3,
"value": "{SECRET}",
"target": "css=input[type='password']",
"command": "type"
},
{
"step": 4,
"value": "",
"target": "css=.submit-button",
"command": "click"
}
]💡 坑:
name=username在 Shadow DOM 内定位不到,需css=.username-input input穿透密码框不能用
formControlName属性选择器,改标准type='password'首次访问需 sleep 等 Angular 加载
6. Technitium DNS 管理面板(AJAX + 自动登录干扰)
页面加载时会自动尝试 admin/admin 登录,干扰代填。
[
{
"step": 1,
"value": "",
"target": "2",
"command": "sleep"
},
{
"step": 2,
"value": "{USERNAME}",
"target": "id=txtUser",
"command": "type"
},
{
"step": 3,
"value": "{SECRET}",
"target": "id=txtPass",
"command": "type"
},
{
"step": 4,
"value": "",
"target": "id=btnLogin",
"command": "click"
},
{
"step": 5,
"value": "",
"target": "3",
"command": "sleep"
}
]💡 坑:必须先 sleep 等自动登录请求失败完,否则填的值会被覆盖。
7. 服务器 BMC(Dell iDRAC8)
<a> 链接作登录按钮,AJAX 提交。
[
{
"step": 1,
"value": "",
"target": "2",
"command": "sleep"
},
{
"step": 2,
"value": "{USERNAME}",
"target": "id=user",
"command": "type"
},
{
"step": 3,
"value": "{SECRET}",
"target": "id=password",
"command": "type"
},
{
"step": 4,
"value": "",
"target": "id=btnOK",
"command": "click"
},
{
"step": 5,
"value": "",
"target": "3",
"command": "sleep"
}
]8. ESXI 虚拟化
id=username(全小写)。
[
{
"step": 1,
"value": "{USERNAME}",
"target": "id=username",
"command": "type"
},
{
"step": 2,
"value": "{SECRET}",
"target": "id=password",
"command": "type"
},
{
"step": 3,
"value": "",
"target": "css=button[data-test-id='login-action-button']",
"command": "click"
}
]
本文是原创文章,采用 CC BY-NC-ND 4.0 协议,完整转载请注明
评论
匿名评论
隐私政策
你无需删除空行,直接评论以获取最佳展示效果
Steam卡片