detecting-cryptomining-in-cloud
Enables your agent to identify unauthorized cryptocurrency mining in cloud environments by analyzing resource usage and traffic.
What it does
This tool helps find suspicious cryptocurrency mining activity on your cloud systems. It looks for signs like unexpected spending, unusual network traffic, and strange processes running.
When to use it
- ✓When your cloud bill shows a sudden increase in costs.
- ✓When an alert indicates cryptocurrency mining activity.
- ✓When investigating if your access credentials were misused.
Example of what to ask your AI
“Check for unauthorized cryptocurrency mining in my cloud account.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
It works by monitoring resource usage, like processing and network, and comparing it to known mining patterns. If something suspicious is found, it alerts you.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill detecting-cryptomining-in-cloudOr download just the file:
curl -L https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/main/skills/detecting-cryptomining-in-cloud/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
Detecting Cryptomining in Cloud
When to Use
- When cloud billing alerts indicate unexpected compute cost spikes
- When GuardDuty generates CryptoCurrency or Impact finding types
- When investigating compromised IAM credentials that may be used to launch mining instances
- When monitoring container workloads for unauthorized process execution
- When establishing proactive detection controls against resource hijacking attacks
Do not use for legitimate cryptocurrency mining operations, for non-cloud mining detection on physical hardware, or for general malware analysis unrelated to mining activity.
Prerequisites
- Amazon GuardDuty enabled with Runtime Monitoring for EC2, ECS, and EKS
- CloudWatch or Azure Monitor configured for compute utilization alerting
- VPC Flow Logs enabled for network traffic analysis to mining pool IPs
- AWS Cost Anomaly Detection or Azure Cost Management alerts configured
Workflow
Step 1: Establish Detection Through Multiple Signals
Deploy detection across four signal categories: cost anomalies, compute utilization, network traffic, and runtime processes.
# AWS Cost Anomaly Detection
aws ce create-anomaly-monitor \
--anomaly-monitor '{
"MonitorName": "EC2CostSpike",
"MonitorType": "DIMENSIONAL",
"MonitorDimension": "SERVICE"
}'
aws ce create-anomaly-subscription \
--anomaly-subscription '{
"SubscriptionName": "CryptoMiningAlert",
"MonitorArnList": ["arn:aws:ce::123456789012:anomalymonitor/monitor-id"],
"Subscribers": [{"Address": "security@company.com", "Type": "EMAIL"}],
"Threshold": 50.0,
"Frequency": "IMMEDIATE"
}'
# CloudWatch alarm for CPU utilization spike
aws cloudwatch put-metric-alarm \
--alarm-name HighCPUUtilization \
--namespace AWS/EC2 \
--metric-name CPUUtilization \
--statistic Average \
--period 300 \
--threshold 90 \
--comparison-operator GreaterThanThreshold \
--evaluation-periods 3 \
--alarm-actions "arn:aws:sns:us-east-1:123456789012:security-alerts"
Step 2: Monitor GuardDuty CryptoCurrency Findings
Configure alerting for GuardDuty findings specific to cryptocurrency mining activity on EC2, ECS, and EKS workloads.
Key GuardDuty finding types for cryptomining:
CryptoCurrency:EC2/BitcoinTool.B- Network connections to crypto-related domainsCryptoCurrency:Runtime/BitcoinTool.B- Runtime detection of mining process executionImpact:EC2/BitcoinTool.B- EC2 instance communicating with known Bitcoin mining poolsImpact:Runtime/CryptoMinerExecuted- Crypto mining binary execution detected by runtime agent
# EventBridge rule for cryptocurrency findings
aws events put-rule \
--name CryptoMiningDetection \
--event-pattern '{
"source": ["aws.guardduty"],
"detail-type": ["GuardDuty Finding"],
"detail": {
"type": [
{"prefix": "CryptoCurrency:"},
{"prefix": "Impact:EC2/BitcoinTool"},
{"prefix": "Impact:Runtime/CryptoMiner"}
]
}
}'
# Auto-remediation Lambda for crypto findings
aws events put-targets \
--rule CryptoMiningDetection \
--targets '[{
"Id": "CryptoAutoRemediate",
"Arn": "arn:aws:lambda:us-east-1:123456789012:function/crypto-remediate"
}]'
Step 3: Analyze Network Traffic for Mining Pool Connections
Monitor VPC Flow Logs and DNS queries for connections to known cryptocurrency mining pools operating on common ports (3333, 4444, 5555, 8333, 9999, 14444).
// Sentinel KQL query for mining pool connections
AzureNetworkAnalytics_CL
| where TimeGenerated > ago(24h)
| where DestPort_d in (3333, 4444, 5555, 8333, 9999, 14444, 14433, 45700)
| summarize ConnectionCount = count(), BytesSent = sum(BytesSent_d)
by SrcIP_s, DestIP_s, DestPort_d, bin(TimeGenerated, 1h)
| where ConnectionCount > 10
| project TimeGenerated, SrcIP_s, DestIP_s, DestPort_d, ConnectionCount, BytesSent
# AWS Athena query for VPC Flow Logs mining pool detection
cat << 'EOF' > mining-detection.sql
SELECT srcaddr, dstaddr, dstport, protocol,
COUNT(*) as connection_count,
SUM(bytes) as total_bytes
FROM vpc_flow_logs
WHERE dstport IN (3333, 4444, 5555, 8333, 9999, 14444)
AND action = 'ACCEPT'
AND start >= date_add('hour', -24, now())
GROUP BY srcaddr, dstaddr, dstport, protocol
HAVING COUNT(*) > 10
ORDER BY connection_count DESC
EOF
Step 4: Detect Mining in Container Environments
…
FAQ
What is cryptocurrency mining?
It's the process of using computers to solve complex problems and validate cryptocurrency transactions, which earns rewards. However, it can be done without permission on others' systems.
Why is unauthorized mining a problem?
It consumes computing resources (power, processing) without permission, increasing costs and potentially making systems slower or unstable.
Do I need to be a security expert to use this?
No, the tool is designed to be understood and used even by those without deep computer security experience.
Details
Original description by the author
This skill teaches security teams how to detect and respond to unauthorized cryptocurrency mining operations in cloud environments. It covers identifying cryptomining indicators through compute usage anomalies, network traffic patterns to mining pools, GuardDuty CryptoCurrency findings, and runtime process monitoring on EC2, ECS, EKS, and Azure Automation workloads. '
Popularity
- GitHub stars
- 35k
- Ranking position
- #5654
- License
- Apache-2.0
- Updated
- 8/31/2026
Comments
- …
More skills from this repository
abusing-dpapi-for-credential-access
Gives your AI agent ready-made instructions for a specific task, so it does it better and faster.
mukul975/Anthropic-Cybersecurity-Skills
abusing-shadow-credentials-for-privesc
Teaches your AI agent to write clear, well-structured text.
mukul975/Anthropic-Cybersecurity-Skills
achieving-cmmc-level-2-compliance
Helps your agent prepare an environment for CMMC Level 2 compliance. It implements security requirements and manages necessary documentation.
mukul975/Anthropic-Cybersecurity-Skills
acquiring-disk-image-with-dd-and-dcfldd
Helps your agent create exact copies of hard drives. This is useful for ensuring no information is lost or altered during investigations.
mukul975/Anthropic-Cybersecurity-Skills
Similar skills
agent-architecture-audit
Makes your agent check if everything is working correctly. It finds and fixes problems in AI systems, ensuring they perform as expected.
affaan-m/ECC
agent-eval
Helps your agent compare different AI coding tools. It measures which one is faster, cheaper, and more reliable for specific tasks.
affaan-m/ECC
agent-harness-construction
Makes your agent better understand how to perform tasks. It optimizes the tools and instructions the agent uses to increase its chances of success.
affaan-m/ECC