Skill Security Audit
Detect malicious patterns in installed Claude and OpenClaw skills. Based on SlowMist's analysis of 472+ malicious skills on ClawHub platform.
Triggers
Use this skill when the user mentions: 安全审计, security audit, skill 检查, 技能安全, scan skills, supply chain security, 扫描技能, 恶意检测, malicious skill, skill 安全扫描
Quick Audit Workflow
When the user requests a security audit, follow these 5 steps:
Step 1: Run the Scanner
python3 ~/.claude/skills/skill-security-audit/scripts/skill_audit.py
This auto-discovers and scans all skills in:
~/.claude/skills/
~/.openclaw/workspace/skills/
- Extra directories from
~/.openclaw/openclaw.json → skills.load.extraDirs
Step 2: Analyze Results
Read the scanner output. Findings are grouped by skill and sorted by severity:
| Severity |
Meaning |
Action Required |
| CRITICAL |
Known malicious IOC match, credential theft, or download-and-execute |
Immediate removal and credential rotation |
| HIGH |
Obfuscation, persistence mechanisms, privilege escalation |
Manual review required, likely malicious |
| MEDIUM |
Suspicious patterns (Base64, network calls, high entropy) |
Review context — may be legitimate |
| LOW |
Social engineering naming, informational |
Note for awareness |
Step 3: Report to User
Present findings in this format:
## Audit Summary
- Skills scanned: N
- Files scanned: N
- CRITICAL: N | HIGH: N | MEDIUM: N | LOW: N
## Critical/High Findings (if any)
For each finding:
- Skill name and file path
- What was detected and why it's dangerous
- Recommended action
## Medium/Low Findings (if any)
Brief summary, noting which are likely false positives
Step 4: Recommend Actions
For CRITICAL findings:
- Read
references/remediation-guide.md for incident response steps
- Guide user through credential rotation if credential theft was detected
- Help quarantine the malicious skill
For HIGH findings:
- Help user manually review the flagged code
- Determine if the pattern is legitimate or malicious in context
Step 5: Follow Up
- Offer to scan a specific skill in detail:
python3 skill_audit.py --path /path/to/skill
- Offer to explain any finding in depth using
references/threat-patterns.md
Scanner Command Reference
# Scan all discovered skills
python3 ~/.claude/skills/skill-security-audit/scripts/skill_audit.py
# Scan a single skill directory
python3 ~/.claude/skills/skill-security-audit/scripts/skill_audit.py --path /path/to/skill
# JSON output (for programmatic use)
python3 ~/.claude/skills/skill-security-audit/scripts/skill_audit.py --json
# Filter by minimum severity
python3 ~/.claude/skills/skill-security-audit/scripts/skill_audit.py --severity high
# Disable colored output
python3 ~/.claude/skills/skill-security-audit/scripts/skill_audit.py --no-color
# Use custom IOC database
python3 ~/.claude/skills/skill-security-audit/scripts/skill_audit.py --ioc-db /path/to/ioc.json
Exit codes: 0 = clean, 1 = low/medium risk, 2 = high risk, 3 = critical, 4 = scanner error
13 Detection Categories
| Detector |
What It Finds |
Severity |
| Base64Detector |
Encoded strings >50 chars (excluding data:image) |
MEDIUM→HIGH |
| DownloadExecDetector |
curl|bash, wget|sh, fetch+eval patterns |
CRITICAL |
| IOCMatchDetector |
Known malicious IPs, domains, URLs, file hashes |
CRITICAL |
| ObfuscationDetector |
eval/exec with non-literal args, hex encoding, chr() chains |
HIGH |
| ExfiltrationDetector |
ZIP+upload combos, sensitive directory enumeration |
HIGH |
| CredentialTheftDetector |
osascript password dialogs, keychain access, SSH key reading |
CRITICAL |
| PersistenceDetector |
crontab, launchd, systemd, shell profile modification |
HIGH |
| PostInstallHookDetector |
npm postinstall, pip setup.py cmdclass |
HIGH→CRITICAL |
| HiddenCharDetector |
Zero-width characters, Unicode bidi overrides |
MEDIUM |
| EntropyDetector |
Shannon entropy >5.5 on long lines |
MEDIUM |
| SocialEngineeringDetector |
crypto/wallet/airdrop/security-update naming |
LOW→MEDIUM |
| NetworkCallDetector |
socket, http, urllib, requests, fetch, curl, wget |
MEDIUM |
| PrivilegeEscalationDetector |
sudo, chmod 777, setuid, admin group modification |
HIGH |
Understanding Confidence Scores
Each finding includes a confidence score (0-100):
- 80-100: Very likely a genuine threat
- 50-79: Suspicious, manual review recommended
- 30-49: Possible false positive, check context
- <30: Informational, low confidence
Manual Review Checklist
When the scanner flags something, also check:
- Source verification — Is the skill from an official/verified source? Check author reputation.
- Permission scope — Does the skill request more permissions than its stated functionality needs?
- Script audit — Read all
.sh, .py, .js files. Look for obfuscation, unexpected network calls.
- Dependency check — Run
npm audit or pip-audit if the skill has package dependencies.
- Changelog review — Were suspicious changes introduced in a recent update?
Updating the IOC Database
The IOC database is at scripts/ioc_database.json. To add new indicators:
- Edit the JSON file following the existing schema
- Run the scanner to verify your new IOCs are detected
- Update
references/ioc-database.md to keep the human-readable version in sync
Reference Documents
For detailed information, read these files as needed:
references/ioc-database.md — Full IOC list with context and attribution
references/threat-patterns.md — 9 attack patterns in detail (two-stage payload, Base64 backdoor, password phishing, etc.)
references/remediation-guide.md — Step-by-step incident response (quarantine, credential rotation, persistence cleanup, reporting)
1---2name: skill-security-audit3description: Detect malicious patterns in AI Agent skills — 13 detectors for backdoors, credential theft, data exfiltration, and supply-chain attacks. Based on SlowMist's ClawHub threat intelligence (472+ malicious skills). Pure Python, zero dependencies.4---5
6# Skill Security Audit
7
8Detect malicious patterns in installed Claude and OpenClaw skills. Based on SlowMist's analysis of 472+ malicious skills on ClawHub platform.
9
10## Triggers
11
12Use this skill when the user mentions: 安全审计, security audit, skill 检查, 技能安全, scan skills, supply chain security, 扫描技能, 恶意检测, malicious skill, skill 安全扫描
13
14## Quick Audit Workflow
15
16When the user requests a security audit, follow these 5 steps:
17
18### Step 1: Run the Scanner
19
20```bash
21python3 ~/.claude/skills/skill-security-audit/scripts/skill_audit.py
22```
23
24This auto-discovers and scans all skills in:
25- `~/.claude/skills/`
26- `~/.openclaw/workspace/skills/`
27- Extra directories from `~/.openclaw/openclaw.json` → `skills.load.extraDirs`
28
29### Step 2: Analyze Results
30
31Read the scanner output. Findings are grouped by skill and sorted by severity:
32
33| Severity | Meaning | Action Required |
34|----------|---------|----------------|
35| **CRITICAL** | Known malicious IOC match, credential theft, or download-and-execute | Immediate removal and credential rotation |
36| **HIGH** | Obfuscation, persistence mechanisms, privilege escalation | Manual review required, likely malicious |
37| **MEDIUM** | Suspicious patterns (Base64, network calls, high entropy) | Review context — may be legitimate |
38| **LOW** | Social engineering naming, informational | Note for awareness |
39
40### Step 3: Report to User
41
42Present findings in this format:
43
44```
45## Audit Summary
46- Skills scanned: N
47- Files scanned: N
48- CRITICAL: N | HIGH: N | MEDIUM: N | LOW: N
49
50## Critical/High Findings (if any)
51For each finding:
52- Skill name and file path
53- What was detected and why it's dangerous
54- Recommended action
55
56## Medium/Low Findings (if any)
57Brief summary, noting which are likely false positives
58```
59
60### Step 4: Recommend Actions
61
62For CRITICAL findings:
631. Read `references/remediation-guide.md` for incident response steps
642. Guide user through credential rotation if credential theft was detected
653. Help quarantine the malicious skill
66
67For HIGH findings:
681. Help user manually review the flagged code
692. Determine if the pattern is legitimate or malicious in context
70
71### Step 5: Follow Up
72
73- Offer to scan a specific skill in detail: `python3 skill_audit.py --path /path/to/skill`
74- Offer to explain any finding in depth using `references/threat-patterns.md`
75
76## Scanner Command Reference
77
78```bash
79# Scan all discovered skills
80python3 ~/.claude/skills/skill-security-audit/scripts/skill_audit.py
81
82# Scan a single skill directory
83python3 ~/.claude/skills/skill-security-audit/scripts/skill_audit.py --path /path/to/skill
84
85# JSON output (for programmatic use)
86python3 ~/.claude/skills/skill-security-audit/scripts/skill_audit.py --json
87
88# Filter by minimum severity
89python3 ~/.claude/skills/skill-security-audit/scripts/skill_audit.py --severity high
90
91# Disable colored output
92python3 ~/.claude/skills/skill-security-audit/scripts/skill_audit.py --no-color
93
94# Use custom IOC database
95python3 ~/.claude/skills/skill-security-audit/scripts/skill_audit.py --ioc-db /path/to/ioc.json
96```
97
98**Exit codes:** 0 = clean, 1 = low/medium risk, 2 = high risk, 3 = critical, 4 = scanner error
99
100## 13 Detection Categories
101
102| Detector | What It Finds | Severity |
103|----------|--------------|----------|
104| Base64Detector | Encoded strings >50 chars (excluding data:image) | MEDIUM→HIGH |
105| DownloadExecDetector | curl\|bash, wget\|sh, fetch+eval patterns | CRITICAL |
106| IOCMatchDetector | Known malicious IPs, domains, URLs, file hashes | CRITICAL |
107| ObfuscationDetector | eval/exec with non-literal args, hex encoding, chr() chains | HIGH |
108| ExfiltrationDetector | ZIP+upload combos, sensitive directory enumeration | HIGH |
109| CredentialTheftDetector | osascript password dialogs, keychain access, SSH key reading | CRITICAL |
110| PersistenceDetector | crontab, launchd, systemd, shell profile modification | HIGH |
111| PostInstallHookDetector | npm postinstall, pip setup.py cmdclass | HIGH→CRITICAL |
112| HiddenCharDetector | Zero-width characters, Unicode bidi overrides | MEDIUM |
113| EntropyDetector | Shannon entropy >5.5 on long lines | MEDIUM |
114| SocialEngineeringDetector | crypto/wallet/airdrop/security-update naming | LOW→MEDIUM |
115| NetworkCallDetector | socket, http, urllib, requests, fetch, curl, wget | MEDIUM |
116| PrivilegeEscalationDetector | sudo, chmod 777, setuid, admin group modification | HIGH |
117
118## Understanding Confidence Scores
119
120Each finding includes a confidence score (0-100):
121- **80-100**: Very likely a genuine threat
122- **50-79**: Suspicious, manual review recommended
123- **30-49**: Possible false positive, check context
124- **<30**: Informational, low confidence
125
126## Manual Review Checklist
127
128When the scanner flags something, also check:
129
1301. **Source verification** — Is the skill from an official/verified source? Check author reputation.
1312. **Permission scope** — Does the skill request more permissions than its stated functionality needs?
1323. **Script audit** — Read all `.sh`, `.py`, `.js` files. Look for obfuscation, unexpected network calls.
1334. **Dependency check** — Run `npm audit` or `pip-audit` if the skill has package dependencies.
1345. **Changelog review** — Were suspicious changes introduced in a recent update?
135
136## Updating the IOC Database
137
138The IOC database is at `scripts/ioc_database.json`. To add new indicators:
139
1401. Edit the JSON file following the existing schema
1412. Run the scanner to verify your new IOCs are detected
1423. Update `references/ioc-database.md` to keep the human-readable version in sync
143
144## Reference Documents
145
146For detailed information, read these files as needed:
147- `references/ioc-database.md` — Full IOC list with context and attribution
148- `references/threat-patterns.md` — 9 attack patterns in detail (two-stage payload, Base64 backdoor, password phishing, etc.)
149- `references/remediation-guide.md` — Step-by-step incident response (quarantine, credential rotation, persistence cleanup, reporting)