mohuclaw 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +64 -0
- package/bin/mohu-tui.js +73 -0
- package/bin/mohu-webui.js +67 -0
- package/dist/tui/tui.js +38733 -0
- package/dist/webui/index.html +1551 -0
- package/dist/webui/server.js +876 -0
- package/ioc/c2-ips.txt +25 -0
- package/ioc/file-hashes.txt +13 -0
- package/ioc/malicious-domains.txt +46 -0
- package/ioc/malicious-hashes.txt +5 -0
- package/ioc/malicious-publishers.txt +34 -0
- package/ioc/malicious-skill-patterns.txt +87 -0
- package/package.json +46 -0
- package/scripts/check/access_control.sh +183 -0
- package/scripts/check/credential_storage.sh +222 -0
- package/scripts/check/execution_sandbox.sh +502 -0
- package/scripts/check/memory_poisoning.sh +334 -0
- package/scripts/check/network_exposure.sh +479 -0
- package/scripts/check/resource_cost.sh +182 -0
- package/scripts/check/supply_chain.sh +553 -0
- package/scripts/repair/access_control/_common.sh +249 -0
- package/scripts/repair/access_control/check_1.sh +28 -0
- package/scripts/repair/access_control/check_2.sh +27 -0
- package/scripts/repair/access_control/check_3.sh +23 -0
- package/scripts/repair/access_control/check_4.sh +23 -0
- package/scripts/repair/access_control/check_5.sh +20 -0
- package/scripts/repair/credential_storage/_common.sh +277 -0
- package/scripts/repair/credential_storage/check_1.sh +47 -0
- package/scripts/repair/credential_storage/check_2.sh +35 -0
- package/scripts/repair/credential_storage/check_3.sh +53 -0
- package/scripts/repair/credential_storage/logs/security-scan.log +15 -0
- package/scripts/repair/execution_sandbox/_common.sh +302 -0
- package/scripts/repair/execution_sandbox/check_1.sh +67 -0
- package/scripts/repair/execution_sandbox/check_10.sh +23 -0
- package/scripts/repair/execution_sandbox/check_11.sh +34 -0
- package/scripts/repair/execution_sandbox/check_12.sh +38 -0
- package/scripts/repair/execution_sandbox/check_13.sh +29 -0
- package/scripts/repair/execution_sandbox/check_2.sh +46 -0
- package/scripts/repair/execution_sandbox/check_3.sh +37 -0
- package/scripts/repair/execution_sandbox/check_4.sh +23 -0
- package/scripts/repair/execution_sandbox/check_5.sh +28 -0
- package/scripts/repair/execution_sandbox/check_6.sh +17 -0
- package/scripts/repair/execution_sandbox/check_7.sh +17 -0
- package/scripts/repair/execution_sandbox/check_8.sh +17 -0
- package/scripts/repair/execution_sandbox/check_9.sh +17 -0
- package/scripts/repair/execution_sandbox/logs/security-scan.log +10 -0
- package/scripts/repair/memory_poisoning/_common.sh +336 -0
- package/scripts/repair/memory_poisoning/check_1.sh +51 -0
- package/scripts/repair/memory_poisoning/check_2.sh +26 -0
- package/scripts/repair/memory_poisoning/check_3.sh +24 -0
- package/scripts/repair/memory_poisoning/check_4.sh +27 -0
- package/scripts/repair/memory_poisoning/check_5.sh +20 -0
- package/scripts/repair/network_exposure/_common.sh +330 -0
- package/scripts/repair/network_exposure/check_1.sh +86 -0
- package/scripts/repair/network_exposure/check_10.sh +16 -0
- package/scripts/repair/network_exposure/check_11.sh +31 -0
- package/scripts/repair/network_exposure/check_12.sh +24 -0
- package/scripts/repair/network_exposure/check_2.sh +26 -0
- package/scripts/repair/network_exposure/check_3.sh +43 -0
- package/scripts/repair/network_exposure/check_4.sh +23 -0
- package/scripts/repair/network_exposure/check_5.sh +16 -0
- package/scripts/repair/network_exposure/check_6.sh +98 -0
- package/scripts/repair/network_exposure/check_7.sh +35 -0
- package/scripts/repair/network_exposure/check_8.sh +19 -0
- package/scripts/repair/network_exposure/check_9.sh +19 -0
- package/scripts/repair/resource_cost/_common.sh +303 -0
- package/scripts/repair/resource_cost/check_1.sh +16 -0
- package/scripts/repair/resource_cost/check_2.sh +16 -0
- package/scripts/repair/resource_cost/check_3.sh +23 -0
- package/scripts/repair/supply_chain/_common.sh +222 -0
- package/scripts/repair/supply_chain/check_1.sh +95 -0
- package/scripts/repair/supply_chain/check_10.sh +60 -0
- package/scripts/repair/supply_chain/check_11.sh +63 -0
- package/scripts/repair/supply_chain/check_12.sh +36 -0
- package/scripts/repair/supply_chain/check_13.sh +44 -0
- package/scripts/repair/supply_chain/check_14.sh +33 -0
- package/scripts/repair/supply_chain/check_15.sh +33 -0
- package/scripts/repair/supply_chain/check_16.sh +34 -0
- package/scripts/repair/supply_chain/check_17.sh +61 -0
- package/scripts/repair/supply_chain/check_18.sh +62 -0
- package/scripts/repair/supply_chain/check_2.sh +93 -0
- package/scripts/repair/supply_chain/check_3.sh +78 -0
- package/scripts/repair/supply_chain/check_4.sh +72 -0
- package/scripts/repair/supply_chain/check_5.sh +73 -0
- package/scripts/repair/supply_chain/check_6.sh +81 -0
- package/scripts/repair/supply_chain/check_7.sh +52 -0
- package/scripts/repair/supply_chain/check_8.sh +71 -0
- package/scripts/repair/supply_chain/check_9.sh +78 -0
- package/scripts/repair/supply_chain/logs/security-scan.log +77 -0
- package/scripts/scan.sh +228 -0
- package/webui/index.html +1551 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 MohuClaw
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# MohuClaw
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/mohuclaw)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
6
|
+
OpenClaw 安全审计工具,支持终端和 Web 双界面交互式安全分析。
|
|
7
|
+
|
|
8
|
+
## 特性
|
|
9
|
+
|
|
10
|
+
- **7 大安全类别**:网络暴露、访问控制、执行沙箱、凭证存储、内存投毒、供应链安全、资源成本
|
|
11
|
+
- **59 项安全检查**:覆盖 20+ CVE 漏洞
|
|
12
|
+
- **实时扫描进度**:TUI / WebUI 双界面支持
|
|
13
|
+
- **自动修复**:一键修复检测到的安全问题
|
|
14
|
+
- **IOC 威胁情报**:内置恶意 IP/域名检测
|
|
15
|
+
- **多语言支持**:中文 / 英文界面切换
|
|
16
|
+
|
|
17
|
+
## 安装
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install -g mohuclaw
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## 使用
|
|
24
|
+
|
|
25
|
+
### WebUI 模式
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
mohuclaw-webui
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
访问 http://localhost:12340
|
|
32
|
+
|
|
33
|
+
### TUI 模式
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
mohuclaw-tui
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
| 快捷键 | 功能 |
|
|
40
|
+
|--------|------|
|
|
41
|
+
| `check` + Enter | 开始扫描 |
|
|
42
|
+
| `↑` `↓` | 滚动列表 |
|
|
43
|
+
| `c` | 选择模式 |
|
|
44
|
+
| `Space` | 切换自动修复 |
|
|
45
|
+
| `f` | 执行修复 |
|
|
46
|
+
| `Esc` | 退出选择 |
|
|
47
|
+
|
|
48
|
+
## 配置
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
export OPENCLAW_HOME=/path/to/openclaw
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
默认路径:`~/.openclaw`
|
|
55
|
+
|
|
56
|
+
## 要求
|
|
57
|
+
|
|
58
|
+
- Node.js >= 18.0.0
|
|
59
|
+
- Linux (推荐 Ubuntu/Debian)
|
|
60
|
+
- Bash
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
MIT
|
package/bin/mohu-tui.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* MohuClaw TUI CLI Entry Point
|
|
5
|
+
* This script dynamically locates the compiled TUI bundle
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { fileURLToPath } from 'url';
|
|
9
|
+
import path from 'path';
|
|
10
|
+
import { spawn } from 'child_process';
|
|
11
|
+
import fs from 'fs';
|
|
12
|
+
|
|
13
|
+
if (typeof global.self === 'undefined') {
|
|
14
|
+
global.self = global;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
18
|
+
const __dirname = path.dirname(__filename);
|
|
19
|
+
|
|
20
|
+
// Get the package installation directory
|
|
21
|
+
const PACKAGE_DIR = path.resolve(__dirname, '..');
|
|
22
|
+
|
|
23
|
+
// Try to find the compiled TUI in dist/tui/tui.js
|
|
24
|
+
const TUI_PATH = path.join(PACKAGE_DIR, 'dist', 'tui', 'tui.js');
|
|
25
|
+
|
|
26
|
+
// Check if TUI exists
|
|
27
|
+
if (!fs.existsSync(TUI_PATH)) {
|
|
28
|
+
console.error('❌ Error: TUI bundle not found at:', TUI_PATH);
|
|
29
|
+
console.error('');
|
|
30
|
+
console.error('Please run the build process first:');
|
|
31
|
+
console.error(' npm run build');
|
|
32
|
+
console.error('');
|
|
33
|
+
console.error('Or if you installed from npm, please reinstall:');
|
|
34
|
+
console.error(' npm install -g mohu-claw');
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Get scripts directory for reference
|
|
39
|
+
const SCRIPTS_DIR = path.join(PACKAGE_DIR, 'scripts');
|
|
40
|
+
|
|
41
|
+
if (!fs.existsSync(SCRIPTS_DIR)) {
|
|
42
|
+
console.error('❌ Error: Scripts directory not found at:', SCRIPTS_DIR);
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Set environment variables for Linux
|
|
47
|
+
const env = {
|
|
48
|
+
...process.env,
|
|
49
|
+
// Ensure we're using bash
|
|
50
|
+
SHELL: '/bin/bash',
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
// Execute the TUI with tsx or node
|
|
54
|
+
import { createRequire } from 'module';
|
|
55
|
+
const require = createRequire(import.meta.url);
|
|
56
|
+
|
|
57
|
+
// Try to find tsx or use node directly
|
|
58
|
+
let executor = 'node';
|
|
59
|
+
try {
|
|
60
|
+
// Check if tsx is available
|
|
61
|
+
const tsxPath = require.resolve('tsx', { paths: [PACKAGE_DIR] });
|
|
62
|
+
executor = 'node';
|
|
63
|
+
process.argv = ['node', tsxPath, TUI_PATH, ...process.argv.slice(2)];
|
|
64
|
+
} catch (e) {
|
|
65
|
+
// tsx not available, use node directly
|
|
66
|
+
process.argv = ['node', TUI_PATH, ...process.argv.slice(2)];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Import and run the TUI
|
|
70
|
+
import(TUI_PATH).catch(err => {
|
|
71
|
+
console.error('❌ Error running TUI:', err.message);
|
|
72
|
+
process.exit(1);
|
|
73
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* MohuClaw WebUI CLI Entry Point
|
|
5
|
+
* This script dynamically locates the server.js and starts the web server
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { fileURLToPath } from 'url';
|
|
9
|
+
import path from 'path';
|
|
10
|
+
import fs from 'fs';
|
|
11
|
+
|
|
12
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = path.dirname(__filename);
|
|
14
|
+
|
|
15
|
+
// Get the package installation directory
|
|
16
|
+
const PACKAGE_DIR = path.resolve(__dirname, '..');
|
|
17
|
+
|
|
18
|
+
// Try to find the server in dist/webui/server.js
|
|
19
|
+
const SERVER_PATH = path.join(PACKAGE_DIR, 'dist', 'webui', 'server.js');
|
|
20
|
+
const INDEX_HTML_PATH = path.join(PACKAGE_DIR, 'dist', 'webui', 'index.html');
|
|
21
|
+
|
|
22
|
+
// Check if server exists
|
|
23
|
+
if (!fs.existsSync(SERVER_PATH)) {
|
|
24
|
+
console.error('❌ Error: WebUI server not found at:', SERVER_PATH);
|
|
25
|
+
console.error('');
|
|
26
|
+
console.error('Please run the build process first:');
|
|
27
|
+
console.error(' npm run build');
|
|
28
|
+
console.error('');
|
|
29
|
+
console.error('Or if you installed from npm, please reinstall:');
|
|
30
|
+
console.error(' npm install -g mohu-claw');
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (!fs.existsSync(INDEX_HTML_PATH)) {
|
|
35
|
+
console.error('❌ Error: index.html not found at:', INDEX_HTML_PATH);
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Get scripts directory for reference
|
|
40
|
+
const SCRIPTS_DIR = path.join(PACKAGE_DIR, 'scripts');
|
|
41
|
+
const IOC_DIR = path.join(PACKAGE_DIR, 'ioc');
|
|
42
|
+
|
|
43
|
+
if (!fs.existsSync(SCRIPTS_DIR)) {
|
|
44
|
+
console.error('❌ Error: Scripts directory not found at:', SCRIPTS_DIR);
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Set environment variables
|
|
49
|
+
const env = {
|
|
50
|
+
...process.env,
|
|
51
|
+
// Set package directory as environment variable for server to use
|
|
52
|
+
MOHU_CLAW_PACKAGE_DIR: PACKAGE_DIR,
|
|
53
|
+
MOHU_CLAW_SCRIPTS_DIR: SCRIPTS_DIR,
|
|
54
|
+
MOHU_CLAW_IOC_DIR: IOC_DIR,
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
console.log('🛡️ Starting MohuClaw WebUI...');
|
|
58
|
+
console.log(' Package Directory:', PACKAGE_DIR);
|
|
59
|
+
console.log(' Scripts Directory:', SCRIPTS_DIR);
|
|
60
|
+
console.log('');
|
|
61
|
+
|
|
62
|
+
// Import and run the server
|
|
63
|
+
import(SERVER_PATH).catch(err => {
|
|
64
|
+
console.error('❌ Error starting WebUI server:', err.message);
|
|
65
|
+
console.error(err.stack);
|
|
66
|
+
process.exit(1);
|
|
67
|
+
});
|