Course contentsShow
← Security
Lesson 2257 of 3,05244. Social Engineering and Physical SecurityFree lesson

Malicious Attachments and Payload Delivery

Analyze common file types used in phishing (Office macros, PDFs, archives) and techniques to evade detection and execute code.

Malicious Attachments and Payload Delivery

What you'll learn: How attackers weaponize common file types to deliver payloads and evade security defenses in phishing campaigns.

Understanding Weaponized File Types

Malicious attachments are the "trojan horse" of modern phishing—familiar file types that hide executable code inside. Attackers exploit trust in everyday documents because users regularly open .docx, .pdf, and .zip files without suspicion.

Common Attack Vectors

Office Macros remain a favorite delivery method. A Word document with embedded VBA macros can execute PowerShell commands, download secondary payloads, or establish reverse shells when the user enables "Edit Document." Attackers often use urgent language ("Invoice Overdue – Enable Editing to View") to trick users into activating macros.

PDFs can contain JavaScript or exploit vulnerabilities in PDF readers. While less common now due to sandboxing improvements, crafted PDFs can still execute actions or redirect users to credential harvesting sites.

Archives (.zip, .rar, .7z) serve multiple purposes: they bypass basic email filters that scan file extensions, compress payloads to evade signature detection, and hide malicious executables behind multiple layers (like invoice.pdf.exe compressed inside a .zip).

Evasion and Execution Techniques

Attackers use obfuscation to hide malicious code—encoding macros in Base64, using variable substitution, or splitting strings to evade pattern matching. Fileless techniques execute entirely in memory using legitimate tools like PowerShell, leaving minimal forensic traces.

Password-protected archives force the user to manually extract files, bypassing automated scanning. The password is typically provided in the email body, adding a layer of "legitimacy."

Modern payloads often use staged delivery: the initial attachment downloads a lightweight dropper that fingerprints the environment before fetching the actual malware, avoiding sandbox detection.

Key Takeaway: Malicious attachments leverage trusted file formats combined with social engineering and technical evasion (obfuscation, fileless execution, staged delivery) to bypass defenses and establish initial access—making user awareness and multi-layered detection critical.