Skip to content

Detecting Homoglyph Attacks with CNN model using Computer Vision method

License

Notifications You must be signed in to change notification settings

jackaduma/HomoglyphAttacksDetector

Repository files navigation

Homoglyph Attacks Detector

Detecting Homoglyph Attacks with CNN model using Computer Vision method

standard-readme compliant Donate

中文说明 | English


This code is an implementation for paper: Detecting Homoglyph Attacks with a Siamese Neural Network, a nice work on **Detecting Homoglyph Attacks **.

  • Dataset
  • Usage
    • Training
    • Inference
  • Demo
  • Reference

Detecting Homoglyph Attacks with a Siamese Neural Network

A homoglyph (name spoofing) attack is a common technique used by adversaries to obfuscate file and domain names. This technique creates process or domain names that are visually similar to legitimate and recognized names. For instance, an attacker may create malware with the name svch0st.exe so that in a visual inspection of running processes or a directory listing, the process or file name might be mistaken as the Windows system process svchost.exe. There has been limited published research on detecting homoglyph attacks. Current approaches rely on string comparison algorithms (such as Levenshtein distance) that result in computationally heavy solutions with a high number of false positives. In addition, there is a deficiency in the number of publicly available datasets for reproducible research, with most datasets focused on phishing attacks, in which homoglyphs are not always used. This paper presents a fundamentally different solution to this problem using a Siamese convolutional neural network (CNN). Rather than leveraging similarity based on character swaps and deletions, this technique uses a learned metric on strings rendered as images: a CNN learns features that are optimized to detect visual similarity of the rendered strings. The trained model is used to convert thousands of potentially targeted process or domain names to feature vectors. These feature vectors are indexed using randomized KD-Trees to make similarity searches extremely fast with minimal computational processing. This technique shows a considerable 13% to 45% improvement over baseline techniques in terms of area under the receiver operating characteristic curve (ROC AUC). In addition, we provide both code and data to further future research.


This repository contains:

  1. vision model code which implemented the paper.
  2. training scripts to train the model.
  3. inference scripts - to inference.

Table of Contents


Requirement

requirements.txt

Usage

train

python run_homo.py

inference

python run_infer.py

Pretrained

a pretrained model in output dir:

process_cnn.h5

process_cnn.json


Demo

demo.ipynb

Reference

  1. Detecting Homoglyph Attacks with a Siamese Neural Network. Paper
  2. offical code project: homoglyph. Project

Donation

If this project help you reduce time to develop, you can give me a cup of coffee :)

AliPay(支付宝)

ali_pay

WechatPay(微信)

wechat_pay

paypal


License

MIT © Kun