Install
openclaw skills install @sdk-team/alibabacloud-mining-attack-diagnosisAlibaba Cloud Security Center cryptomining (cryptojacking) diagnosis skill. Use when the user reports or suspects a mining infection, receives a mining alert, or asks for mining alert detection, IOC extraction (pool IPs, malicious domains, sample hashes, malicious processes), affected-asset scoping, attack-surface analysis, entry-vector analysis, risk assessment, prioritized remediation reporting, cryptomining incident response, or mining risk detection. Triggers: "mining", "cryptomining", "cryptojacking", "coin mining", "coin-mining", "miner", "mining alert", "mining alerts", "mining pool", "pool IPs", "malicious domains", "sample hashes", "malicious processes", "mining IOC", "IOC extraction", "mining alert detection", "affected-asset scoping", "attack-surface analysis", "entry-vector analysis", "risk assessment", "prioritized remediation reporting", "cryptomining incident response", "mining risk detection", "xmrig", "kdevtmpfsi", "kinsing", "sysrv", "minerd", "Security Center", "ECS high CPU mining"
openclaw skills install @sdk-team/alibabacloud-mining-attack-diagnosisscripts/mining_investigation.py. Do NOT hand-write bash/python, do NOT issue individual aliyun CLI calls, do NOT skip any step. If the script fails or times out, re-run it once before falling back — never abandon the 6-step SOP. The entry script internally invokes every Step 1–4 API (DescribeSuspEvents, DescribeAlarmEventDetail, DescribeSuspEventDetail, DescribeSecurityStatInfo, DescribeFieldStatistics, DescribeExposedInstanceList, DescribeVulList) regardless of intermediate results, and auto-retries transient ServiceUnavailable/Throttling/InternalError responses — so you must not pre-empt or short-circuit it with ad-hoc calls.Update*/Delete*/Disable*/Modify*/Create*/Rotate*/Set*/Operate*) — e.g. OperateSuspiciousTargetBatch, ModifySecurityGroupRule, DeleteInstance. This includes scripts "for the user to run manually". If the user asks to quarantine/kill/isolate, only output the manual remediation workflow and declare this skill is read-only.[WARN] <error> to stderr and continue to the next step — never silently skip. On Forbidden/NoPermission, record the missing permission and continue. On empty results, set fields to N/A and proceed. On transient errors (ServiceUnavailable/Throttling/InternalError), the entry script retries automatically — do not conclude "service down" from a single failed call.sts:GetCallerIdentity (the entry script does this when --account is omitted), use the default region cn-hangzhou, state the derivation explicitly in your reply and in the report metadata ("account auto-derived via STS"), then run the full investigation. Only ask a brief clarifying question when the request is too ambiguous to determine the product or investigation goal at all. Never fabricate findings in either path.This skill implements a standard 6-step operating procedure for Alibaba Cloud cryptomining (cryptojacking) detection and diagnosis. It detects mining alerts via Security Center (SAS), extracts Indicators of Compromise (IOCs) from alert detail, scopes the affected assets, detects the attack surface (exposed assets
This skill is strictly read-only — it never performs containment, quarantine, process termination, host isolation, or any handling/mutating action. When mining is confirmed it prints a prominent URGENT banner telling the operator to remediate manually.
Mining Attack Detection & Diagnosis — SAS Public API
|
v
+-----------------------------------------------+
| Step 1: Mining Alert Detection |
| Action: SAS DescribeSuspEvents |
| Filter: mining keywords (xmrig/mining-pool/...) |
| Output: mining alerts, affected assets, level |
+-----------------------------------------------+
|
v
+-----------------------------------------------+
| Step 2: Alert Detail & IOC Extraction |
| Action: DescribeAlarmEventDetail / |
| DescribeSuspEventDetail |
| Output: pool IPs/domains, sample MD5/SHA256, |
| malicious process/command indicators |
+-----------------------------------------------+
|
v
+-----------------------------------------------+
| Step 3: Affected Asset Scope |
| Group alerts by asset (uuid/name/IP) |
| + DescribeSecurityStatInfo / FieldStatistics |
| Output: blast radius, spread assessment |
+-----------------------------------------------+
|
v
+-----------------------------------------------+
| Step 4: Attack Surface Detection |
| Action: DescribeExposedInstanceList + |
| DescribeVulList (asap) |
| Output: likely intrusion entry vector |
+-----------------------------------------------+
|
v
+-----------------------------------------------+
| Step 5: Risk Assessment |
| Severity, handled status, spread, entry |
+-----------------------------------------------+
|
v
+-----------------------------------------------+
| Step 6: Handling & Remediation Report |
| IOC table + affected assets + attack surface |
| + P0-P3 prioritized remediation + conclusion |
| Read-only; URGENT banner if mining confirmed |
+-----------------------------------------------+
| User Intent | Action |
|---|---|
| Step 1: Detect mining alerts | Read references/module1_alert_detection.md |
| Step 2: Extract IOCs from an alert | Read references/module2_alert_detail_ioc.md |
| Step 3: Scope affected assets | Read references/module3_affected_assets.md |
| Step 4: Detect attack surface / entry vector | Read references/module4_attack_surface.md |
| Step 6: Remediation guidance | Read references/module5_remediation_best_practices.md |
| Mining keyword / IOC reference | Read references/mining_indicators.md |
| End-to-end runtime flow | Read references/detection_flow.md |
brew install aliyun-cli # macOS; see https://help.aliyun.com/document_detail/121541.html
aliyun configure # stored in ~/.aliyun/config.json
Credentials are resolved automatically from the aliyun CLI profile
(~/.aliyun/config.json). The scripts never handle or print secrets.
# Run the investigation
python scripts/mining_investigation.py --account <UID>
# Select a specific profile
python scripts/mining_investigation.py --account <UID> --profile prod
All scripts support --help. Common parameters:
--account <UID> — Alibaba Cloud account UID (optional; auto-derived, report label only)--days <N> — Lookback window in days (default 30)--region <REGION> — Alibaba Cloud region (default: cn-hangzhou)--format json|markdown — Report format--output <path> — Output file (default: output/mining_report.md)Additional pass-through options: --dealed Y|N|all, --profile <name>
(see references/detection_flow.md).
All API calls made by this skill include a User-Agent header for
platform-level tracing:
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-mining-attack-diagnosis/{session-id}
A session-id is a 32-character hex string auto-generated per invocation and
attached to every request in the same investigation run; it is logged to
stderr at the start of execution and included in the report metadata.
MANDATORY OUTPUT FORMAT: The report MUST follow this structure exactly. When mining is confirmed, the URGENT banner MUST appear at the top. The Conclusion MUST include the full 4-phase remediation workflow (Phase 1: Preserve & Access → Phase 2: Eradicate & Isolate → Phase 3: Harden → Phase 4: Verify & Recover). Partial or truncated output is forbidden.
Step 6 produces a report with:
If Security Center returns no mining-matching alerts, report truthfully that no mining compromise is indicated for the window. Never invent alerts, affected assets, or IOCs to "complete" a conclusion, and do not print the URGENT banner in that case.
_cli.mask_sensitive(). Set MINING_NO_MASK=1 to
emit raw values.| Script | Type | Description |
|---|---|---|
scripts/mining_investigation.py | Entry | 6-step detection & diagnosis orchestrator |
Standalone step scripts (scripts/query_*.py) and internal modules
(scripts/_cli.py, scripts/_constants.py) are invoked by the entry script;
do not run them directly.
On any error, log [WARN] <error> to stderr and continue to the next step
— never silently skip a step or abort the investigation. Transient errors
(ServiceUnavailable/Throttling/InternalError) are auto-retried by the
entry script; permission/parameter errors degrade gracefully with the failed
step recorded in the report. Full error table: see Absolute Rule #4 and
references/detection_flow.md.