Hide Infrastructure
This detection identifies adversary attempts to conceal command and control infrastructure through domain masquerading, traffic filtering, and proxy chaining. Specific patterns include processes making DNS queries to domains that impersonate legitimate CDN or cloud providers (typosquatting or lookalike domains), unusual processes initiating connections through multi-hop proxy chains, beaconing to URL shorteners or marketing redirect services, and network connections where resolved IPs do not match the expected ASN for the queried domain. The detection targets techniques used by groups such as APT29 (residential proxy routing), Salt Typhoon (JumbledPath hop chains), and DarkGate (CDN masquerading) to extend the operational lifetime of C2 infrastructure by evading automated takedown and sandbox analysis.
What is T1665 Hide Infrastructure?
Hide Infrastructure (T1665) maps to the Command and Control tactic — the adversary is trying to communicate with compromised systems to control them in MITRE ATT&CK.
This page provides production-ready detection logic for Hide Infrastructure, covering the data sources and telemetry it touches: Microsoft Defender for Endpoint. The queries below are rated high severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.
MITRE ATT&CK
- Tactic
- Command and Control
- Technique
- T1665 Hide Infrastructure
- Canonical reference
- https://attack.mitre.org/techniques/T1665/
let SuspiciousProcesses = dynamic(["powershell.exe", "cmd.exe", "wscript.exe", "cscript.exe", "mshta.exe", "regsvr32.exe", "rundll32.exe", "bitsadmin.exe", "certutil.exe", "curl.exe", "wget.exe"]);
let LegitCDNSuffixes = dynamic(["akamaized.net", "akamai.net", "cloudfront.net", "amazonaws.com", "cloudflare.com", "azureedge.net", "fastly.net", "cdn.microsoft.com"]);
let URLShorteners = dynamic(["bit.ly", "tinyurl.com", "t.co", "ow.ly", "short.io", "rebrand.ly", "cutt.ly", "is.gd", "buff.ly"]);
// Branch 1: Typosquatted CDN/cloud domain DNS queries from suspicious processes
let Branch1 = DeviceNetworkEvents
| where TimeGenerated > ago(1d)
| where ActionType == "ConnectionSuccess"
| where isnotempty(RemoteUrl)
| extend DomainLower = tolower(RemoteUrl)
| where (
DomainLower matches regex @"(amaz0n|m1crosoft|g00gle|g0ogle|akama1|cloudfl4re|cdnn\.|c1oudfront|fastIy|micros0ft|arnazon)" or
(DomainLower has_any ("akamai", "cloudfront", "amazonaws", "fastly", "azureedge") and not(DomainLower has_any (LegitCDNSuffixes)))
)
| where InitiatingProcessFileName has_any (SuspiciousProcesses)
| extend DetectionBranch = "TyposquattedCDN"
| project TimeGenerated, DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine, RemoteUrl, RemoteIP, RemotePort, DetectionBranch;
// Branch 2: Suspicious process connecting through URL shortener/redirect service
let Branch2 = DeviceNetworkEvents
| where TimeGenerated > ago(1d)
| where ActionType == "ConnectionSuccess"
| where isnotempty(RemoteUrl)
| where RemoteUrl has_any (URLShorteners)
| where InitiatingProcessFileName has_any (SuspiciousProcesses)
| extend DetectionBranch = "URLShortenerC2"
| project TimeGenerated, DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine, RemoteUrl, RemoteIP, RemotePort, DetectionBranch;
// Branch 3: High-frequency beaconing to same IP from scripting engine (interval-based C2 pattern)
let Branch3 = DeviceNetworkEvents
| where TimeGenerated > ago(1d)
| where ActionType == "ConnectionSuccess"
| where InitiatingProcessFileName has_any (SuspiciousProcesses)
| where RemoteIPType == "Public"
| summarize ConnectionCount = count(), DistinctPorts = dcount(RemotePort), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated), SampleUrl = any(RemoteUrl) by DeviceName, RemoteIP, InitiatingProcessFileName
| where ConnectionCount >= 20 and DistinctPorts <= 2
| extend BeaconDuration = datetime_diff('minute', LastSeen, FirstSeen)
| where BeaconDuration > 30
| extend DetectionBranch = "BeaconingPattern"
| project FirstSeen, DeviceName, InitiatingProcessFileName, RemoteIP, SampleUrl, ConnectionCount, BeaconDuration, DetectionBranch;
union Branch1, Branch2, Branch3
| sort by TimeGenerated desc Detects three patterns of C2 infrastructure hiding: (1) connections to typosquatted or lookalike CDN/cloud domains initiated by suspicious scripting processes, (2) suspicious processes communicating through URL shortener redirect chains, and (3) high-frequency beaconing from scripting engines to a single public IP suggesting interval-based C2 check-in. Covers DarkGate CDN masquerading, APT29 residential proxy patterns, and generic staging redirector abuse.
Data Sources
Required Tables
False Positives
- Legitimate software updaters or telemetry agents that use CDN-like domain naming conventions for load distribution
- IT automation scripts (Ansible, Chef, Puppet) that download packages from CDN mirrors with non-standard naming
- URL shorteners used legitimately by collaboration tools (Slack, Teams bot integrations) where the bot process may be PowerShell-based
- Security scanning tools or red team infrastructure that intentionally mimic CDN domains for authorized testing
- High-frequency health checks from monitoring agents to a fixed endpoint that produce beaconing-like patterns
Sigma rule & cross-platform mapping
The detection logic for Hide Infrastructure (T1665) above is provided in a vendor-neutral
form so you can deploy it on any SIEM. The same logic is shipped here as native
KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the
following logsource:
logsource:
category: network_connection
product: windows Browse the community-maintained Sigma rules for this technique:
Platform-specific guides for T1665
Testing Methodology
Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1CDN Masquerading DNS Query from PowerShell
Expected signal: Sysmon Event ID 22 (DNS query) for each domain queried, with Image pointing to powershell.exe and the QueryName field containing each CDN-lookalike domain. Also generates Sysmon Event ID 1 for the PowerShell process creation.
- Test 2URL Shortener C2 Redirect Simulation
Expected signal: Sysmon Event ID 1 for cmd.exe spawning powershell.exe (suspicious process chain), Sysmon Event ID 22 for DNS queries to bit.ly and tinyurl.com, Sysmon Event ID 3 for outbound TCP connections to those domains on port 443.
- Test 3SOCKS Proxy Tunnel Creation via SSH Dynamic Forwarding
Expected signal: Sysmon Event ID 1 for ssh.exe with CommandLine containing '-D 1080' dynamic forwarding argument. Sysmon Event ID 3 for attempted TCP connection to localhost:2222. Security Event ID 4688 if process creation auditing is enabled.
- Test 4High-Frequency Beacon Simulation from Scripting Engine
Expected signal: 25 Sysmon Event ID 3 entries for outbound TCP connections from powershell.exe to the same destination IP on port 443, with consistent 2-second intervals visible in event timestamps. Sysmon Event ID 1 for powershell.exe process creation.
Response Playbook
Triage
- Step 1: Identify the initiating process full path, parent process, and command line from the alert. Determine if the binary is signed by a trusted vendor (check InitiatingProcessSHA256 against VirusTotal or internal trust store).
- Step 2: Resolve the flagged domain independently from an isolated analyst workstation or sandbox. Check the resolved IP's ASN — if it resolves to a residential ISP or hosting provider inconsistent with the claimed CDN brand, treat as high confidence.
- Step 3: Pull all network connections from the same endpoint over the past 72 hours. Use DeviceNetworkEvents filtered to the same InitiatingProcessId to identify the full communication pattern — look for SOCKS proxy chains, multiple hop IPs, or consistent beacon intervals.
- Step 4: Check if the flagged domain was recently registered (WHOIS lookup). CDN masquerading domains used for C2 are often registered within 30 days of first contact. Compare registration date against first observed connection timestamp.
- Step 5: Examine the HTTP(S) response content if available in proxy logs or CommonSecurityLog. Legitimate CDN responses have consistent cache headers, ETag patterns, and content-type distributions. C2 traffic often returns minimal or encoded content.
- Step 6: Cross-reference the destination IP against threat intelligence feeds (MISP, VirusTotal, Shodan). Check if the IP is tagged as TOR exit, residential proxy, or previously associated with known threat actors.
- Step 7: Review the user context — was the process launched interactively or as a scheduled task/service? Check for corresponding Windows Event ID 4688 (process creation) around the same timestamp to confirm process lineage.
Containment
- Block the flagged domain and resolved IP at the perimeter firewall and DNS sinkhole. Document the block with timestamp for change management.
- If beaconing is confirmed, isolate the endpoint from the network using EDR isolation feature while preserving forensic state (do not power off).
- Disable or suspend any scheduled tasks, services, or autorun entries associated with the suspicious process until investigation is complete.
- If the process is a known legitimate binary (living-off-the-land), block its outbound network access specifically using application-layer firewall rules rather than killing the process.
- For URL shortener C2 patterns, block the specific shortener domain at the DNS level if other high-confidence indicators are present, but note this may affect legitimate users — coordinate with IT before broad block.
Evidence Collection
- Collect full process memory dump of the suspicious process using procdump or EDR memory acquisition before isolating the endpoint.
- Export complete DNS query history from the endpoint's DNS client cache (ipconfig /displaydns) and from enterprise DNS server logs for the affected host.
- Capture all TLS/SSL certificates presented by the flagged destination using openssl s_client or PCAP analysis — compare Subject CN, SANs, and issuer chain against legitimate CDN certificates.
- Collect endpoint logs: Windows Event Log (Security, System, Application), Sysmon EVTX, PowerShell Script Block logs (Event ID 4104), and Windows Defender scan history.
- Export network flow data (NetFlow/IPFIX) for the past 7 days from the affected endpoint's subnet to identify lateral movement or additional C2 channels.
- Preserve disk image or at minimum collect the suspicious binary, any dropped files in temp directories (%TEMP%, %APPDATA%, C:\Windows\Temp), and browser extension directories if the process was browser-related.
- If proxy logs are available (Zscaler, Squid, Bluecoat), pull the full HTTP request/response headers for all connections to the flagged domain to identify User-Agent strings used and response patterns.
Escalation Criteria
- ! Escalate immediately if the destination IP is confirmed in threat intelligence as associated with a known nation-state actor (APT29, Salt Typhoon, ZIRCONIUM) or active malware campaign.
- ! Escalate if evidence of lateral movement is found — additional endpoints connecting to the same C2 infrastructure or same process executing on multiple hosts within the environment.
- ! Escalate if credential access indicators are present alongside the C2 activity (LSASS access, SAM database reads, Kerberoasting events) suggesting post-exploitation activity.
- ! Escalate if the suspicious process has written new files to persistent locations (HKCU/HKLM Run keys, Startup folder, scheduled tasks) confirming the adversary has established persistence.
- ! Escalate if the beaconing destination IP is within the same geographic region as the victim organization's IP ranges, suggesting residential proxy ORB network usage designed to blend with legitimate traffic.
Investigation Guide
Forensic Artifacts
- >
DNS cache entries (C:\Windows\System32\drivers\etc\hosts, ipconfig /displaydns output) - >
Browser history and cached certificates for HTTPS connections to masquerading domains - >
Windows Prefetch files for the suspicious process binary (C:\Windows\Prefetch\*.pf) - >
PowerShell command history (~\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt) - >
Scheduled task XML definitions (C:\Windows\System32\Tasks\) - >
Network connection artifacts in NTUSER.DAT registry hive (TypedURLs, recently accessed network paths) - >
TLS/SSL session data in Windows CryptAPI logs or third-party SSL inspection proxy logs - >
Process creation events (Security Event ID 4688 with command line auditing enabled, or Sysmon Event ID 1) - >
Sysmon Event ID 22 (DNS query) logs showing full query history with process association - >
Memory artifacts: imported function tables showing socket API calls (WSAConnect, connect, getaddrinfo)
Tuning Guidance
Start by building an allowlist of known-legitimate CDN domains and their expected IP CIDR ranges — populate from your proxy/NGFW categorization feed. For the beaconing branch, establish a baseline of legitimate high-frequency polling agents (monitoring tools, AV cloud lookups) and exclude their process names and destination IPs. The URL shortener branch has the highest false positive rate in environments that use collaboration tools with shortened links; consider restricting this branch to non-browser processes only. For the typosquatting regex, review your DNS query logs for 30 days and add any internal naming patterns that trigger the lookalike rules (e.g., internal hostnames containing 'cdn' or 'akamai' as substrings). In organizations with legitimate use of SSH tunneling by DevOps teams, create a named_entity allowlist of authorized tunnel destination IPs and exclude those from the proxy chain hunting query.
Hunting Queries
Hunts for direct IP-based C2 beaconing where the adversary bypasses DNS entirely to avoid domain-based detection. Identifies scripting engine processes making repeated connections to raw IP addresses on consistent ports — a pattern used when C2 domains are blocked but IP addresses remain accessible.
// Hunt: Direct IP C2 connections bypassing DNS (no domain resolution, raw IP beaconing)
DeviceNetworkEvents
| where TimeGenerated > ago(7d)
| where ActionType == "ConnectionSuccess"
| where RemoteIPType == "Public"
| where isempty(RemoteUrl) or RemoteUrl matches regex @"^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}"
| where InitiatingProcessFileName in~ ("powershell.exe", "cmd.exe", "wscript.exe", "cscript.exe", "mshta.exe", "rundll32.exe", "regsvr32.exe")
| summarize ConnectionCount = count(), DistinctPorts = dcount(RemotePort), UniqueIPs = dcount(RemoteIP), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by DeviceName, InitiatingProcessFileName, RemoteIP
| where ConnectionCount >= 10 and DistinctPorts <= 2
| extend DurationMinutes = datetime_diff('minute', LastSeen, FirstSeen)
| where DurationMinutes > 60
| project FirstSeen, DeviceName, InitiatingProcessFileName, RemoteIP, ConnectionCount, DistinctPorts, DurationMinutes
| sort by ConnectionCount desc index=* sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=3
| eval dest_is_raw_ip=if(match(DestinationHostname, "^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$") OR isnull(DestinationHostname) OR DestinationHostname="", 1, 0)
| where dest_is_raw_ip=1
| where match(lower(Image), "(powershell|cmd\\.exe|wscript|cscript|mshta|rundll32|regsvr32)")
| where NOT match(DestinationIp, "^(10\\.|172\\.(1[6-9]|2[0-9]|3[01])\\.|192\\.168\\.|127\\.|::1)")
| bin _time span=1h
| stats count as conn_count, dc(DestinationPort) as distinct_ports, values(DestinationIp) as dest_ips by ComputerName, Image, _time
| where conn_count >= 5 AND distinct_ports <= 2
| sort -conn_count
| table _time, ComputerName, Image, dest_ips, conn_count, distinct_ports Hunts for CDN masquerading by correlating the claimed CDN brand in a domain name against the actual resolved IP address ASN. When a domain claims to be Akamai or Cloudflare but resolves to an IP in a residential ISP or generic hosting range, this indicates DarkGate-style infrastructure hiding. Requires DNS stream data for full fidelity.
// Hunt: Connections where SNI hostname doesn't match resolved IP's expected ASN (CDN IP mismatch)
let window = 24h;
DeviceNetworkEvents
| where TimeGenerated > ago(window)
| where ActionType == "ConnectionSuccess" and RemotePort in (443, 8443)
| where isnotempty(RemoteUrl)
| extend ClaimedCDN = case(
RemoteUrl has "akamai", "Akamai",
RemoteUrl has "cloudfront", "CloudFront",
RemoteUrl has "fastly", "Fastly",
RemoteUrl has "cloudflare", "Cloudflare",
RemoteUrl has "amazonaws", "AWS",
""
)
| where isnotempty(ClaimedCDN)
// Flag connections where the destination IP doesn't fall in known CDN ranges
// Known CDN CIDR blocks (representative — supplement with live feed in production)
| where not(
RemoteIP startswith "23." or // Cloudflare/Akamai ranges
RemoteIP startswith "104.16." or RemoteIP startswith "104.17." or // Cloudflare
RemoteIP startswith "99." or // AWS CloudFront range
RemoteIP startswith "13." or RemoteIP startswith "52." or // AWS
RemoteIP startswith "151.101." // Fastly
)
| project TimeGenerated, DeviceName, RemoteUrl, RemoteIP, ClaimedCDN, InitiatingProcessFileName, InitiatingProcessCommandLine
| sort by TimeGenerated desc index=* sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=22
| eval domain=lower(QueryName)
| eval claimed_cdn=case(match(domain, "akamai"), "Akamai", match(domain, "cloudfront"), "CloudFront", match(domain, "fastly"), "Fastly", match(domain, "cloudflare"), "Cloudflare", match(domain, "amazonaws"), "AWS", true(), "")
| where claimed_cdn != ""
| join type=left QueryName [search index=* sourcetype="stream:dns" | eval domain=lower(query) | stats values(answer) as resolved_ips by domain | rename domain as QueryName]
| eval ip_mismatch=case(
claimed_cdn="Cloudflare" AND NOT match(mvjoin(resolved_ips," "), "(104\\.1[6-9]\\.|104\\.2[0-9]\\.|172\\.6[4-9]\\.|172\\.7[0-1]\\.)" ), 1,
claimed_cdn="AWS" AND NOT match(mvjoin(resolved_ips," "), "(13\\.|52\\.|54\\.|99\\.)"), 1,
claimed_cdn="Fastly" AND NOT match(mvjoin(resolved_ips," "), "151\\.101\\."), 1,
true(), 0)
| where ip_mismatch=1
| stats count, values(resolved_ips) as ips, values(Image) as processes, first(_time) as first_seen by ComputerName, QueryName, claimed_cdn
| sort -count
| table ComputerName, QueryName, claimed_cdn, ips, processes, count, first_seen Hunts for proxy tunneling tools and SOCKS tunnel creation arguments that adversaries use to build multi-hop infrastructure chains. Detects JumbledPath-style jump host chains, SSH port forwarding (-D dynamic, -L/-R static tunnels), and open-source tunneling tools (chisel, ligolo, frpc) used to route C2 traffic through legitimate-looking intermediary hosts.
// Hunt: Multi-hop proxy chain indicators — processes that spawn network connections through SOCKS/HTTP proxy processes
let ProxyProcesses = dynamic(["ssh.exe", "plink.exe", "nc.exe", "ncat.exe", "socat", "proxychains", "chisel.exe", "ligolo", "frpc.exe", "revsocks.exe"]);
DeviceProcessEvents
| where TimeGenerated > ago(7d)
| where InitiatingProcessFileName has_any (ProxyProcesses) or FileName has_any (ProxyProcesses)
| where ProcessCommandLine has_any ("-D", "-L", "-R", "socks", "proxy", "-N", "tunnel", "forward", "dynamic")
| project TimeGenerated, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine
| sort by TimeGenerated desc index=* sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
| eval cmdline=lower(CommandLine), proc=lower(Image)
| eval is_proxy_tool=if(match(proc, "(ssh\\.exe|plink\\.exe|nc\\.exe|ncat\\.exe|chisel|ligolo|frpc|revsocks|proxifier)"), 1, 0)
| eval has_tunnel_args=if(match(cmdline, "(-d\\s|socks|proxy|-r\\s|-l\\s|dynamic|tunnel|forward|-n\\s|jumphost)"), 1, 0)
| where is_proxy_tool=1 OR has_tunnel_args=1
| eval risk=case(is_proxy_tool=1 AND has_tunnel_args=1, "critical", is_proxy_tool=1, "high", has_tunnel_args=1, "medium", true(), "low")
| where risk IN ("critical", "high")
| stats count, values(CommandLine) as commands, values(ParentImage) as parent_procs, min(_time) as first_seen by ComputerName, User, Image, risk
| sort -count
| table ComputerName, User, Image, commands, parent_procs, risk, count, first_seen Atomic Red Team Tests
Simulates a malware beacon making DNS queries to a domain that mimics a CDN provider but is not a legitimate CDN hostname — the pattern used by DarkGate and similar loaders that hardcode CDN-lookalike C2 domains.
Command
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "$domains = @('cdn-akamai-edge-cache-01.example.com', 'cloudfront-dist-eu.test-infra.net', 'amaz0n-s3-bucket-store.attacker-domain.com'); foreach ($d in $domains) { try { [System.Net.Dns]::GetHostAddresses($d) | Out-Null } catch {} ; Start-Sleep -Milliseconds 500 }; Write-Host 'CDN masquerade DNS test complete'" Cleanup
Clear-DnsClientCache Expected Telemetry
Sysmon Event ID 22 (DNS query) for each domain queried, with Image pointing to powershell.exe and the QueryName field containing each CDN-lookalike domain. Also generates Sysmon Event ID 1 for the PowerShell process creation.
Expected Detection
KQL Branch1 or SPL CDN masquerade branch should fire on the 'amaz0n' typosquat pattern and on the non-matching cloudfront/akamai domains queried from powershell.exe
Simulates a compromised host reaching out to a URL shortener service from a scripting process — a technique used when adversaries stage C2 infrastructure behind redirect chains to prevent direct domain takedowns.
Command
cmd.exe /c powershell.exe -NoProfile -Command "$urls = @('https://bit.ly/3testURL123', 'https://tinyurl.com/test-redirect-c2'); foreach ($u in $urls) { try { $r = Invoke-WebRequest -Uri $u -MaximumRedirection 0 -ErrorAction SilentlyContinue -UseBasicParsing; Write-Host $r.StatusCode } catch [System.Net.WebException] { Write-Host 'Redirect captured:' $_.Exception.Response.StatusCode } }" Cleanup
echo Cleanup: no persistent changes made Expected Telemetry
Sysmon Event ID 1 for cmd.exe spawning powershell.exe (suspicious process chain), Sysmon Event ID 22 for DNS queries to bit.ly and tinyurl.com, Sysmon Event ID 3 for outbound TCP connections to those domains on port 443.
Expected Detection
KQL Branch2 and SPL URL shortener branch should alert on powershell.exe (child of cmd.exe) making connections to bit.ly and tinyurl.com
Creates an SSH dynamic SOCKS5 proxy tunnel using standard OpenSSH, simulating the infrastructure hiding technique where adversaries route C2 traffic through legitimate SSH connections to obscure the true C2 endpoint. Tests the proxy chain hunting query.
Command
ssh.exe -N -D 1080 -o StrictHostKeyChecking=no -o ConnectTimeout=5 -o BatchMode=yes [email protected] -p 2222 2>&1; echo 'SSH tunnel attempt complete (expected to fail in test environment)' Cleanup
Stop-Process -Name ssh -Force -ErrorAction SilentlyContinue Expected Telemetry
Sysmon Event ID 1 for ssh.exe with CommandLine containing '-D 1080' dynamic forwarding argument. Sysmon Event ID 3 for attempted TCP connection to localhost:2222. Security Event ID 4688 if process creation auditing is enabled.
Expected Detection
Proxy chain hunting query should fire on ssh.exe with '-D' dynamic forwarding argument, classified as 'high' risk due to proxy tool with tunnel arguments
Simulates a malware implant's regular check-in beacon to a C2 server — the consistent interval pattern that distinguishes C2 traffic from legitimate browsing. Tests the beaconing detection branch.
Command
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "$target = '93.184.216.34'; $port = 443; 1..25 | ForEach-Object { try { $tcp = New-Object System.Net.Sockets.TcpClient; $tcp.ConnectAsync($target, $port).Wait(1000) | Out-Null; $tcp.Close() } catch {} ; Start-Sleep -Seconds 2 }; Write-Host 'Beacon simulation complete'" Cleanup
echo Cleanup: no persistent changes made Expected Telemetry
25 Sysmon Event ID 3 entries for outbound TCP connections from powershell.exe to the same destination IP on port 443, with consistent 2-second intervals visible in event timestamps. Sysmon Event ID 1 for powershell.exe process creation.
Expected Detection
KQL Branch3 beaconing detection should fire after sufficient connections accumulate (threshold: 20 connections to same IP, <=2 distinct ports, duration >30 minutes — adjust timing parameters for test validation)