Talk to Me
Research Project · Security · NLP · Adversarial ML
View on GitHub

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.

CybersecurityNatural Language ProcessingAdversarial Machine LearningModel Interpretability

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.

  1. 01

    Dataset construction

    Used paired BEC emails (clean vs poisoned) with Unicode homoglyphs and zero-width characters to simulate realistic obfuscation attacks.

  2. 02

    Social-engineering analysis

    Quantified financial/urgency keywords, authority and politeness tone, and obligation language that drive BEC persuasion.

  3. 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.

  4. 04

    Adversarial obfuscation detector

    Trained character-level TF-IDF + Logistic Regression on poisoned text to detect Unicode artifacts with ~95% accuracy.

  5. 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).

invoice≈ 93% drop
immediately≈ 89% drop
payment≈ 81% drop
account≈ 80% drop
confirm≈ 78% drop

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.

Character-level modeling · Logistic Regression
ModelInputPrimary SignalF1 (modified class)Notes
Word TF-IDF + LR (clean text)Clean BEC bodySemantics / keywords≈ 0.29Weak signal – style similar across emails
Char TF-IDF + LR (clean text)Clean BEC bodyCharacter style≈ 0.29Limited ability to predict which emails get obfuscated
Char TF-IDF + LR (poisoned text)Poisoned BEC bodyUnicode artifacts≈ 0.92Strong 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.

PythonPandasScikit-learnNLPAdversarial MLUnicode / HomoglyphsCharacter-level modeling