TL;DR
This paper introduces a novel method for detecting homoglyph attacks, which use visually similar characters to disguise malicious domain or process names. By employing a Siamese Convolutional Neural Network (CNN) to learn visual string similarity from rendered images, the authors achieve significant improvements over traditional edit-distance methods, offering a more robust and efficient defense against these sophisticated spoofing techniques.
What Problem Does This Paper Address?
Cyber attackers frequently employ "homoglyph attacks" to deceive users and security systems. These attacks involve creating domain names or process names that look visually identical or very similar to legitimate ones. For example, an attacker might name a malicious process svchost.exe instead of the legitimate svchost.exe by using a visually similar character. Traditional methods for detecting these attacks often rely on string comparison algorithms like Levenshtein distance. However, these methods are computationally expensive, struggle with the vast number of possible character substitutions (especially with Unicode), and often result in a poor trade-off between false positives and false negatives. Existing research has also been hampered by a lack of publicly available datasets specifically for homoglyph detection, with many datasets focusing on broader phishing attacks where homoglyphs are not always the primary obfuscation technique.
Methods
The core innovation of this paper is the use of a Siamese Convolutional Neural Network (CNN). Instead of relying on character-by-character comparisons or predefined similarity rules, the Siamese CNN learns a metric for visual similarity directly from rendered strings. Here's how it works:
- String to Image Rendering: Process or domain names are converted into binary images using a standard font. This allows the CNN to "see" the visual appearance of the strings.
- Siamese Network Architecture: Two identical neural networks (sharing weights) process pairs of these rendered string images. The network is trained to output feature vectors for each image.
- Metric Learning: The Siamese network is trained using a contrastive loss function. The goal is to minimize the Euclidean distance between the feature vectors of visually similar string pairs (e.g., a legitimate name and its homoglyph) and maximize the distance between dissimilar pairs. This effectively teaches the network what "looks alike."
- KD-Tree Indexing: For efficient searching, the feature vectors of a large set of known "benign" names are indexed using randomized KD-Trees. This allows for extremely fast similarity searches.
- Detection: When a new name is encountered, it's converted to an image, then to a feature vector using the trained CNN. This feature vector is then queried against the KD-Tree index. If a feature vector with a Euclidean distance below a certain threshold is found, a homoglyph attack is flagged.
This approach moves beyond manual rules and edit distances to learn a nuanced understanding of visual similarity.
Datasets
The authors created two datasets for their experiments:
- Process Name Dataset: Constructed using file names (primarily
.exeand.dll) from the National Software Reference Library (NSRL). Benign pairs were generated by calculating edit distances (up to 3) between names. Malicious pairs were created by applying thousands of character swaps (ASCII and Unicode) to existing file names. - Domain Name Dataset: Similar to the process name dataset but generated from 100K active web domains. The edit distance restriction was removed for benign pairs, as many legitimate domains naturally have edit distances greater than 3 from each other.
Both datasets predominantly consist of ASCII characters, though the authors note this might not hold true for non-English contexts.
Key Insights and Ideas
- Visual Similarity is Key: The paper strongly emphasizes that detecting homoglyph attacks requires understanding visual similarity, which traditional string metrics often miss.
- Learned Metrics Outperform Manual Rules: The Siamese CNN's ability to learn a complex similarity metric from data significantly outperforms hand-crafted visual edit distance functions, which are difficult to create and maintain for the vast character space.
- Rendering Strings as Images is Effective: Treating strings as visual entities and using CNNs, a technique proven effective in image recognition, is a powerful approach for this problem.
- KD-Trees for Scalability: The use of KD-Trees is crucial for making the learned similarity metric practical for real-world applications, enabling fast searches over large datasets of potential targets.
- Homoglyphs vs. Phishing: The paper clearly distinguishes homoglyph attacks from other phishing techniques, noting that many phishing detection methods are not directly applicable because they don't focus on visual character similarity.
Key Results
The Siamese CNN approach demonstrated significant improvements over baseline methods:
- Process Name Detection: Achieved an Area Under the ROC Curve (AUC) of 0.83, compared to 0.57 for visual edit distance and 0.53 for standard edit distance.
- Domain Name Detection: Achieved an AUC of 0.97, compared to 0.89 for visual edit distance and 0.81 for standard edit distance.
- Overall Improvement: The Siamese CNN showed a 13% to 45% improvement over baseline techniques in terms of ROC AUC.
- Speed: The KD-Tree indexing allows for very fast similarity searches, significantly outperforming naive linear scans, especially for large datasets. The paper shows a good speed-recall trade-off with 128 checks.
- Visualization: PCA projections of feature vectors showed that legitimate domain names and their homoglyphs clustered tightly, indicating the model effectively captures visual distinctions.
Limitations and Future Work
- Dataset Bias: The datasets primarily use ASCII characters. The authors acknowledge that performance might differ in non-English speaking countries where Unicode characters are more prevalent in everyday use.
- KD-Tree Recall Degradation: While KD-Trees offer speed, they can lead to a slight degradation in recall, especially for process names with very similar clusters (e.g., versioned file names).
- Future Work: The authors suggest that further research could explore more advanced indexing techniques or different CNN architectures. They also provide their code and datasets to encourage further research in this area.
Summary updated