Skip to content
HackInvasionCybersecurity Knowledge Hub

Research. Practice. Perspective.

Practical Cybersecurity
Knowledge for Defenders.

Research notes, tutorials, and practical insights on incident response, threat hunting, SOC operations, threat intelligence, and security automation.

Browse by subject

Find your next learning path.

All articles →

From the knowledge base

Latest articles & news

Browse the complete library →

New articles and news appear here automatically when published.

Hunting Obfuscated PowerShell and AMSI Bypass Attempts

Dark illustration of a shattering digital keyboard dissolving into red and blue particles, symbolizing obfuscated PowerShell payloads evading AMSI inspection

Case file: the payload that hides in plain sight

PowerShell is a system administrator's best friend and an incident responder's recurring nightmare. In case after case, the initial access vector — a macro, a malicious LNK, a drive-by download — does one thing: it launches a PowerShell command line so mangled it looks like keyboard static. Strings reversed, variables named with random characters, the whole payload compressed and Base64-encoded three layers deep. That obfuscation exists for one reason: to slip past the Antimalware Scan Interface (AMSI), the layer that lets Defender inspect script content before it executes.

This hunt targets two linked behaviors. First, obfuscated PowerShell execution — command lines and script blocks that use encoding, string manipulation, or dynamic invocation to hide intent (T1027 Obfuscated Files or Information, T1059.001 PowerShell). Second, AMSI bypass attempts — explicit techniques like patching amsi.dll in memory, setting amsiInitFailed, or disabling script-block logging, mapped to T1562.001 Impair Defenses. Either one alone is worth a look; together, they're a strong signal of malicious intent.

The hypothesis

If an attacker is executing malicious PowerShell in our environment, then we will find PowerShell processes with command lines containing encoding flags (-enc/-EncodedCommand), reflection or dynamic-invocation primitives (FromBase64String, Invoke-Expression, IEX), or known AMSI-bypass strings — especially when launched by Office apps, browsers, or script hosts rather than by administrators.

Data you'll need

Log sourceTable / indexWhat it gives you
Microsoft Defender for EndpointDeviceProcessEvents, DeviceEventsFull PowerShell command lines; AMSI-related detections and tamper events
PowerShell Script Block LoggingEventCode 4104 (index=wineventlog)De-obfuscated script content — what actually ran
SysmonEventCode 1Parent-child chains for the launching process

Hunting with KQL

This query scores PowerShell executions against a stack of obfuscation and AMSI-bypass indicators, so the most suspicious launches surface first.

// Hunt: obfuscated PowerShell + AMSI bypass indicators, scored
let ObfuscationMarkers = dynamic([
    "-enc", "-EncodedCommand", "-e ", "FromBase64String",
    "Invoke-Expression", "IEX", "Invoke-Mimikatz",
    "-w hidden", "-windowstyle hidden", "-noni", "-NoProfile"]);
let AmsiBypassMarkers = dynamic([
    "amsiInitFailed", "AmsiUtils", "amsi.dll",
    "System.Management.Automation.AmsiUtils",
    "amsiContext", "NonPublic,Static", "Set-MpPreference",
    "DisableRealtimeMonitoring", "Reflection.Assembly"]);
DeviceProcessEvents
| where TimeGenerated > ago(14d)
| where FileName in~ ("powershell.exe", "pwsh.exe")
| extend HasObfuscation = ProcessCommandLine has_any (ObfuscationMarkers),
         HasAmsiBypass = ProcessCommandLine has_any (AmsiBypassMarkers),
         LaunchedBySuspiciousParent = InitiatingProcessFileName in~
             ("winword.exe", "excel.exe", "outlook.exe", "mshta.exe",
              "wscript.exe", "cscript.exe", "rundll32.exe", "iexplore.exe", "chrome.exe")
| where HasObfuscation or HasAmsiBypass
| extend SuspicionScore = (iff(HasObfuscation, 1, 0)
    + iff(HasAmsiBypass, 3, 0) + iff(LaunchedBySuspiciousParent, 2, 0))
| project TimeGenerated, DeviceName, InitiatingProcessFileName,
    InitiatingProcessCommandLine, ProcessCommandLine,
    InitiatingProcessAccountName, HasObfuscation, HasAmsiBypass,
    LaunchedBySuspiciousParent, SuspicionScore
| order by SuspicionScore desc, TimeGenerated desc

What this does: every PowerShell launch in the window is checked against two marker lists. AMSI-bypass strings score triple because they indicate deliberate defense evasion rather than mere obfuscation. A suspicious parent process (Office, browsers, script hosts) adds weight. The result: the query ranks itself, and your triage starts at the top.

Decode the payload. A -enc argument is Base64-encoded UTF-16LE. In your analysis environment — never on the production host — decode it to see the underlying intent:

// Decode a captured -EncodedCommand argument offline
$b64 = "<paste the base64 string here>"
[System.Text.Encoding]::Unicode.GetString(
    [System.Convert]::FromBase64String($b64))
Example: what a true-positive result row looks like
TimeGenerated2026-09-19 14:02:41 UTC
DeviceNameWS-SALES-0117
InitiatingProcessFileNamewinword.exe
ProcessCommandLinepowershell -nop -w hidden -enc SQBmACgAWwBJAG4AdABQAHQAcgBdADoAOgBTAGkAegBlACAAPQAgADQAKQAuAEMAbwBuAHQAYQBpAG4AcwAoACIAYQBtAHMAaQBJAG4AaQB0AEYAYQBpAGwAZQBkACIAKQA=
DecodedIf([IntPtr]::Size -eq 4){... .Contains("amsiInitFailed") ...} — reflects over AMSI internals to flip the init-failed flag
SuspicionScore6 (obfuscation + AMSI bypass + Office parent)

Hunting with Splunk

In Splunk, Script Block Logging (EventCode 4104) is your best friend — it records the de-obfuscated script, so AMSI-bypass code is visible even when the command line was encoded:

index=wineventlog EventCode=4104 earliest=-14d
| where match(ScriptBlockText, "(?i)(amsiInitFailed|AmsiUtils|amsi\.dll|amsiContext)")
   OR match(ScriptBlockText, "(?i)(FromBase64String|Invoke-Mimikatz|Invoke-Shellcode|DownloadString|DownloadFile)")
| eval decoded_preview=substr(ScriptBlockText, 1, 300)
| table _time, host, user, MessageNumber, decoded_preview, ScriptBlockText

What this does: it scans every logged script block for AMSI-tampering strings and common malicious .NET/download primitives, showing a 300-character preview so you can triage without pulling full script text. Complement it with a command-line sweep over Sysmon process creation:

index=sysmon EventCode=1 Image="*powershell.exe" earliest=-14d
| where match(CommandLine, "(?i)(-enc|EncodedCommand|FromBase64String|\\bIEX\\b)")
| stats count by host, ParentImage, CommandLine
| sort -count

Example hit: EventCode 4104 on WS-SALES-0117 where ScriptBlockText contains [Ref].Assembly.GetType('System.Management.Automation.AmsiUtils') followed by reflection calls setting a private static field — the textbook in-memory AMSI bypass. The parent chain shows winword.exe → powershell.exe, and the document that started it is still sitting in the user's Downloads folder.

Validating the hit

  1. Decode and read the payload. Pull the full command line or script block, decode any Base64 layers, and read what it actually does. Look for the kill chain verbs: download, decode, inject, persist, exfiltrate.
  2. Check the parent and the lure. Identify the document, email, or web page that launched PowerShell. A macro-enabled attachment in the inbox minutes before the execution confirms the delivery vector.
  3. Look for what the bypass was protecting. AMSI bypasses exist to hide a second stage. Search the host for network connections, file writes, and child processes within ±15 minutes of the bypass — the real payload usually lands right after.
  4. Confirm defenses are intact. Check whether Defender real-time protection, Script Block Logging, or AMSI itself was disabled (Get-MpPreference, registry DisableRealtimeMonitoring). If tampering succeeded, assume the host's own telemetry has gaps.

Tuning out false positives

  • Legitimate encoded commands: SCCM, Intune, and admin tooling routinely use -EncodedCommand to pass scripts safely. Baseline your management tooling's command-line patterns and exclude the service accounts that run them.
  • Security products themselves: EDR sensors and vulnerability scanners sometimes contain strings like amsi.dll in their own script blocks. Correlate the host and user — scanner service accounts are not interactive logons.
  • Developer and IT automation: DevOps scripts love Invoke-Expression and Base64 for passing credentials. Scope the hunt to interactive user contexts and unusual parents before alerting.

What to do next

A confirmed AMSI bypass is an active intrusion signal — the attacker is investing effort to stay invisible on that box. Isolate the host immediately, kill the PowerShell process tree, and preserve the script block logs and any dropped files for forensics. Hunt the decoded payload's indicators (domains, hashes, file paths) across the fleet: obfuscated PowerShell is rarely a one-host event. If the bypass disabled Defender components, re-enable and verify them before returning the host to service — and consider a full reimage, because a host whose defenses were blinded can't fully vouch for itself.

Next in this series: ransomware precursors — hunting shadow copy deletion before the encryption starts.

Daily Cyber Threat Brief — September 25, 2026: Bitget Loses $351.6M in Suspected North Korean Hack

Daily Cyber Threat Brief — September 25, 2026: Bitget Loses $351.6M in Suspected North Korean Hack

🗂️ CASE FILE — September 25, 2026

Lead story: Bitget crypto exchange discloses a $351.6 million theft from its hot and warm wallets — the company links the attack to suspected North Korean hackers, has suspended withdrawals, and says customer losses will be covered by its $464M User Protection Fund.

Also covered: Malicious AI agents steal 600K+ credit cards from online retailers (Gambit Security) · CISA warns ransomware gangs are now exploiting the critical TeamCity flaw CVE-2026-63077 · ShinyHunters sets a one-week ultimatum in the FBI-breach claim · Ransomware claim wave: Akira, WallStreet, Krybit, Spirals, incransom name new victims.

Sources: 10 linked at the end of this brief.

Today's top stories

Today's brief leads with one of the largest crypto exchange heists of the year: Bitget says roughly $351.6 million was stolen from its hot and warm wallets, with the theft linked to suspected North Korean operators. Also today: a Gambit Security investigation shows autonomous AI agents did the heavy lifting in a campaign that stole more than 600,000 payment card records from online retailers at an average cost of $25 per target, CISA flags that ransomware gangs have added the TeamCity flaw CVE-2026-63077 to their arsenal, and a fresh wave of dark-web ransomware claims names victims across law, education, healthcare, and retail.

Hooded analyst seen from behind facing a wall of monitors displaying red and green cryptocurrency candlestick charts and network threat graphs in a dark operations room

Bitget discloses $351.6M theft from hot and warm wallets; North Korean hackers suspected

Cryptocurrency exchange Bitget has disclosed that suspected North Korean hackers stole approximately $351.6 million in assets from a limited number of its hot and warm wallets. Bitget says its security systems flagged multiple unauthorized transfers on Thursday evening, and all withdrawals are temporarily suspended while the company investigates with law enforcement agencies, on-chain security institutions, and cybersecurity experts from Mandiant and SlowMist.

The theft spanned seven chains — Ethereum, XRP Ledger, Arbitrum, Avalanche, Optimism, BSC, and Base — and hit multiple assets including ETH, XRP (the largest single-chain loss), BNB, AVAX, USDT, and USDC, according to CEO Gracy Chen. Some chains have already confirmed the attacker's wallet addresses have been frozen. Bitget has not yet explained how the attackers breached its key backend wallet-service system to forge transfer information and trigger the authorization-signing process. Cold wallets and the overwhelming majority of platform assets remain secure; the self-custodial Bitget Wallet runs on independent infrastructure and was not affected.

Crucially for customers: Bitget says the incident falls within the coverage of its User Protection Fund — currently holding 5,500 BTC worth roughly $464 million — which will cover all losses. Deposits and trading continue to operate normally.

🔍 Investigation notes — defender takeaway (click to expand)

The technical detail to watch is the attack path: forging transfer information inside the backend wallet-service system to trigger the signing flow. That is not a wallet compromise in the classic sense — it is a compromise of the authorization pipeline itself. For anyone operating signing infrastructure: treat the transaction-construction and approval service as your crown jewels, with hardware-backed signing, quorum approvals, and anomaly detection on transfer-request metadata, not just on destinations. And note the attribution framing: "suspected North Korean" groups have a documented playbook of high-value exchange heists; watch for laundering patterns across the named chains.

Malicious AI agents steal 600K+ credit cards from online retailers at ~$25 a target

Gambit Security has reconstructed a financially motivated campaign in which a Chinese-speaking operator used three open-source AI harnesses to breach online retailers and steal payment card data — with minimal human effort and trivial cost. The tools: Strix for vulnerability discovery, Cairn for autonomous exploitation, and Hermes as the campaign orchestrator with a "Red Team Operator" persona and 121 custom skills (78 offensive).

Between September 10 and 15, the operator launched at least 105 attack projects, compromising at least 27 companies to varying degrees — including a Fortune 500 hospitality company, a major US airline, a large US industrial supplies distributor, and an online fashion retailer. Gambit gained access to the attacker's staging server to reconstruct the operation: the operator issued just 1,951 short commands in Chinese across 260 sessions while the agents handled reconnaissance, exploitation, persistence, and cleanup independently, sometimes operating for hours without intervention. The haul: more than 600,000 unexpired payment card records stolen from two companies, with web skimmers confirmed on 19 websites and malicious scripts tied to 100+ additional sites. Average cost: $25.46 per target (range $3.13–$79.31); total campaign spend estimated at $12,000–$18,000. Some intrusions ended with destructive cleanup — data deletion after exfiltration — and at one US wine retailer a cron job persistently re-infected files every two minutes after cleanup.

Magnifying lens over swirling blue data streams and red circuit-board traces with a robotic arm silhouette, symbolizing autonomous AI-driven payment-card theft in a dark digital scene

🔍 Investigation notes — defender takeaway (click to expand)

The economics are the headline: a single operator compromised 27 companies with $12–18K of AI model spend. Your defenses must assume agent-scale automation, not human-scale attackers. Harden the exact choke points this campaign used: audit checkout-page JavaScript and tag managers for skimmer injections, watch AWS S3 content and databases for poisoned objects, check for rogue cron jobs re-infecting cleaned files, and review misconfigured sudo rules and exposed AWS credentials. One documented intrusion chained an unauthenticated SQL injection into MFA bypass, admin access, file upload, privilege escalation, AWS Secrets Manager extraction, and a Magento database — patch the chain, not just one link.

CISA: ransomware gangs now exploiting critical TeamCity flaw CVE-2026-63077

On Wednesday, CISA updated its Known Exploited Vulnerabilities catalog to flag that ransomware gangs are now actively exploiting CVE-2026-63077, a critical authentication bypass in JetBrains TeamCity On-Premises. An unauthenticated attacker with HTTP(S) access can abuse the TeamCity agent polling protocol to bypass authentication entirely and execute arbitrary OS commands with the privileges of the TeamCity server process (CVSS 9.8).

JetBrains patched the flaw on July 25 in versions 2025.11.7 and 2026.1.3; CISA added it to KEV on August 5 with a three-day federal remediation deadline; JetBrains confirmed in-the-wild exploitation on August 7 and shared IoCs. This is the fourth TeamCity issue since October 2023 to be tagged as exploited in the wild and subsequently abused in ransomware campaigns. Shadowserver is currently tracking just over 160 TeamCity servers that remain unpatched. Related: JetBrains previously disclosed that its own Cadence cloud service was breached via this flaw (discovered August 23), with attackers extracting AWS credentials — Cadence users were urged to revoke and rotate everything.

🔍 Investigation notes — defender takeaway (click to expand)

Build servers are ransomware gold: they hold signing keys, cloud credentials, and the pipeline that turns source code into shipped software — a compromise can poison every downstream build. Patching alone is not enough on this one: BreachLock and SafeBreach researchers advise treating unpatched-and-exposed instances as an active-compromise scenario — patch, rotate all credentials and tokens issued during the exposure window, and review build logs for unexpected artifacts or config changes. Then take the server off the open internet entirely; it has no business being there.

ShinyHunters sets one-week ultimatum in FBI-breach claim

The ShinyHunters group continues to press its claim of breaching FBI systems via an Oracle PeopleSoft zero-day, now demanding the FBI retract a May 2026 FBI report about the group within one week — explicitly framing the operation as "not financially motivated." The group claims 2–3 TB of employee and applicant data; Reuters and 404 Media partially matched portions of a ~5,000-record sample against external records but could not confirm the data came from FBI systems. The FBI still has not confirmed a breach and says it is investigating; FBIjobs.gov and the Special Agent applicant portal remain offline. The PeopleSoft flaw is now being tracked as CVE-2026-35273 per some reports, and the campaign reportedly extends to 100+ organizations hit since June 2026.

🔍 Investigation notes — defender takeaway (click to expand)

Still a claim, not a confirmed incident — but the ultimatum clock is now a forcing function: watch for a data dump or escalation within the week if the FBI does not comply. Regardless of the FBI angle, the PeopleSoft exposure path is real and already weaponized at scale since June: audit your internet-facing PeopleSoft deployments and confirm you are on current CPU levels, because the same flaw is reportedly being used against other organizations right now.

Ransomware watch: fresh claim wave names law, education, healthcare victims

Dark-web monitoring for September 24 logged a cluster of new ransomware victim claims — all unverified allegations at this stage:

  • Akira names Strack Companies (ThreatMon monitoring).
  • WallStreet adds a US law firm (Prater & Ridley Attorneys At Law) and the Catholic University of El Salvador.
  • Krybit claims Jones the Grocer, Air Tanzania, and efada.sa (Saudi Arabia).
  • Spirals hits Uganda's Armada Credit Bureau; incransom lists welgenone.com, a US healthcare/wellness provider.

A law firm, a university, a hospital-adjacent provider, and a national airline — the claim set is a reminder that ransomware listing is cheap for operators and expensive for victims to disprove. Monitor for official confirmations before treating any as a breach.

🔍 Investigation notes — defender takeaway (click to expand)

Treat every entry as alleged until the victim confirms. But do not wait for confirmation to hunt: if you share a sector with a named victim, sweep for the named actors' known IoCs and TTPs now. The law-firm listing is the highest-stakes one — a confirmed compromise there would expose client confidences, not just corporate data — and law firms historically underinvest in detection relative to their data's value.

Incident timeline

July 2026AI-agent card-theft campaign active (per Gambit); JetBrains patches TeamCity CVE-2026-63077 (July 25).
Aug 5–7CISA adds CVE-2026-63077 to KEV; JetBrains confirms in-the-wild exploitation and shares IoCs.
Aug 23JetBrains discovers its own Cadence environment was breached via the TeamCity flaw; AWS credentials extracted.
Sept 10–15105 attack projects launched in the AI-agent retail campaign; 27+ companies compromised.
Sept 21–22ShinyHunters claims FBI breach via PeopleSoft zero-day; Gambit publishes its AI-agent campaign report (Tuesday).
Sept 23CISA warns ransomware gangs are now exploiting CVE-2026-63077; FBI reiterates it is investigating the ShinyHunters claims.
Sept 24Ransomware claim wave: Akira (Strack Companies), WallStreet (Prater & Ridley, Catholic University of El Salvador), Krybit (Jones the Grocer, Air Tanzania, efada.sa), Spirals (Armada Credit Bureau), incransom (welgenone.com). Bitget discovers unauthorized transfers Thursday evening.
Sept 25Bitget discloses the $351.6M theft, links it to suspected North Korean hackers, and suspends withdrawals.

Sources

Hunting Scheduled Task Persistence: The Foothold That Survives a Reboot

Dark illustration of clockwork gears with a glowing red heartbeat pulse line running beneath them, symbolizing scheduled task persistence

Case file: persistence via Scheduled Tasks

You've contained the initial access. The phishing payload is deleted, the malicious process is dead, the EDR console shows the endpoint "clean." Then, 72 hours later, the same host phones home again. Nothing in your first sweep explains the re-infection — until you look at the Scheduled Task cache and find a job named GoogleUpdateTaskMachineUA that points to a binary in %APPDATA%. That's persistence, and it's one of the most reliable tricks in the attacker playbook because it looks like normal Windows administration.

This hunt is about one pattern: an adversary creating or modifying a Scheduled Task so their payload runs on a schedule — at logon, on a timer, or every time the machine boots. It's MITRE ATT&CK T1053.005 (Scheduled Task/Job: Scheduled Task), and it shows up in ransomware operations, intrusions, and commodity malware alike. The evidence trail is rich — task creation events, process launches of schtasks.exe, and registry writes under the Task Cache — which makes it an ideal hypothesis-driven hunt.

The hypothesis

If an attacker is establishing persistence on Windows endpoints in our environment, then we will find Scheduled Task registrations (Event ID 4698 or schtasks.exe /create executions) where the task action points to an unsigned binary, a script in a user-writable path, or a command line containing download/execution primitives — launched by a process that doesn't normally manage tasks.

Data you'll need

Log sourceTable / indexWhat it gives you
Microsoft Defender for EndpointDeviceProcessEvents, DeviceRegistryEventsProcess launches (schtasks.exe, PowerShell *-ScheduledTask cmdlets) and Task Cache registry writes
Windows Security logSecurityEvent / index=wineventlog, EventCode 4698"A scheduled task was created" audit events with the task XML
SysmonEventCode 1 (process create), 13 (registry set)Full command lines and parent-child process chains

Hunting with KQL

Start broad: any Scheduled Task creation activity in the last 14 days, via schtasks.exe, PowerShell task cmdlets, or the Task Scheduler COM interface.

// Hunt: Scheduled Task creation outside normal admin tooling
let SuspiciousParents = dynamic(["cmd.exe", "powershell.exe", "pwsh.exe",
    "wscript.exe", "cscript.exe", "mshta.exe", "rundll32.exe", "regsvr32.exe"]);
DeviceProcessEvents
| where TimeGenerated > ago(14d)
| where (FileName =~ "schtasks.exe" and ProcessCommandLine has_any ("/create", "/change", "/run"))
    or (FileName in~ ("powershell.exe", "pwsh.exe")
        and ProcessCommandLine has_any ("New-ScheduledTask", "Register-ScheduledTask",
            "Set-ScheduledTask", "schtasks"))
| extend TaskActionSuspicious = ProcessCommandLine has_any (
    "%appdata%", "%temp%", "powershell", "cmd /c", "wscript",
    "http://", "https://", "bitsadmin", "certutil", "-enc", "-EncodedCommand")
| project TimeGenerated, DeviceName, InitiatingProcessFileName,
    InitiatingProcessCommandLine, FileName, ProcessCommandLine,
    InitiatingProcessAccountName, TaskActionSuspicious
| order by TaskActionSuspicious desc, TimeGenerated desc

What this does: the query collects every task registration event and promotes a boolean flag, TaskActionSuspicious, when the command line references user-writable paths, scripting engines, encoded commands, or URLs — all classic markers of a malicious task action. Sorting true-positives to the top keeps the triage queue short.

Back it up with the audit trail. Event ID 4698 fires whenever a scheduled task is created and embeds the task XML, including the <Command> and <Arguments> the task will run:

// Hunt: 4698 task-creation audit events with suspicious actions
SecurityEvent
| where TimeGenerated > ago(14d)
| where EventID == 4698
| extend TaskName = extract(@"TaskName:\s+(\S+)", 1, EventData),
         TaskCommand = extract(@"<Command>(.*?)</Command>", 1, EventData)
| where TaskCommand has_any (@"\AppData\", @"\Temp\", "powershell", "cmd.exe", ".ps1", ".vbs", ".js")
| project TimeGenerated, Computer, Account, TaskName, TaskCommand
Example: what a true-positive result row looks like
TimeGenerated2026-09-18 03:14:22 UTC
DeviceNameWS-FIN-0442
InitiatingProcessFileNamepowershell.exe
ProcessCommandLineschtasks /create /tn "OfficeTelemetry" /tr "cmd /c powershell -w hidden -enc aQBmACgAWwBJAG4AdABQAHQAcgBdADoAOgBTAGkAegBlACAAPQAgADQAKQA=" /sc onlogon /f
TaskActionSuspicioustrue
Why it's maliciousTask name mimics legitimate software, triggers at every logon, and runs a Base64-encoded hidden PowerShell payload — three persistence red flags in one row.

Hunting with Splunk

The same hunt translates cleanly to Splunk. Use the Windows Security log for 4698 creations and Sysmon EventCode 1 for full command-line fidelity:

index=wineventlog EventCode=4698 earliest=-14d
| rex field=_raw "TaskName:\s+(?<task_name>\S+)"
| rex field=_raw "Task Content:\s*(?<task_xml>[\s\S]*)"
| rex field=task_xml "<Command>(?<task_command>.*?)</Command>"
| where match(task_command, "(?i)(appdata|\\\\temp\\\\|powershell|cmd\.exe|\.ps1|\.vbs|\.js|http)")
| table _time, host, user, task_name, task_command

What this does: it pulls every 4698 "scheduled task was created" event, extracts the task name and the command the task will execute from the embedded task XML, and keeps only rows where the command touches user-writable paths, scripting engines, or URLs. Pair it with a Sysmon sweep to catch attackers who bypass the audit log by editing the Task Cache registry directly:

index=sysmon EventCode=13 earliest=-14d
    TargetObject="*\\Microsoft\\Windows NT\\CurrentVersion\\Schedule\\TaskCache\\Tree\\*"
| stats count by host, TargetObject, _time

Example hit: a Sysmon EventCode 1 row on host WS-FIN-0442 — Image: C:\Windows\System32\schtasks.exe, CommandLine: schtasks /create /tn "OfficeTelemetry" /tr "cmd /c powershell -w hidden -enc ...", ParentImage: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe, User: FINANCE\jchen. PowerShell spawning schtasks with an encoded payload at 3 a.m. is not patch management — it's an intruder bolting the door from the inside.

Validating the hit

  1. Read the task XML. On the host (or from the 4698 event's Task Content), inspect C:\Windows\System32\Tasks\<TaskName>. Check the <Actions> node: what binary runs, with what arguments, and on what trigger? Malicious tasks typically use LogonTrigger or short-interval TimeTrigger schedules.
  2. Vet the binary. Hash the executable the task points to, check its signature (Get-AuthenticodeSignature), and submit the hash to your threat intel feeds. An unsigned binary in %APPDATA% or %TEMP% is damning; a signed vendor updater is usually not.
  3. Reconstruct the parent chain. Who created the task? Trace InitiatingProcessFileName back: a task created by services.exe during a software push differs sharply from one created by a Word-launched PowerShell. Correlate with process creation logs ±10 minutes around the 4698 timestamp.
  4. Check for siblings. One malicious task is rarely alone. Search the same host for other recent task creations, new Run registry keys, and new services — attackers layer persistence mechanisms.

Tuning out false positives

  • Software updaters: Google Update, Adobe ARM, and vendor agents register tasks constantly. Whitelist by signed publisher + known task names, not by task name alone (attackers mimic names like GoogleUpdateTaskMachineUA).
  • Configuration management: SCCM/MECM, Intune, and GPO-deployed tasks create tasks at scale. Filter on the creating account (SYSTEM via known management processes) and known task paths like \Microsoft\....
  • Admin maintenance scripts: IT teams schedule log cleanup and backup jobs. Keep an inventory of sanctioned tasks; anything not on the list that runs a script from a user profile deserves a look.

What to do next

A confirmed malicious task means the host is compromised right now — act on that assumption. Isolate the endpoint in EDR, then delete the task (schtasks /delete /tn "<name>" /f) and remove the payload binary. Don't stop at one host: sweep the fleet for the same task name, hash, and command-line pattern, since persistence is often deployed enterprise-wide before ransomware detonation. Reset credentials for the affected user, capture a memory image if your IR process calls for it, and open an incident — persistence is a foothold, and footholds exist to be used.

Next in this series: obfuscated PowerShell and AMSI bypass attempts — hunting the payload that the scheduled task was built to launch.

Amit Vijayan

Amit Vijayan
Hack Ethically

About Me


I am an engineering student and i am very dedicated about Ethical Hacking. I have been learning "Ethical Hacking" for about 4 years now.
Though I'am not a pro hacker but also not a noob. I have enough knowledge to give others like me, a start for their Ethical Hacking & Cyber Security. As i keep learning new things, i keep updating them on the blog from basic to advanced level.
I started Ethical Hacking as a hobby which has now turned into my passion and i'am sure i will turn it into my profession through this blog.

Always be an Ethical Hacker.

Why this site exists

Good security starts
with clear thinking.

HackInvasion makes complex security concepts easier to understand through practical research notes, responsible learning and evidence-led explanations.

Explore a growing library of defensive knowledge alongside an openly documented archive of earlier technical learning.

Our approach to learning →