whitzard-claw 1.0.0
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/README.md +89 -0
- package/bin/whitzard-tui.js +73 -0
- package/bin/whitzard-webui.js +67 -0
- package/dist/tui/tui.js +38733 -0
- package/dist/webui/index.html +1235 -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 +50 -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 +1235 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# CHECK 1 (origin 1): Known C2 Infrastructure
|
|
3
|
+
|
|
4
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
5
|
+
source "$SCRIPT_DIR/_common.sh"
|
|
6
|
+
|
|
7
|
+
# Environment vars (set by caller / _common.sh sourced before this):
|
|
8
|
+
# SKILL_NAME — if set (auto-fix mode), the skill to remove
|
|
9
|
+
# AUTO_FIX — if "1", automatically remove the offending skill
|
|
10
|
+
# Example: AUTO_FIX=1 SKILL_NAME="your-skill-name" ./check_1.sh
|
|
11
|
+
|
|
12
|
+
# Build C2 pattern
|
|
13
|
+
C2_PATTERN="$(load_ips | tr '\n' '|' | sed 's/|$//' | sed 's/\./\\./g')"
|
|
14
|
+
FOUND_SKILLS=()
|
|
15
|
+
|
|
16
|
+
if [ -d "$SKILLS_DIR" ]; then
|
|
17
|
+
while IFS= read -r file; do
|
|
18
|
+
skill_name="$(basename "$(dirname "$file")")"
|
|
19
|
+
# Deduplicate
|
|
20
|
+
if [[ ! " ${FOUND_SKILLS[*]} " =~ " ${skill_name} " ]]; then
|
|
21
|
+
FOUND_SKILLS+=("$skill_name")
|
|
22
|
+
fi
|
|
23
|
+
done < <(grep -rlE --exclude-dir="$SELF_DIR_NAME" "$C2_PATTERN" "$SKILLS_DIR" 2>/dev/null || true)
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
# Auto-fix
|
|
27
|
+
# if [ "${AUTO_FIX:-0}" = "1" ]; then
|
|
28
|
+
# TARGET_SKILL="${SKILL_NAME:-${FOUND_SKILLS[0]}}"
|
|
29
|
+
# log "AUTO-FIX: Removing skill '$TARGET_SKILL'..."
|
|
30
|
+
|
|
31
|
+
# if openclaw skill remove "$TARGET_SKILL" >> "$LOG_FILE" 2>&1; then
|
|
32
|
+
# log "SUCCESS: Skill '$TARGET_SKILL' has been removed."
|
|
33
|
+
# cat << 'EOF'
|
|
34
|
+
# Auto-fix completed successfully.
|
|
35
|
+
# EOF
|
|
36
|
+
# exit 0
|
|
37
|
+
# else
|
|
38
|
+
# log "ERROR: Failed to remove skill '$TARGET_SKILL'. Please remove it manually:"
|
|
39
|
+
# log " openclaw skill remove $TARGET_SKILL"
|
|
40
|
+
# exit 1
|
|
41
|
+
# fi
|
|
42
|
+
# fi
|
|
43
|
+
|
|
44
|
+
if [ "${AUTO_FIX:-0}" = "1" ]; then
|
|
45
|
+
TARGET_SKILL="${SKILL_NAME}"
|
|
46
|
+
log "AUTO-FIX: Removing skill '$TARGET_SKILL'..."
|
|
47
|
+
|
|
48
|
+
SKILL_PATH="$SKILLS_DIR/$TARGET_SKILL"
|
|
49
|
+
LOCK_FILE="$WORKSPACE_DIR/.clawhub/lock.json"
|
|
50
|
+
|
|
51
|
+
# 删除 skill 目录
|
|
52
|
+
if rm -rf "$SKILL_PATH"; then
|
|
53
|
+
log "SUCCESS: Skill directory '$SKILL_PATH' removed."
|
|
54
|
+
else
|
|
55
|
+
log "ERROR: Failed to remove '$SKILL_PATH'"
|
|
56
|
+
exit 1
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
# 从 lock.json 移除条目
|
|
60
|
+
if [ -f "$LOCK_FILE" ] && command -v python3 >/dev/null 2>&1; then
|
|
61
|
+
python3 -c "
|
|
62
|
+
import json, sys
|
|
63
|
+
with open('$LOCK_FILE') as f:
|
|
64
|
+
data = json.load(f)
|
|
65
|
+
data['skills'] = {k: v for k, v in data['skills'].items() if k != '$TARGET_SKILL'}
|
|
66
|
+
with open('$LOCK_FILE', 'w') as f:
|
|
67
|
+
json.dump(data, f, indent=2)
|
|
68
|
+
" && log "SUCCESS: Removed '$TARGET_SKILL' from lock.json"
|
|
69
|
+
fi
|
|
70
|
+
|
|
71
|
+
log "SUCCESS: Skill '$TARGET_SKILL' has been removed."
|
|
72
|
+
exit 0
|
|
73
|
+
fi
|
|
74
|
+
|
|
75
|
+
# Guidance
|
|
76
|
+
cat << EOF
|
|
77
|
+
RECOMMENDED ACTIONS:
|
|
78
|
+
1. Remove the suspicious skills immediately:
|
|
79
|
+
$(for skill in "${FOUND_SKILLS[@]}"; do echo " rm -rf ~/.openclaw/workspace/skills/$skill"; done)
|
|
80
|
+
|
|
81
|
+
2. Review your openclaw logs for any executed commands:
|
|
82
|
+
tail -100 ~/.openclaw/logs/openclaw.log
|
|
83
|
+
|
|
84
|
+
3. Check network connections for suspicious activity:
|
|
85
|
+
netstat -an | grep ESTABLISHED
|
|
86
|
+
|
|
87
|
+
4. Consider running a full security scan on your system
|
|
88
|
+
|
|
89
|
+
5. Review where these skills came from and avoid installing from untrusted sources
|
|
90
|
+
|
|
91
|
+
auto-fix
|
|
92
|
+
$(for skill in "${FOUND_SKILLS[@]}"; do echo "$skill"; done)
|
|
93
|
+
EOF
|
|
94
|
+
|
|
95
|
+
exit 0
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# CHECK 10 (origin 32): MCP Server Security
|
|
3
|
+
# Usage: ./check_10.sh
|
|
4
|
+
|
|
5
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
6
|
+
source "$SCRIPT_DIR/_common.sh"
|
|
7
|
+
MCP_CONFIG="$OPENCLAW_DIR/mcp.json"
|
|
8
|
+
|
|
9
|
+
# Guidance
|
|
10
|
+
cat << EOF
|
|
11
|
+
RECOMMENDED SECURE MCP CONFIGURATION:
|
|
12
|
+
{
|
|
13
|
+
"mcpServers": {
|
|
14
|
+
"trusted-server": {
|
|
15
|
+
"source": "https://trusted-registry.openclaw.ai/server.json",
|
|
16
|
+
"enabled": true,
|
|
17
|
+
"permissions": {
|
|
18
|
+
"allowedCommands": ["specific-command-1", "specific-command-2"],
|
|
19
|
+
"allowShellExec": false,
|
|
20
|
+
"allowFileSystem": "read-only",
|
|
21
|
+
"allowNetwork": ["api.example.com"]
|
|
22
|
+
},
|
|
23
|
+
"sandbox": true,
|
|
24
|
+
"timeout": 30000
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"enableAllProjectMcpServers": false,
|
|
28
|
+
"defaultPermissions": {
|
|
29
|
+
"allowShellExec": false,
|
|
30
|
+
"allowFileSystem": false,
|
|
31
|
+
"requireApproval": true
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
SECURITY BEST PRACTICES:
|
|
36
|
+
1. Only enable MCP servers from trusted sources
|
|
37
|
+
2. Use HTTPS for server sources (never HTTP)
|
|
38
|
+
3. Grant minimal required permissions (principle of least privilege)
|
|
39
|
+
4. Set allowShellExec to false unless absolutely necessary
|
|
40
|
+
5. Use allowedCommands whitelist instead of wildcard permissions
|
|
41
|
+
6. Enable sandbox mode for untrusted servers
|
|
42
|
+
7. Set reasonable timeout values
|
|
43
|
+
8. Regularly audit enabled servers
|
|
44
|
+
9. Keep mcp.json file permissions at 600
|
|
45
|
+
10. Never include credentials in mcp.json (use env vars)
|
|
46
|
+
|
|
47
|
+
PROMPT INJECTION PROTECTION:
|
|
48
|
+
- Avoid dynamic prompt construction from untrusted input
|
|
49
|
+
- Validate and sanitize all server responses
|
|
50
|
+
- Use structured outputs instead of free-form text
|
|
51
|
+
- Implement rate limiting on MCP server calls
|
|
52
|
+
|
|
53
|
+
MANUAL REVIEW AND REPAIR REQUIRED:
|
|
54
|
+
cat ~/.openclaw/mcp.json
|
|
55
|
+
|
|
56
|
+
Attention: Backup before editing.
|
|
57
|
+
|
|
58
|
+
EOF
|
|
59
|
+
|
|
60
|
+
exit 0
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# CHECK 11 (origin 5): Crypto Wallet Targeting
|
|
3
|
+
# Usage: ./check_11.sh
|
|
4
|
+
|
|
5
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
6
|
+
source "$SCRIPT_DIR/_common.sh"
|
|
7
|
+
|
|
8
|
+
CRYPTO_PATTERN='wallet.*private.*key|seed\.phrase|mnemonic|keystore.*decrypt|phantom.*wallet|metamask.*vault|exchange.*api.*key|solana.*keypair|ethereum.*keyfile'
|
|
9
|
+
FOUND_SKILLS=()
|
|
10
|
+
|
|
11
|
+
if [ -d "$SKILLS_DIR" ]; then
|
|
12
|
+
while IFS= read -r file; do
|
|
13
|
+
skill_name="$(basename "$(dirname "$file")")"
|
|
14
|
+
# Deduplicate
|
|
15
|
+
if [[ ! " ${FOUND_SKILLS[*]} " =~ " ${skill_name} " ]]; then
|
|
16
|
+
FOUND_SKILLS+=("$skill_name")
|
|
17
|
+
fi
|
|
18
|
+
done < <(grep -rlE --exclude-dir="$SELF_DIR_NAME" "$CRYPTO_PATTERN" "$SKILLS_DIR" 2>/dev/null || true)
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
# Guidance
|
|
22
|
+
cat << EOF
|
|
23
|
+
RECOMMENDED ACTIONS:
|
|
24
|
+
1. Remove the malicious skills NOW:
|
|
25
|
+
$(for skill in "${FOUND_SKILLS[@]}"; do echo " rm -rf ~/.openclaw/workspace/skills/$skill"; done)
|
|
26
|
+
|
|
27
|
+
2. Secure your cryptocurrency wallets IMMEDIATELY:
|
|
28
|
+
a) Transfer funds to a NEW wallet with a NEW seed phrase:
|
|
29
|
+
- Create new wallet with fresh seed phrase
|
|
30
|
+
- Transfer all assets to the new wallet
|
|
31
|
+
- Never reuse the old seed phrase
|
|
32
|
+
|
|
33
|
+
b) Move to hardware wallet if possible:
|
|
34
|
+
- Ledger, Trezor, or similar hardware wallets
|
|
35
|
+
- Much more secure than software wallets
|
|
36
|
+
|
|
37
|
+
c) Lock down existing wallet directories:
|
|
38
|
+
chmod 700 ~/.bitcoin
|
|
39
|
+
chmod 700 ~/.ethereum
|
|
40
|
+
|
|
41
|
+
3. Check wallet transaction history:
|
|
42
|
+
- Look for unauthorized transfers
|
|
43
|
+
- Check all addresses and balances
|
|
44
|
+
- Review recent activity logs
|
|
45
|
+
|
|
46
|
+
4. Enable additional security:
|
|
47
|
+
- Multi-signature wallets where possible
|
|
48
|
+
- Strong passphrases on wallet files
|
|
49
|
+
- Two-factor authentication on exchanges
|
|
50
|
+
|
|
51
|
+
5. Never store seed phrases digitally:
|
|
52
|
+
- Write them on paper or metal
|
|
53
|
+
- Store in a safe or safety deposit box
|
|
54
|
+
- Never save in files, photos, or cloud storage
|
|
55
|
+
|
|
56
|
+
6. Monitor for suspicious activity:
|
|
57
|
+
- Set up alerts for wallet transactions
|
|
58
|
+
- Regularly check balances
|
|
59
|
+
- Be alert for phishing attempts
|
|
60
|
+
|
|
61
|
+
EOF
|
|
62
|
+
|
|
63
|
+
exit 0
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# CHECK 12 (origin 6): Curl-Pipe / Download Attacks
|
|
3
|
+
# Usage: ./check_12.sh
|
|
4
|
+
|
|
5
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
6
|
+
source "$SCRIPT_DIR/_common.sh"
|
|
7
|
+
|
|
8
|
+
CURL_PATTERN='curl.*\|.*sh|curl.*\|.*bash|wget.*\|.*sh|curl -fsSL.*\||wget -q.*\||curl.*-o.*/tmp/'
|
|
9
|
+
FOUND_SKILLS=()
|
|
10
|
+
|
|
11
|
+
if [ -d "$SKILLS_DIR" ]; then
|
|
12
|
+
while IFS= read -r file; do
|
|
13
|
+
skill_name="$(basename "$(dirname "$file")")"
|
|
14
|
+
# Deduplicate
|
|
15
|
+
if [[ ! " ${FOUND_SKILLS[*]} " =~ " ${skill_name} " ]]; then
|
|
16
|
+
FOUND_SKILLS+=("$skill_name")
|
|
17
|
+
fi
|
|
18
|
+
done < <(grep -rlE --exclude-dir="$SELF_DIR_NAME" "$CURL_PATTERN" "$SKILLS_DIR" 2>/dev/null || true)
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
# Guidance
|
|
22
|
+
cat << EOF
|
|
23
|
+
RECOMMENDED ACTIONS:
|
|
24
|
+
1. Remove the suspicious skills immediately:
|
|
25
|
+
$(for skill in "${FOUND_SKILLS[@]}"; do echo " rm -rf ~/.openclaw/workspace/skills/$skill"; done)
|
|
26
|
+
|
|
27
|
+
2. Review what these skills may have executed:
|
|
28
|
+
tail -100 ~/.openclaw/logs/openclaw.log
|
|
29
|
+
|
|
30
|
+
3. Check for suspicious processes or files:
|
|
31
|
+
ps aux | grep -v grep
|
|
32
|
+
find /tmp -type f -mtime -1
|
|
33
|
+
|
|
34
|
+
EOF
|
|
35
|
+
|
|
36
|
+
exit 0
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# CHECK 13 (origin 8): Skill Integrity Hashes
|
|
3
|
+
# Usage: ./check_13.sh
|
|
4
|
+
|
|
5
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
6
|
+
source "$SCRIPT_DIR/_common.sh"
|
|
7
|
+
|
|
8
|
+
HASH_FILE="$LOG_DIR/skill-hashes.sha256"
|
|
9
|
+
HASH_FILE_PREV="$LOG_DIR/skill-hashes.sha256.prev"
|
|
10
|
+
FOUND_SKILLS=()
|
|
11
|
+
|
|
12
|
+
if [ -d "$SKILLS_DIR" ]; then
|
|
13
|
+
find "$SKILLS_DIR" -name "SKILL.md" -type f -exec shasum -a 256 {} \; > "$HASH_FILE" 2>/dev/null || true
|
|
14
|
+
|
|
15
|
+
if [ -f "$HASH_FILE_PREV" ]; then
|
|
16
|
+
DIFF="$(diff "$HASH_FILE_PREV" "$HASH_FILE" 2>/dev/null || true)"
|
|
17
|
+
if [ -n "$DIFF" ]; then
|
|
18
|
+
FOUND_SKILLS+=("Skill files changed since last scan:")
|
|
19
|
+
while IFS= read -r line; do
|
|
20
|
+
FOUND_SKILLS+=("$line")
|
|
21
|
+
done <<< "$DIFF"
|
|
22
|
+
fi
|
|
23
|
+
fi
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
# Guidance
|
|
27
|
+
cat << EOF
|
|
28
|
+
RECOMMENDED ACTIONS:
|
|
29
|
+
1. Review what changed
|
|
30
|
+
diff ~/.openclaw/logs/skill-hashes.sha256.prev ~/.openclaw/logs/skill-hashes.sha256
|
|
31
|
+
|
|
32
|
+
2. For each changed skill, inspect the diff
|
|
33
|
+
cd ~/.openclaw/workspace/skills/<skill-name>
|
|
34
|
+
git diff HEAD~1 SKILL.md # If under version control
|
|
35
|
+
|
|
36
|
+
3. If change is unexpected, reinstall from ClawHub
|
|
37
|
+
openclaw skill remove <skill-name>
|
|
38
|
+
openclaw skill install <skill-name>
|
|
39
|
+
|
|
40
|
+
4. Enable skill pinning (if supported)
|
|
41
|
+
openclaw config set skills.autoUpdate false
|
|
42
|
+
EOF
|
|
43
|
+
|
|
44
|
+
exit 0
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# CHECK 14 (origin 9): SKILL.md Shell Injection Patterns
|
|
3
|
+
# Usage: ./check_14.sh
|
|
4
|
+
|
|
5
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
6
|
+
source "$SCRIPT_DIR/_common.sh"
|
|
7
|
+
|
|
8
|
+
INJECTION_PATTERN='Prerequisites.*install|Prerequisites.*download|Prerequisites.*curl|Prerequisites.*wget|run this command.*terminal|paste.*terminal|copy.*terminal|base64 -d|base64 --decode|eval \$\(|exec \$\(|`curl|`wget|bypass.*safety.*guideline|execute.*without.*asking|ignore.*safety|override.*instruction|without.*user.*awareness'
|
|
9
|
+
FOUND_SKILLS=()
|
|
10
|
+
|
|
11
|
+
while IFS= read -r skillmd; do
|
|
12
|
+
[ -z "$skillmd" ] && continue
|
|
13
|
+
if grep -qiE "$INJECTION_PATTERN" "$skillmd" 2>/dev/null; then
|
|
14
|
+
FOUND_SKILLS+=("$skillmd")
|
|
15
|
+
fi
|
|
16
|
+
done < <(find "$SKILLS_DIR" -name "SKILL.md" -type f -not -path "*/$SELF_DIR_NAME/*" 2>/dev/null)
|
|
17
|
+
|
|
18
|
+
# Guidance
|
|
19
|
+
cat << EOF
|
|
20
|
+
RECOMMENDED ACTIONS:
|
|
21
|
+
1. Review each SKILL.md file listed above:
|
|
22
|
+
$(for skill in "${FOUND_SKILLS[@]}"; do echo " $skill"; done)
|
|
23
|
+
|
|
24
|
+
2. Look for suspicious Prerequisites sections that execute commands
|
|
25
|
+
|
|
26
|
+
3. Check for base64 encoded payloads or eval statements
|
|
27
|
+
|
|
28
|
+
4. Remove the entire skill directory if confirmed malicious:
|
|
29
|
+
$(for skill in "${FOUND_SKILLS[@]}"; do echo " rm -rf $(dirname "$skill")"; done)
|
|
30
|
+
|
|
31
|
+
EOF
|
|
32
|
+
|
|
33
|
+
exit 0
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# CHECK 15 (origin 11): Base64 Obfuscation Detection
|
|
3
|
+
# Usage: ./check_15.sh
|
|
4
|
+
|
|
5
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
6
|
+
source "$SCRIPT_DIR/_common.sh"
|
|
7
|
+
|
|
8
|
+
B64_PATTERN='base64 -[dD]|base64 --decode|atob\(|Buffer\.from\(.*base64|echo.*\|.*base64.*\|.*bash|echo.*\|.*base64.*\|.*sh|python.*b64decode|import base64'
|
|
9
|
+
FOUND_SKILLS=()
|
|
10
|
+
|
|
11
|
+
while IFS= read -r file; do
|
|
12
|
+
skill_name="$(basename "$(dirname "$file")")"
|
|
13
|
+
# Deduplicate
|
|
14
|
+
if [[ ! " ${FOUND_SKILLS[*]} " =~ " ${skill_name} " ]]; then
|
|
15
|
+
FOUND_SKILLS+=("$skill_name")
|
|
16
|
+
fi
|
|
17
|
+
done < <(grep -rlE --exclude-dir="$SELF_DIR_NAME" "$B64_PATTERN" "$SKILLS_DIR" 2>/dev/null || true)
|
|
18
|
+
|
|
19
|
+
cat <<EOF
|
|
20
|
+
RECOMMENDED ACTIONS:
|
|
21
|
+
1. Review each skill listed above to understand WHY it decodes base64
|
|
22
|
+
|
|
23
|
+
2. Check if there are long base64 strings that decode to shell commands
|
|
24
|
+
|
|
25
|
+
3. Verify the decoded content is legitimate (if unsure, decode manually):
|
|
26
|
+
echo 'BASE64_STRING' | base64 -d
|
|
27
|
+
|
|
28
|
+
4. If confirmed malicious, remove the skill:
|
|
29
|
+
$(for skill in "${FOUND_SKILLS[@]}"; do echo " rm -rf $SKILLS_DIR/$skill"; done)
|
|
30
|
+
|
|
31
|
+
EOF
|
|
32
|
+
|
|
33
|
+
exit 0
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# CHECK 16 (origin 12): External Binary Downloads
|
|
3
|
+
# Usage: ./check_16.sh
|
|
4
|
+
|
|
5
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
6
|
+
source "$SCRIPT_DIR/_common.sh"
|
|
7
|
+
|
|
8
|
+
BIN_PATTERN='\.exe|\.dmg|\.pkg|\.msi|\.app\.zip|releases/download|github\.com/.*/releases|\.zip.*password|password.*\.zip|openclawcli\.zip|openclaw-agent|AuthTool.*download|download.*AuthTool'
|
|
9
|
+
FOUND_SKILLS=()
|
|
10
|
+
|
|
11
|
+
while IFS= read -r file; do
|
|
12
|
+
skill_name="$(basename "$(dirname "$file")")"
|
|
13
|
+
# Deduplicate
|
|
14
|
+
if [[ ! " ${FOUND_SKILLS[*]} " =~ " ${skill_name} " ]]; then
|
|
15
|
+
FOUND_SKILLS+=("$skill_name")
|
|
16
|
+
fi
|
|
17
|
+
done < <(grep -rlE --exclude-dir="$SELF_DIR_NAME" "$BIN_PATTERN" "$SKILLS_DIR" 2>/dev/null || true)
|
|
18
|
+
|
|
19
|
+
cat <<EOF
|
|
20
|
+
RECOMMENDED ACTIONS:
|
|
21
|
+
1. Review each skill to determine if binary downloads are necessary
|
|
22
|
+
|
|
23
|
+
2. Check what the downloaded file is and where it comes from
|
|
24
|
+
|
|
25
|
+
3. Verify the source is trustworthy (official repos only)
|
|
26
|
+
|
|
27
|
+
4. Look for hardcoded URLs pointing to suspicious domains
|
|
28
|
+
|
|
29
|
+
5. If confirmed malicious or unnecessary, remove the skill:
|
|
30
|
+
$(for skill in "${FOUND_SKILLS[@]}"; do echo " rm -rf $SKILLS_DIR/$skill"; done)
|
|
31
|
+
|
|
32
|
+
EOF
|
|
33
|
+
|
|
34
|
+
exit 0
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# CHECK 17 (origin 38): Skill Env Override Host Injection
|
|
3
|
+
# Usage: ./check_17.sh
|
|
4
|
+
|
|
5
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
6
|
+
source "$SCRIPT_DIR/_common.sh"
|
|
7
|
+
|
|
8
|
+
FOUND_SKILLS=()
|
|
9
|
+
ENV_OVERRIDE_ISSUES=0
|
|
10
|
+
|
|
11
|
+
while IFS= read -r SKILL_DIR; do
|
|
12
|
+
[ -z "$SKILL_DIR" ] && continue
|
|
13
|
+
SKILL_NAME="$(basename "$SKILL_DIR")"
|
|
14
|
+
if [ "$SKILL_NAME" = "$SELF_DIR_NAME" ]; then
|
|
15
|
+
continue
|
|
16
|
+
fi
|
|
17
|
+
SKILL_FLAGGED=false
|
|
18
|
+
SKILL_MD="$SKILL_DIR/SKILL.md"
|
|
19
|
+
if [ -f "$SKILL_MD" ]; then
|
|
20
|
+
if grep -qiE '^\s*"?(HOST|PORT|OPENCLAW_|API_URL|BASE_URL|GATEWAY_URL|SERVER_URL)"?\s*:' "$SKILL_MD" 2>/dev/null; then
|
|
21
|
+
ENV_OVERRIDE_ISSUES=$((ENV_OVERRIDE_ISSUES + 1))
|
|
22
|
+
SKILL_FLAGGED=true
|
|
23
|
+
fi
|
|
24
|
+
fi
|
|
25
|
+
for CFG in "$SKILL_DIR/package.json" "$SKILL_DIR/config.json" "$SKILL_DIR/.env"; do
|
|
26
|
+
if [ -f "$CFG" ]; then
|
|
27
|
+
if grep -qiE '(OPENCLAW_HOME|OPENCLAW_DIR|GATEWAY_URL|API_BASE|HOST=|PORT=)' "$CFG" 2>/dev/null; then
|
|
28
|
+
ENV_OVERRIDE_ISSUES=$((ENV_OVERRIDE_ISSUES + 1))
|
|
29
|
+
SKILL_FLAGGED=true
|
|
30
|
+
fi
|
|
31
|
+
fi
|
|
32
|
+
done
|
|
33
|
+
if [ "$SKILL_FLAGGED" = true ]; then
|
|
34
|
+
if [[ ! " ${FOUND_SKILLS[*]} " =~ " ${SKILL_NAME} " ]]; then
|
|
35
|
+
FOUND_SKILLS+=("$SKILL_NAME")
|
|
36
|
+
fi
|
|
37
|
+
fi
|
|
38
|
+
done < <(find "$SKILLS_DIR" -mindepth 1 -maxdepth 1 -type d 2>/dev/null)
|
|
39
|
+
|
|
40
|
+
cat <<EOF
|
|
41
|
+
RECOMMENDED ACTIONS:
|
|
42
|
+
1. Inspect each skill's configuration files:
|
|
43
|
+
$(for skill in "${FOUND_SKILLS[@]}"; do echo " cat $SKILLS_DIR/$skill/SKILL.md"; done)
|
|
44
|
+
$(for skill in "${FOUND_SKILLS[@]}"; do
|
|
45
|
+
for f in package.json config.json .env; do
|
|
46
|
+
echo " cat $SKILLS_DIR/$skill/$f # if exists"
|
|
47
|
+
done
|
|
48
|
+
done)
|
|
49
|
+
|
|
50
|
+
2. Check what HOST/PORT/URL values are being set and whether they point
|
|
51
|
+
to unexpected external servers
|
|
52
|
+
|
|
53
|
+
3. If confirmed malicious, remove the skill:
|
|
54
|
+
$(for skill in "${FOUND_SKILLS[@]}"; do echo " rm -rf $SKILLS_DIR/$skill"; done)
|
|
55
|
+
|
|
56
|
+
4. After removal, restart OpenClaw to ensure env is clean:
|
|
57
|
+
openclaw restart
|
|
58
|
+
|
|
59
|
+
EOF
|
|
60
|
+
|
|
61
|
+
exit 0
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# CHECK 18 (new / SC-SKILL-003): Known malicious file hash IOC scan
|
|
3
|
+
# Usage: ./check_18.sh
|
|
4
|
+
|
|
5
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
6
|
+
source "$SCRIPT_DIR/_common.sh"
|
|
7
|
+
|
|
8
|
+
HASH_IOC_ISSUES=0
|
|
9
|
+
HASH_IOCS_PRESENT=0
|
|
10
|
+
FOUND_SKILLS=()
|
|
11
|
+
|
|
12
|
+
if [ -f "$IOC_DIR/malicious-hashes.txt" ]; then
|
|
13
|
+
HASH_IOCS_PRESENT=1
|
|
14
|
+
else
|
|
15
|
+
log " malicious-hashes.txt not found under $IOC_DIR"
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
if [ "$HASH_IOCS_PRESENT" -eq 1 ]; then
|
|
19
|
+
while IFS= read -r skill_dir; do
|
|
20
|
+
[ -z "$skill_dir" ] && continue
|
|
21
|
+
skill_name="$(basename "$skill_dir")"
|
|
22
|
+
if [ "$skill_name" = "$SELF_DIR_NAME" ]; then
|
|
23
|
+
continue
|
|
24
|
+
fi
|
|
25
|
+
SKILL_FLAGGED=false
|
|
26
|
+
while IFS= read -r f; do
|
|
27
|
+
[ -z "$f" ] && continue
|
|
28
|
+
file_hash="$(sha256_file "$f" || true)"
|
|
29
|
+
[ -n "$file_hash" ] || continue
|
|
30
|
+
campaign="$(lookup_malicious_hash_campaign "$file_hash" || true)"
|
|
31
|
+
if [ -n "$campaign" ]; then
|
|
32
|
+
HASH_IOC_ISSUES=$((HASH_IOC_ISSUES + 1))
|
|
33
|
+
SKILL_FLAGGED=true
|
|
34
|
+
fi
|
|
35
|
+
done < <(find "$skill_dir" -type f 2>/dev/null)
|
|
36
|
+
if [ "$SKILL_FLAGGED" = true ]; then
|
|
37
|
+
if [[ ! " ${FOUND_SKILLS[*]} " =~ " ${skill_name} " ]]; then
|
|
38
|
+
FOUND_SKILLS+=("$skill_name")
|
|
39
|
+
fi
|
|
40
|
+
fi
|
|
41
|
+
done < <(find "$SKILLS_DIR" -mindepth 1 -maxdepth 1 -type d 2>/dev/null)
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
# Guidance
|
|
45
|
+
cat <<EOF
|
|
46
|
+
RECOMMENDED ACTIONS:
|
|
47
|
+
1. Inspect the flagged files listed above (check logs for exact paths and hashes)
|
|
48
|
+
|
|
49
|
+
2. Cross-reference the SHA-256 hash manually if needed:
|
|
50
|
+
grep '<hash>' $IOC_DIR/malicious-hashes.txt
|
|
51
|
+
|
|
52
|
+
3. Do NOT execute any files from the affected skills
|
|
53
|
+
|
|
54
|
+
4. Remove confirmed malicious skills immediately:
|
|
55
|
+
$(for skill in "${FOUND_SKILLS[@]}"; do echo " rm -rf $SKILLS_DIR/$skill"; done)
|
|
56
|
+
|
|
57
|
+
5. After removal, restart OpenClaw to clear any loaded state:
|
|
58
|
+
openclaw restart
|
|
59
|
+
|
|
60
|
+
EOF
|
|
61
|
+
|
|
62
|
+
exit 0
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# CHECK 2 (origin 2): AMOS Stealer / AuthTool Markers
|
|
3
|
+
|
|
4
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
5
|
+
source "$SCRIPT_DIR/_common.sh"
|
|
6
|
+
|
|
7
|
+
# Environment vars (set by caller / _common.sh sourced before this):
|
|
8
|
+
# SKILL_NAME — if set (auto-fix mode), the skill to remove
|
|
9
|
+
# AUTO_FIX — if "1", automatically remove the offending skill
|
|
10
|
+
# Example: AUTO_FIX=1 SKILL_NAME="your-skill-name" ./check_2.sh
|
|
11
|
+
|
|
12
|
+
AMOS_PATTERN='authtool|atomic\.stealer|AMOS|NovaStealer|nova\.stealer|osascript.*password|osascript.*dialog|osascript.*keychain|Security\.framework.*Auth|openclaw-agent\.exe|openclaw-agent\.zip|openclawcli\.zip|AuthTool|Installer-Package'
|
|
13
|
+
FOUND_SKILLS=()
|
|
14
|
+
|
|
15
|
+
if [ -d "$SKILLS_DIR" ]; then
|
|
16
|
+
while IFS= read -r file; do
|
|
17
|
+
skill_name="$(basename "$(dirname "$file")")"
|
|
18
|
+
# Deduplicate
|
|
19
|
+
if [[ ! " ${FOUND_SKILLS[*]} " =~ " ${skill_name} " ]]; then
|
|
20
|
+
FOUND_SKILLS+=("$skill_name")
|
|
21
|
+
fi
|
|
22
|
+
done < <(grep -rlE --exclude-dir="$SELF_DIR_NAME" "$AMOS_PATTERN" "$SKILLS_DIR" 2>/dev/null || true)
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
# Auto-fix
|
|
26
|
+
if [ "${AUTO_FIX:-0}" = "1" ]; then
|
|
27
|
+
TARGET_SKILL="${SKILL_NAME}"
|
|
28
|
+
log "AUTO-FIX: Removing skill '$TARGET_SKILL'..."
|
|
29
|
+
|
|
30
|
+
SKILL_PATH="$SKILLS_DIR/$TARGET_SKILL"
|
|
31
|
+
LOCK_FILE="$WORKSPACE_DIR/.clawhub/lock.json"
|
|
32
|
+
|
|
33
|
+
# 删除 skill 目录
|
|
34
|
+
if rm -rf "$SKILL_PATH"; then
|
|
35
|
+
log "SUCCESS: Skill directory '$SKILL_PATH' removed."
|
|
36
|
+
else
|
|
37
|
+
log "ERROR: Failed to remove '$SKILL_PATH'"
|
|
38
|
+
exit 1
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
# 从 lock.json 移除条目
|
|
42
|
+
if [ -f "$LOCK_FILE" ] && command -v python3 >/dev/null 2>&1; then
|
|
43
|
+
python3 -c "
|
|
44
|
+
import json, sys
|
|
45
|
+
with open('$LOCK_FILE') as f:
|
|
46
|
+
data = json.load(f)
|
|
47
|
+
data['skills'] = {k: v for k, v in data['skills'].items() if k != '$TARGET_SKILL'}
|
|
48
|
+
with open('$LOCK_FILE', 'w') as f:
|
|
49
|
+
json.dump(data, f, indent=2)
|
|
50
|
+
" && log "SUCCESS: Removed '$TARGET_SKILL' from lock.json"
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
log "SUCCESS: Skill '$TARGET_SKILL' has been removed."
|
|
54
|
+
exit 0
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
# Guidance
|
|
58
|
+
cat << EOF
|
|
59
|
+
RECOMMENDED ACTIONS:
|
|
60
|
+
1. Remove the malicious skills NOW:
|
|
61
|
+
$(for skill in "${FOUND_SKILLS[@]}"; do echo " rm -rf ~/.openclaw/workspace/skills/$skill"; done)
|
|
62
|
+
|
|
63
|
+
2. Change ALL your passwords immediately:
|
|
64
|
+
- Email accounts
|
|
65
|
+
- Banking and financial services
|
|
66
|
+
- Social media accounts
|
|
67
|
+
- Work/corporate credentials
|
|
68
|
+
|
|
69
|
+
3. Review Keychain Access for suspicious entries:
|
|
70
|
+
ls -la ~/.ssh/
|
|
71
|
+
cat ~/.netrc 2>/dev/null
|
|
72
|
+
ls -la ~/.gnupg/
|
|
73
|
+
|
|
74
|
+
4. Check for unauthorized access:
|
|
75
|
+
- Review recent login activity on all accounts
|
|
76
|
+
- Check for new devices/sessions you don't recognize
|
|
77
|
+
|
|
78
|
+
5. Enable 2FA/MFA on all critical accounts if not already enabled
|
|
79
|
+
|
|
80
|
+
6. Consider these additional steps:
|
|
81
|
+
- Rotate SSH keys: ssh-keygen -t ed25519 -C "your_email@example.com"
|
|
82
|
+
- Move cryptocurrency wallets to hardware wallets
|
|
83
|
+
- Run full antivirus scan: sudo freshclam && sudo clamscan -r -i /
|
|
84
|
+
|
|
85
|
+
7. Monitor for identity theft:
|
|
86
|
+
- Check credit reports
|
|
87
|
+
- Watch for phishing attempts using stolen credentials
|
|
88
|
+
|
|
89
|
+
auto-fix
|
|
90
|
+
$(for skill in "${FOUND_SKILLS[@]}"; do echo "$skill"; done)
|
|
91
|
+
EOF
|
|
92
|
+
|
|
93
|
+
exit 0
|