Back to Intelligence

Agent Tesla v4 Emoji Obfuscation Campaign: Detection and Defense Guide for SOC Teams

SA
Security Arsenal Team
August 22, 2026
11 min read

KnowBe4's threat research team has disclosed a new Agent Tesla v4 campaign that takes an unusual and effective approach to evading detection: emoji-based code obfuscation. Instead of the typical Base64 blobs, string concatenation, or XOR routines we see in commodity infostealers, this variant embeds emojis directly into the malicious code — using them as variable names and string elements to break signature matching, confuse static analysis engines, and evade automated deobfuscation pipelines.

Agent Tesla has been a persistent threat for over a decade, but it remains one of the most prolific .NET-based remote access trojans and infostealers in the commodity malware ecosystem. It steals credentials from browsers, email clients, FTP clients, and VPN software; logs keystrokes; captures screenshots; and exfiltrates everything over SMTP, FTP, HTTP, or Telegram. The fact that its operators are investing in genuinely novel obfuscation tells us two things: (1) static detection against this family is getting harder, and (2) your behavioral and network-layer controls are now the controls that matter.

If your SOC relies primarily on signature-based AV and email gateway string matching, this campaign is built specifically to walk past you. This post breaks down what we know, how to hunt for it, and how to harden your environment against the Agent Tesla kill chain.

Technical Analysis

What Agent Tesla v4 Is

Agent Tesla is a .NET-compiled RAT/infostealer sold and distributed as commodity malware. Typical delivery chain:

  1. Phishing email with a malicious attachment — commonly an Office document with a malicious macro or an exploit, an ISO/IMG container, a ZIP containing an executable disguised as an invoice/purchase order, or an HTML attachment.
  2. First-stage execution — often a loader or dropper that injects into a legitimate .NET process or spawns a child process from the Office application.
  3. Persistence — registry Run keys (HKCU\Software\Microsoft\Windows\CurrentVersion\Run) and occasionally scheduled tasks.
  4. Credential harvesting — reads saved credentials from Chrome/Edge/Firefox, Outlook, Thunderbird, FileZilla, WinSCP, and dozens of other applications.
  5. Keylogging and screenshots — hooks keyboard input and captures periodic screenshots.
  6. Exfiltration — SMTP (the classic Agent Tesla signature, sending to attacker-controlled mailboxes), HTTP POST to C2 panels, FTP upload, or Telegram Bot API calls.

The Emoji Obfuscation Technique

C# and the broader .NET runtime accept a wide range of Unicode characters in identifiers. This campaign's operators exploit that by using emoji characters as variable and method names inside the compiled .NET payload. The impact on defenders:

  • Static signature engines fail. YARA rules and AV signatures that match on ASCII string patterns in .NET code sections simply don't fire when the strings of interest are emoji identifiers.
  • Automated deobfuscation chokes. Many sandboxes and analysis pipelines assume ASCII identifiers; Unicode-heavy code can cause parsing failures, truncated analysis, or malformed output that analysts misread as benign junk.
  • Analyst friction increases. A human reversing the sample faces code that is genuinely harder to read, slowing triage during an active incident.

Critically, the obfuscation is a static-layer trick. Once the payload executes, its runtime behavior is the same Agent Tesla we know: credential store access, keylogging, Run-key persistence, and SMTP/HTTP/Telegram egress. That is where your detection should live.

Exploitation Status

This is confirmed in-the-wild activity in an active campaign, not a theoretical technique. No CVE is associated with this news item — it is a malware tradecraft evolution, not a vulnerability. Agent Tesla campaigns typically target organizations across manufacturing, logistics, finance, and energy via high-volume phishing, so assume broad exposure if your users receive external email.

Detection & Response

The emoji obfuscation defeats static analysis — so hunt the behavior. The following detections target the observable, high-fidelity portions of the Agent Tesla kill chain: Office-spawned child processes, Run-key persistence, credential store access, and SMTP/Telegram exfiltration from non-mail processes.

YAML
---
title: Office Application Spawning Suspicious Child Process
description: Detects Microsoft Office applications spawning script interpreters or executables, consistent with Agent Tesla phishing document execution chains.
references:
  - https://attack.mitre.org/techniques/T1566/001/
  - https://www.infosecurity-magazine.com/news/agent-tesla-malware-evasion/
author: Security Arsenal
date: 2026/04/06
logsource:
  category: process_creation
  product: windows
detection:
  parent_office:
    ParentImage|endswith:
      - '\winword.exe'
      - '\excel.exe'
      - '\powerpnt.exe'
      - '\outlook.exe'
      - '\mspub.exe'
  child_suspicious:
    Image|endswith:
      - '\powershell.exe'
      - '\pwsh.exe'
      - '\cmd.exe'
      - '\wscript.exe'
      - '\cscript.exe'
      - '\mshta.exe'
      - '\rundll32.exe'
      - '\regsvr32.exe'
      - '\msbuild.exe'
      - '\vbc.exe'
      - '\csc.exe'
  condition: parent_office and child_suspicious
falsepositives:
  - Rare legitimate Office add-in behavior; MSBuild/csc/vbc children of Office are almost never legitimate
level: high
---
title: Agent Tesla Registry Run Key Persistence
description: Detects suspicious executable paths being written to Run keys, a hallmark Agent Tesla persistence mechanism. Focuses on user-writable and temp locations that legitimate software rarely uses for autostart.
references:
  - https://attack.mitre.org/techniques/T1547/001/
  - https://www.infosecurity-magazine.com/news/agent-tesla-malware-evasion/
author: Security Arsenal
date: 2026/04/06
logsource:
  category: registry_set
  product: windows
detection:
  reg_target:
    TargetObject|contains:
      - '\CurrentVersion\Run\'
      - '\CurrentVersion\RunOnce\'
  suspicious_path:
    Details|contains:
      - '\AppData\Roaming\'
      - '\AppData\Local\Temp\'
      - '\Users\Public\'
      - '\ProgramData\'
  filter_known_good:
    Details|contains:
      - 'OneDrive'
      - 'Teams'
      - 'Spotify'
      - 'Slack'
  condition: reg_target and suspicious_path and not filter_known_good
falsepositives:
  - Legitimate user-installed applications that autostart from AppData; tune the filter list per environment baseline
level: medium
---
title: Non-Mail Process Initiating SMTP Connection to External Host
description: Detects processes other than legitimate mail clients establishing outbound SMTP (25/465/587) connections, consistent with Agent Tesla's classic SMTP-based credential exfiltration.
references:
  - https://attack.mitre.org/techniques/T1048/003/
  - https://www.infosecurity-magazine.com/news/agent-tesla-malware-evasion/
author: Security Arsenal
date: 2026/04/06
logsource:
  category: network_connection
  product: windows
detection:
  smtp_ports:
    DestinationPort:
      - 25
      - 465
      - 587
  filter_mail_clients:
    Image|endswith:
      - '\outlook.exe'
      - '\thunderbird.exe'
      - '\eMClient.exe'
      - '\hxtsr.exe'
  condition: smtp_ports and not filter_mail_clients
falsepositives:
  - Line-of-business applications with email alerting features; scanner/MFP relay traffic. Baseline and suppress known senders by Image hash
level: high
KQL — Microsoft Sentinel / Defender
// Hunt for Agent Tesla behavioral chain in Microsoft Defender / Sentinel
// Part 1: Office-spawned processes writing Run key persistence within 10 minutes
let OfficeSpawn =
    DeviceProcessEvents
    | where TimeGenerated > ago(7d)
    | where InitiatingProcessFileName in~ ("winword.exe","excel.exe","powerpnt.exe","outlook.exe")
    | where FileName in~ ("powershell.exe","cmd.exe","wscript.exe","cscript.exe","mshta.exe","rundll32.exe","regsvr32.exe","msbuild.exe")
    | project DeviceId, SpawnTime=TimeGenerated, ChildProcess=FileName, ChildCmd=ProcessCommandLine, DeviceName;
let RunKeyWrite =
    DeviceRegistryEvents
    | where TimeGenerated > ago(7d)
    | where RegistryKey has_any ("\\CurrentVersion\\Run","\\CurrentVersion\\RunOnce")
    | where RegistryValueData has_any ("\\AppData\\","\\Temp\\","\\Users\\Public\\","\\ProgramData\\")
    | project DeviceId, RegTime=TimeGenerated, RegistryKey, RegistryValueName, RegistryValueData, InitiatingProcessFileName;
OfficeSpawn
| join kind=inner RunKeyWrite on DeviceId
| where abs(datetime_diff('minute', RegTime, SpawnTime)) <= 10
| project DeviceName, SpawnTime, ChildProcess, ChildCmd, RegistryKey, RegistryValueName, RegistryValueData
| sort by SpawnTime desc;
// Part 2: Non-mail processes making SMTP egress connections (classic Agent Tesla exfil)
DeviceNetworkEvents
| where TimeGenerated > ago(7d)
| where RemotePort in (25, 465, 587)
| where InitiatingProcessFileName !in~ ("outlook.exe","thunderbird.exe","eMClient.exe","hxtsr.exe")
| where RemoteIPType == "Public"
| summarize Connections=count(), DistinctDestinations=dcount(RemoteIP), FirstSeen=min(TimeGenerated), LastSeen=max(TimeGenerated)
    by DeviceName, InitiatingProcessFileName, InitiatingProcessFolderPath, RemoteIP, RemotePort
| where DistinctDestinations >= 1
| sort by Connections desc;
// Part 3: Telegram Bot API usage from endpoints (Agent Tesla alternative exfil channel)
DeviceNetworkEvents
| where TimeGenerated > ago(7d)
| where RemoteUrl has "api.telegram.org" or RemoteIP has "149.154."
| where InitiatingProcessFileName !in~ ("Telegram.exe")
| summarize FirstSeen=min(TimeGenerated), LastSeen=max(TimeGenerated), Hits=count()
    by DeviceName, InitiatingProcessFileName, InitiatingProcessFolderPath, RemoteUrl
| sort by Hits desc
VQL — Velociraptor
-- Velociraptor hunt: Agent Tesla persistence and execution artifacts
-- Combines Run key entries pointing to user-writable paths with live process
-- and network correlation. Deploy as a hunt across the fleet.

-- Artifact 1: Suspicious Run key persistence
SELECT Key.FullPath AS RegKey,
       Value.Name AS ValueName,
       Value.String AS ValueData,
       Key.Mtime AS LastWrite
FROM stat(filename='HKEY_USERS/*/Software/Microsoft/Windows/CurrentVersion/Run/*')
WHERE ValueData =~ '(?i)appdata|temp|public|programdata'
  AND NOT ValueData =~ '(?i)onedrive|teams|spotify|slack'

-- Artifact 2: Live processes with SMTP egress (classic Agent Tesla exfil)
SELECT Pid,
       Name,
       Exe,
       CommandLine,
       Username
FROM pslist()
WHERE Name =~ '(?i)outlook|thunderbird' = FALSE
  AND Pid IN (
      SELECT Pid FROM netstat()
      WHERE RemotePort IN (25, 465, 587)
        AND Status = 'ESTABLISHED'
  )

-- Artifact 3: Recently created executables in common Agent Tesla drop locations
SELECT FullPath,
       Size,
       Mtime,
       Ctime
FROM glob(globs=[
    'C:/Users/*/AppData/Roaming/**/*.exe',
    'C:/Users/*/AppData/Local/Temp/*.exe',
    'C:/Users/Public/**/*.exe'
])
WHERE Ctime > now() - 604800
ORDER BY Ctime DESC
PowerShell
# Agent Tesla remediation and hardening script — run elevated on suspected endpoints
# 1. Audit Run/RunOnce keys for suspicious persistence entries
$runKeys = @(
    'HKCU:\Software\Microsoft\Windows\CurrentVersion\Run',
    'HKCU:\Software\Microsoft\Windows\CurrentVersion\RunOnce',
    'HKLM:\Software\Microsoft\Windows\CurrentVersion\Run',
    'HKLM:\Software\Microsoft\Windows\CurrentVersion\RunOnce'
)
$suspiciousPattern = 'AppData|\\Temp\\|Users\\Public|ProgramData'
$findings = @()
foreach ($key in $runKeys) {
    if (Test-Path $key) {
        $props = Get-ItemProperty -Path $key
        foreach ($name in ($props.PSObject.Properties.Name | Where-Object { $_ -notmatch '^PS' })) {
            if ($props.$name -match $suspiciousPattern -and $props.$name -notmatch 'OneDrive|Teams|Spotify|Slack') {
                $findings += [PSCustomObject]@{ Key=$key; Name=$name; Value=$props.$name }
            }
        }
    }
}
if ($findings) {
    Write-Host '[!] Suspicious persistence entries found:' -ForegroundColor Red
    $findings | Format-Table -AutoSize
    # Quarantine: export then remove after IR approval
    # $findings | ForEach-Object { Remove-ItemProperty -Path $_.Key -Name $_.Name }
} else {
    Write-Host '[+] No suspicious Run key entries detected.' -ForegroundColor Green
}

# 2. Kill and suspend processes with active SMTP egress that are not mail clients
$smtpConns = Get-NetTCPConnection -State Established -ErrorAction SilentlyContinue |
    Where-Object { $_.RemotePort -in 25,465,587 -and $_.RemoteAddress -notmatch '^(10\.|192\.168\.|172\.(1[6-9]|2[0-9]|3[01])\.)' }
foreach ($conn in $smtpConns) {
    $proc = Get-Process -Id $conn.OwningProcess -ErrorAction SilentlyContinue
    if ($proc -and $proc.Name -notmatch '^(outlook|thunderbird|emclient|hxtsr)$') {
        Write-Host "[!] Non-mail SMTP egress: $($proc.Name) (PID $($proc.Id)) -> $($conn.RemoteAddress):$($conn.RemotePort)" -ForegroundColor Red
        # Stop-Process -Id $proc.Id -Force   # Uncomment after IR approval
    }
}

# 3. Hardening: block Office child processes via Attack Surface Reduction rule
# ASR rule: Block all Office applications from creating child processes
Set-MpPreference -AttackSurfaceReductionRules_Ids D4F940AB-401B-4EFC-AADC-AD5F3C50688A `
    -AttackSurfaceReductionRules_Actions Enabled
# ASR rule: Block executable content from email client and webmail
Set-MpPreference -AttackSurfaceReductionRules_Ids BE9BA2D9-53EA-4CDC-84E5-9B1EEEE46550 `
    -AttackSurfaceReductionRules_Actions Enabled
Write-Host '[+] ASR rules enforced for Office child process and email content blocking.' -ForegroundColor Green

# 4. Verify: confirm ASR rule state
Get-MpPreference | Select-Object -ExpandProperty AttackSurfaceReductionRules_Ids

Remediation

There is no patch for a malware campaign — remediation here is about breaking the kill chain and removing infections. Prioritize in this order:

1. Contain confirmed infections immediately.

  • Isolate the host from the network (EDR network isolation or switch port shutdown).
  • Rotate every credential that touched that machine — Agent Tesla's entire purpose is harvesting saved browser/email/FTP/VPN credentials and keystrokes. Treat all credentials stored on or typed into the endpoint as compromised, including any accounts the user authenticated to during the infection window.
  • Collect memory and disk images before reimaging if you need scope determination (lateral movement, other infected hosts).

2. Remove persistence and payload artifacts.

  • Audit and remove Run/RunOnce key entries pointing to AppData, Temp, Public, or ProgramData paths (script above).
  • Check scheduled tasks: schtasks /query /fo LIST /v | findstr /i "AppData Temp Public".
  • Hunt for the dropper — typically the original phishing attachment in the user's Downloads or the Outlook secure temp folder.

3. Harden the email and execution layers (the actual fix).

  • Enable the two ASR rules in the script above: block Office child process creation (D4F940AB) and block executable content from email (BE9BA2D9). These two rules sever the most common Agent Tesla delivery chains. Audit mode first if you have legacy line-of-business macros.
  • Block ISO/IMG mounting for standard users where feasible, and strip or detonate ISO, IMG, LNK, and HTML attachments at the gateway.
  • Disable macros from the internet (default in current Office builds — verify it hasn't been relaxed via GPO).

4. Block exfiltration at the egress point.

  • Deny outbound SMTP (25/465/587) from all endpoints at the perimeter firewall. There is almost never a legitimate reason for a workstation to speak SMTP directly to the internet. This single rule neutralizes Agent Tesla's classic exfil channel fleet-wide.
  • Block or proxy api.telegram.org at the web gateway unless there is a business need; log and alert on hits.
  • Alert on any non-mail-client process initiating SMTP — this is one of the highest-fidelity Agent Tesla signals available (see Sigma rule 3).

5. Fix your detection posture for obfuscation-evasive payloads.

  • Accept the lesson this campaign teaches: static detection will lose to novel obfuscation. Shift investment toward behavioral detection (process lineage, registry writes, network egress) and content disarm/reconstruction for email attachments.
  • Ensure your sandbox detonates .NET payloads with sufficient analysis time — Unicode-obfuscated samples can cause some pipelines to error out early. Validate your sandbox actually scores Agent Tesla test samples (in an isolated lab) rather than silently failing.
  • Update YARA rules to match on behavioral imports and .NET metadata rather than ASCII identifier strings alone.

6. User layer.

  • This campaign arrives by phishing. Reinforce reporting workflows and ensure reported-phish triage SLA is measured in minutes, not hours — a fast report-to-isolate loop is the difference between one reimaged laptop and a domain-wide credential reset.

Related Resources

Security Arsenal Incident Response Services AlertMonitor Platform Book a SOC Assessment incident-response Intel Hub

Is your security operations ready?

Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.