Social Engineering & Adversarial Obfuscation
in Business Email Compromise (BEC) Attacks
I analyzed how Unicode-based adversarial techniques (homoglyphs and zero-width characters) break keyword-based phishing detection, and built a character-level model that reliably detects these obfuscation patterns in BEC phishing emails.
Total BEC emails
4,181
Synthetic BEC phishing samples
Adversarially modified
≈ 29%
Homoglyphs + zero-width Unicode
Keyword detector evasion
81.3%
Flagged when clean → missed when poisoned
Obfuscation detector accuracy
95.4%
Char n-gram TF-IDF + Logistic Regression
Project Pipeline
End-to-end workflow from data generation to adversarial detection and explanation.
- 01
Dataset construction
Used paired BEC emails (clean vs poisoned) with Unicode homoglyphs and zero-width characters to simulate realistic obfuscation attacks.
- 02
Social-engineering analysis
Quantified financial/urgency keywords, authority and politeness tone, and obligation language that drive BEC persuasion.
- 03
Evasion of rule-based detectors
Showed that simple keyword/risk-score detectors suffer 70–90% signal loss and 81.3% evasion under adversarial obfuscation.
- 04
Adversarial obfuscation detector
Trained character-level TF-IDF + Logistic Regression on poisoned text to detect Unicode artifacts with ~95% accuracy.
- 05
Model interpretability
Inspected top character n-grams to reveal reliance on homoglyph sequences and zero-width Unicode patterns rather than topic semantics.
Keyword Signal LossAdversarial Impact
How much keyword-based detection breaks under Unicode obfuscation (modified emails only).
In the worst cases, surface-level keyword matches for critical financial terms like "invoice" and "immediately" drop by more than 90%.
Model Comparison
Clean-text models struggle to predict which emails will be obfuscated. Models trained directly on poisoned text learn Unicode artifacts and perform strongly.
| Model | Input | Primary Signal | F1 (modified class) | Notes |
|---|---|---|---|---|
| Word TF-IDF + LR (clean text) | Clean BEC body | Semantics / keywords | ≈ 0.29 | Weak signal – style similar across emails |
| Char TF-IDF + LR (clean text) | Clean BEC body | Character style | ≈ 0.29 | Limited ability to predict which emails get obfuscated |
| Char TF-IDF + LR (poisoned text) | Poisoned BEC body | Unicode artifacts | ≈ 0.92 | Strong detector for homoglyphs & zero-width tricks |
Key Insights
- Unicode obfuscation can remove **70–90%** of surface keyword signal while keeping BEC emails understandable to humans.
- A simple risk-score detector based on finance/urgency keywords suffers an 81.3% evasion rate on modified emails.
- Character-level models trained on poisoned text achieve **~95% accuracy** and **~0.92 F1** on detecting adversarially modified emails.
- Top model features reveal reliance on homoglyph sequences and zero-width Unicode, confirming that the model is detecting obfuscation artifacts, not topics.
- This suggests a layered defense strategy: semantic phishing detection augmented by a dedicated Unicode obfuscation detector.
Tech Stack
Tools and concepts I used to build and analyze this project.