Skip to content
Leaked secrets Write-up Advanced

Malware Analysis Chronicles Unpacking Agenttesla

A multi-layered AgentTesla credential stealer used a .NET crypter with AES encryption and process hollowing to hide its payload. The attacker could steal browser passwords and Windows Vault credentials, but the malware's SMTP credentials were hardcoded in plaintext, exposing the operation.

Dhwani Patel Follow

Published on systemweakness.com

Picture this: You’re analyzing a piece of malware, diving deep through layers of obfuscation and encryption, when suddenly you stumble upon something unexpected — the attacker’s email credentials sitting in plain text. This isn’t fiction; it’s exactly what happened during my recent analysis of an AgentTesla sample.

Dhwani Patel, on systemweakness.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The malware used a .NET crypter with AES encryption and process hollowing to hide the AgentTesla payload, but the attacker hardcoded SMTP credentials in plaintext within the configuration class.

Impact

The malware could steal browser passwords and Windows Vault credentials and exfiltrate them via email, but the exposed SMTP credentials could allow takedown or intelligence gathering.

What the attacker needed

Victim runs the malware; attacker has SMTP credentials

How it was found

  1. Load the sample into dnSpy and locate the decryption routine.
  2. Set breakpoints on the key and IV assignment lines.
  3. Run the malware in the debugger with 'Break at Entry Point' enabled.
  4. Step through the code until the variables are populated.
  5. Use the revealed key and IV to decrypt the 640KB resource.
  6. Load the decrypted payload into dnSpy to analyse AgentTesla.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

This is a write-up about analysing a piece of malware called AgentTesla, which steals saved passwords from web browsers and the Windows system. The malware was hidden inside another program that encrypted it and then ran it inside a legitimate Windows process to avoid detection. The analyst found the attacker's email password in plain text, which is a serious mistake by the attacker.

What is Leaked secrets?

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.

More by Dhwani Patel

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Leaked secrets and credentials

The lesson behind this report.

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.