Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Detects early-stage ransomware indicators in network traffic before encryption begins, including initial access broker activity, command-and-control beaconing, credential harvesting, reconnaissance scanning, and staging behavior. Uses network detection tools (Zeek, Suricata, Arkime), SIEM correlation rules, and threat intelligence feeds to identify ransomware precursor patterns such as Cobalt Strike beacons, Mimikatz network signatures, and RDP brute-force attempts. Activates for requests involving pre-ransomware detection, network-based ransomware indicators, or early warning ransomware monitoring.
.claude/skills/detecting-ransomware-precursors-in-network/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-15 | ✗→✓ | ▲ Improved | — | — |
| case-09 | ✗→✓ | ▲ Improved | — | — |
| case-07 | ✗→✓ | ▲ Improved | — | — |
| case-02 | ✗→✓ | ▲ Improved | — | — |
| case-19 | ✗→✓ | ▲ Improved | — | — |
Do not use for post-encryption response (see recovering-from-ransomware-attack). This skill focuses on the pre-encryption detection window where containment can prevent data loss.
Map network-observable indicators to each pre-encryption phase:
| Kill Chain Phase | Network Indicators | Detection Source | |------------------|--------------------|------------------| | Initial Access | RDP brute force, VPN credential stuffing, phishing callback | Firewall logs, IDS, proxy logs | | C2 Establishment | Cobalt Strike beacons (HTTPS/DNS), Sliver/Brute Ratel callbacks | Zeek SSL/HTTP logs, DNS logs | | Credential Harvesting | NTLM relay, Kerberoasting, DCSync traffic | Zeek Kerberos/NTLM logs, DC logs | | Reconnaissance | Internal port scanning, AD enumeration (LDAP/SMB) | Zeek conn.log, flow data | | Lateral Movement | PsExec/WMI/WinRM traffic, RDP pivoting, SMB file copies | Zeek SMB/DCE-RPC logs | | Staging | Data aggregation, archive creation, cloud upload prep | Proxy logs, DNS logs, DLP |
Suricata rules for common ransomware precursors:
yaml# Cobalt Strike default HTTPS beacon profile detection alert tls $HOME_NET any -> $EXTERNAL_NET any (msg:"RANSOMWARE PRECURSOR - Cobalt Strike Default TLS Certificate"; tls.cert_subject; content:"Major Cobalt Strike"; sid:3000001; rev:1;) # Cobalt Strike DNS beacon alert dns $HOME_NET any -> any 53 (msg:"RANSOMWARE PRECURSOR - Cobalt Strike DNS Beacon Pattern"; dns.query; pcre:"/^[a-z0-9]{3}\.[a-z]{4,8}\./"; threshold:type both, track by_src, count 50, seconds 60; sid:3000002; rev:1;) # Mimikatz network signature (DCSync - DRS GetNCChanges) alert tcp $HOME_NET any -> $HOME_NET 135 (msg:"RANSOMWARE PRECURSOR - Possible DCSync/Mimikatz"; content:"|05 00 0b|"; offset:0; depth:3; content:"|e3 51 4d 2b 4b 47 15 d2|"; sid:3000003; rev:1;) # Internal network scanning (many connections, few bytes) alert tcp $HOME_NET any -> $HOME_NET any (msg:"RANSOMWARE PRECURSOR - Internal Port Scan"; flags:S; threshold:type both, track by_src, count 100, seconds 10; sid:3000004; rev:1;) # PsExec service installation over SMB alert tcp $HOME_NET any -> $HOME_NET 445 (msg:"RANSOMWARE PRECURSOR - PsExec Service Install"; content:"|ff|SMB"; content:"PSEXESVC"; nocase; sid:3000005; rev:1;) # RDP brute force from internal host (lateral movement) alert tcp $HOME_NET any -> $HOME_NET 3389 (msg:"RANSOMWARE PRECURSOR - Internal RDP Brute Force"; flow:to_server,established; threshold:type both, track by_src, count 20, seconds 60; sid:3000006; rev:1;) # Large SMB file transfer (data staging) alert tcp $HOME_NET any -> $HOME_NET 445 (msg:"RANSOMWARE PRECURSOR - Large SMB Transfer Possible Staging"; flow:to_server,established; dsize:>60000; threshold:type both, track by_src, count 100, seconds 300; sid:3000007; rev:1;)
Zeek scripts for behavioral detection:
zeek# detect_ransomware_precursors.zeek # Detect high volume of failed SMB connections (credential testing) @load base/protocols/smb module RansomwarePrecursor; export { redef enum Notice::Type += { SMB_Brute_Force, Suspicious_Internal_Scan, Excessive_DNS_Queries, SMB_Admin_Share_Access, }; const smb_fail_threshold = 10 &redef; const scan_threshold = 50 &redef; const dns_query_threshold = 200 &redef; } global smb_fail_count: table[addr] of count &default=0 &create_expire=5min; global conn_count: table[addr] of set[addr] &create_expire=1min; event smb2_message(c: connection, hdr: SMB2::Header, is_orig: bool) { if (hdr$status != 0) { ++smb_fail_count[c$id$orig_h]; if (smb_fail_count[c$id$orig_h] >= smb_fail_threshold) { NOTICE([$note=SMB_Brute_Force, $msg=fmt("Host %s has %d failed SMB attempts", c$id$orig_h, smb_fail_count[c$id$orig_h]), $src=c$id$orig_h, $identifier=cat(c$id$orig_h)]); } } } event new_connection(c: connection) { if (c$id$orig_h in Site::local_nets && c$id$resp_h in Site::local_nets) { if (c$id$orig_h !in conn_count) conn_count[c$id$orig_h] = set(); add conn_count[c$id$orig_h][c$id$resp_h]; if (|conn_count[c$id$orig_h]| >= scan_threshold) { NOTICE([$note=Suspicious_Internal_Scan, $msg=fmt("Host %s connected to %d internal hosts in 1 min", c$id$orig_h, |conn_count[c$id$orig_h]|), $src=c$id$orig_h, $identifier=cat(c$id$orig_h)]); } } }
Splunk correlation for ransomware precursor chain:
spl| tstats count FROM datamodel=Network_Traffic WHERE earliest=-24h All_Traffic.dest_port IN (445, 135, 139, 3389, 5985, 5986) AND All_Traffic.src_ip IN 10.0.0.0/8 AND All_Traffic.dest_ip IN 10.0.0.0/8 BY All_Traffic.src_ip, All_Traffic.dest_port, _time span=1h | stats dc(All_Traffic.dest_port) as port_count, values(All_Traffic.dest_port) as ports, count as total_conns BY All_Traffic.src_ip | where port_count >= 3 AND total_conns > 50 | rename All_Traffic.src_ip as src_ip | lookup threat_intel_ioc ip as src_ip OUTPUT threat_type | eval risk_score = case( port_count >= 5 AND total_conns > 200, "CRITICAL", port_count >= 3 AND total_conns > 50, "HIGH", 1=1, "MEDIUM") | table src_ip, ports, port_count, total_conns, risk_score, threat_type
Microsoft Sentinel KQL - Ransomware precursor correlation:
kqllet timeframe = 24h; let RDPBruteForce = SecurityEvent | where TimeGenerated > ago(timeframe) | where EventID == 4625 | where LogonType == 10 | summarize FailedRDP = count() by TargetAccount, IpAddress, bin(TimeGenerated, 1h) | where FailedRDP > 10; let SuspiciousSMB = SecurityEvent | where TimeGenerated > ago(timeframe) | where EventID == 5145 | where ShareName has "ADMIN$" or ShareName has "C$" or ShareName has "IPC$" | summarize AdminShareAccess = count() by SubjectUserName, IpAddress, bin(TimeGenerated, 1h) | where AdminShareAccess > 5; let ServiceInstalls = SecurityEvent | where TimeGenerated > ago(timeframe) | where EventID == 7045 | where ServiceName has_any ("PSEXESVC", "meterpreter", "beacon"); RDPBruteForce | join kind=inner SuspiciousSMB on IpAddress | project TimeGenerated, IpAddress, TargetAccount, FailedRDP, SubjectUserName, AdminShareAccess | extend AlertTitle = "Ransomware Precursor: RDP Brute Force + Admin Share Access"
Configure automated IOC feeds for known ransomware infrastructure:
bash# Download and update ransomware C2 blocklists # abuse.ch Feodo Tracker (Cobalt Strike, TrickBot, BazarLoader C2s) curl -s https://feodotracker.abuse.ch/downloads/ipblocklist.csv | \ grep -v "^#" | cut -d, -f2 > /opt/threat-intel/feodo_ips.txt # abuse.ch URLhaus (malware distribution URLs) curl -s https://urlhaus.abuse.ch/downloads/csv_recent/ | \ grep -v "^#" | cut -d, -f3 > /opt/threat-intel/urlhaus_urls.txt # abuse.ch ThreatFox (ransomware IOCs) curl -s https://threatfox.abuse.ch/export/csv/recent/ | \ grep -i "ransomware" | cut -d, -f3 > /opt/threat-intel/ransomware_iocs.txt # CISA Known Exploited Vulnerabilities (initial access vectors) curl -s https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json | \ python3 -c "import json,sys; data=json.load(sys.stdin); [print(v['cveID'],v['vendorProject'],v['product']) for v in data['vulnerabilities'] if 'ransomware' in v.get('knownRansomwareCampaignUse','').lower()]"
Define triage procedures based on precursor confidence level:
| Alert Type | Confidence | Response Time | Action | |------------|-----------|---------------|--------| | Confirmed Cobalt Strike beacon | High | 15 minutes | Isolate host immediately, trigger IR | | DCSync/Kerberoasting from non-DC | High | 15 minutes | Disable account, isolate host, trigger IR | | Internal port scan + admin share access | Medium-High | 30 minutes | Investigate source host, check EDR telemetry | | RDP brute force from internal host | Medium | 1 hour | Verify if legitimate admin activity, check host | | Unusual DNS query volume | Low-Medium | 4 hours | Check for DNS tunneling, correlate with other alerts |
| Term | Definition | |------|------------| | Ransomware Precursor | Network activity that precedes ransomware encryption, including C2 communication, lateral movement, and data staging | | Dwell Time | Time between initial compromise and ransomware deployment, averaging 21 days but sometimes as short as 17 minutes | | Initial Access Broker (IAB) | Threat actors who sell compromised network access to ransomware operators on dark web markets | | Beaconing | Periodic C2 callbacks from implants (Cobalt Strike, Sliver) that can be detected by analyzing connection timing patterns | | Kerberoasting | Credential harvesting technique requesting Kerberos service tickets for offline cracking, detectable via unusual TGS-REQ patterns | | DCSync | Technique using Directory Replication Service to extract password hashes from domain controllers, critical ransomware precursor |
Context: A manufacturing company's SOC receives an alert for unusual SMB traffic from a workstation (10.1.5.42) in the engineering department. The workstation connected to 47 internal hosts on port 445 within 5 minutes at 2:00 AM.
Approach:
Pitfalls:
## Ransomware Precursor Detection Alert
**Alert ID**: [SIEM-generated ID]
**Detection Time**: [Timestamp]
**Source Host**: [IP / Hostname]
**Confidence**: [High / Medium / Low]
**Kill Chain Phase**: [Initial Access / C2 / Credential Harvest / Recon / Lateral Movement / Staging]
### Indicators Detected
| Indicator | Source | Detail | MITRE ATT&CK |
|-----------|--------|--------|--------------|
| [Type] | [Zeek/Suricata/SIEM] | [Description] | [T-ID] |
### Correlation Chain
1. [Timestamp] - [Event 1]
2. [Timestamp] - [Event 2]
3. [Timestamp] - [Event 3]
### Recommended Actions
- [ ] Isolate source host from network
- [ ] Check EDR telemetry for host-based indicators
- [ ] Reset credentials for affected user accounts
- [ ] Block identified C2 infrastructure
- [ ] Escalate to incident response team| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-12 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-01 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-23 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-18 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-03 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-08 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-10 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-14 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted, and 22 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +22 percentage points is the difference between those two pass rates over the 22 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
Other measured skills in the registry, with their headline benchmark lift.