Abstract
Spammers frequently employ "salting" techniques—adding invisible or distorted content—to bypass traditional text-based filters. This paper introduces a novel detection framework that compares an email's structural "simulated perceived text" with its actual visual rendering via Optical Character Recognition (OCR). By treating discrepancies between these two views as outliers using a One-Class Support Vector Machine (SVM), the system can identify both established and previously unseen obfuscation tricks. Evaluation on public datasets shows high effectiveness, particularly in detecting font-based manipulations.
The Challenge of Email Salting
The battle against spam and phishing is a persistent cat-and-mouse game. A common tactic is salting, where attackers intentionally add content to fool automated filters. This includes "good word attacks" (diluting spam signatures with legitimate text) and "hidden salting" (using white text on white backgrounds or microscopic fonts).
Traditional filters often fail because they analyze raw HTML or text streams, which differ significantly from what a human recipient sees. As shown in Figure 1, a spammer can embed "invisible" keywords like "drywall" into the HTML source to confuse filters, while the human reader only sees the intended message.
Methodology: Closing the Perception Loop
The proposed framework "closes the loop" between machine analysis and human perception through a three-stage process:
- Hidden Salting Simulation: The system analyzes the email's HTML structure to simulate what a human would perceive, filtering out elements with no contrast or those clipped outside the viewing area.
- OCR Rendering: The email is rendered as an image and processed by an OCR engine (e.g.,
gocrorocrad) to establish the visual "ground truth." - Change Detection: The simulated text and OCRed text are compared using three metrics: Length (normalized difference), Tolerant Overlap Coefficient (TOC) (fuzzy matching robust to OCR errors), and Complexity (Lempel-Ziv compression-based measure).
Finally, a One-Class SVM is trained on "normal" emails. Any significant divergence between the simulated and OCRed text is flagged as an outlier, allowing the system to detect even novel tricks not present in the training data.
Experimental Results
The system was evaluated using the SpamAssassin and Nazario Phishing corpora. The researchers focused on identifying "font color" and "font size" tricks, which are prevalent in modern spam.
Key findings include:
- High Detection Accuracy: Using the
gocrengine, the system achieved an F2-score of 84.15% for font color tricks and 87.08% for font size tricks. - OCR Engine Sensitivity: The choice of OCR engine is critical. As seen in Figure 3,
gocrconsistently outperformedocrad, which struggled with specific layouts and character spacings common in salted emails. - TOC Effectiveness: The Tolerant Overlap Coefficient (TOC) proved to be the most robust metric, successfully handling the inherent noise of OCR digitization.
Limitations and Future Work
While effective, the system faces computational challenges. Rendering and OCR processing are currently too slow for real-time filtering. Instead, this approach is best suited for offline analysis to identify new trends and update faster, signature-based filters. Future improvements may involve using commercial-grade OCR engines and more sophisticated HTML binarization to reduce false negatives caused by layout misinterpretations.
Summary updated