{"id":19589710,"url":"https://github.com/jackaduma/homoglyphattacksdetector","last_synced_at":"2025-10-13T17:05:17.966Z","repository":{"id":72236966,"uuid":"411712214","full_name":"jackaduma/HomoglyphAttacksDetector","owner":"jackaduma","description":"Detecting Homoglyph Attacks with CNN model using Computer Vision method","archived":false,"fork":false,"pushed_at":"2021-09-29T17:26:40.000Z","size":39454,"stargazers_count":11,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-27T12:33:49.046Z","etag":null,"topics":["cnn","cyber-security","cybersecurity","deep-learning","deep-neural-networks","deeplearning","keras","keras-neural-networks","machine-learning","phishing","phishing-attacks","phishing-detection","siamese-network","siamese-neural-network","spoofing","spoofing-attack"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jackaduma.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-29T14:41:59.000Z","updated_at":"2024-01-24T16:26:59.000Z","dependencies_parsed_at":"2023-02-25T18:30:13.380Z","dependency_job_id":null,"html_url":"https://github.com/jackaduma/HomoglyphAttacksDetector","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jackaduma/HomoglyphAttacksDetector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackaduma%2FHomoglyphAttacksDetector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackaduma%2FHomoglyphAttacksDetector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackaduma%2FHomoglyphAttacksDetector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackaduma%2FHomoglyphAttacksDetector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jackaduma","download_url":"https://codeload.github.com/jackaduma/HomoglyphAttacksDetector/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackaduma%2FHomoglyphAttacksDetector/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267693681,"owners_count":24129134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cnn","cyber-security","cybersecurity","deep-learning","deep-neural-networks","deeplearning","keras","keras-neural-networks","machine-learning","phishing","phishing-attacks","phishing-detection","siamese-network","siamese-neural-network","spoofing","spoofing-attack"],"created_at":"2024-11-11T08:20:21.390Z","updated_at":"2025-10-13T17:05:12.909Z","avatar_url":"https://github.com/jackaduma.png","language":"Jupyter Notebook","funding_links":["https://paypal.me/jackaduma?locale.x=zh_XC"],"categories":[],"sub_categories":[],"readme":"# **Homoglyph Attacks Detector**\n\nDetecting Homoglyph Attacks with CNN model using Computer Vision method\n\n[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/jackaduma/HomoglyphAttacksDetector)\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/jackaduma?locale.x=zh_XC)\n\n[**中文说明**](./README.zh-CN.md) | [**English**](./README.md)\n\n------\n\nThis code is an implementation for paper: [Detecting Homoglyph Attacks with a Siamese\nNeural Network](https://arxiv.org/abs/1805.09738), a nice work on **Detecting Homoglyph Attacks **.\n\n- [x] Dataset\n  - [x] offical dataset. [process](./homo-data/process_spoof.pkl), [domain](./homo-data/domains_spoof.pkl)\n- [x] Usage\n  - [x] Training\n  - [x] Inference \n- [x] Demo\n- [x] Reference\n\n------\n\n## **Detecting Homoglyph Attacks with a Siamese Neural Network**\n\n### [**Paper Page**](https://arxiv.org/abs/1805.09738)\n\n\nA 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.\n\n\n------\n\n**This repository contains:** \n\n1. [vision model code](./vision_models/siamese_cnn.py) which implemented the paper.\n2. [training scripts](./run_homo.py) to train the model.\n3. [inference scripts](./infer_homo.py) - to inference.\n\n------\n\n## **Table of Contents**\n\n- [**Homoglyph Attacks Detector**](#homoglyph-attacks-detector)\n  - [**Detecting Homoglyph Attacks with a Siamese Neural Network**](#detecting-homoglyph-attacks-with-a-siamese-neural-network)\n    - [**Paper Page**](#paper-page)\n  - [**Table of Contents**](#table-of-contents)\n  - [**Requirement**](#requirement)\n  - [**Usage**](#usage)\n    - [**train**](#train)\n    - [**inference**](#inference)\n  - [**Pretrained**](#pretrained)\n  - [**Demo**](#demo)\n  - [**Reference**](#reference)\n  - [Donation](#donation)\n  - [**License**](#license)\n  \n------\n\n\n\n## **Requirement** \n\n```bash\nrequirements.txt\n```\n## **Usage**\n\n### **train**\n\n```python\npython run_homo.py\n```\n\n\n\n### **inference** \n```python\npython run_infer.py\n```\n\n------\n\n## **Pretrained**\n\na pretrained model in [output](./output) dir:\n\n[process_cnn.h5](./output/process_cnn.h5)\n\n[process_cnn.json](./output/process_cnn.json)\n\n\n------\n\n## **Demo**\n\n```\ndemo.ipynb\n```\n\n------\n\n## **Reference**\n1. **Detecting Homoglyph Attacks with a Siamese Neural Network**. [Paper](https://arxiv.org/abs/1805.09738)\n2. offical code project: **homoglyph**.  [Project](https://github.com/endgameinc/homoglyph)\n\n\n------\n\n## Donation\nIf this project help you reduce time to develop, you can give me a cup of coffee :) \n\nAliPay(支付宝)\n\u003cdiv align=\"center\"\u003e\n\t\u003cimg src=\"./misc/ali_pay.png\" alt=\"ali_pay\" width=\"400\" /\u003e\n\u003c/div\u003e\n\nWechatPay(微信)\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"./misc/wechat_pay.png\" alt=\"wechat_pay\" width=\"400\" /\u003e\n\u003c/div\u003e\n\n[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://paypal.me/jackaduma?locale.x=zh_XC)\n\n------\n\n## **License**\n\n[MIT](LICENSE) © Kun\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackaduma%2Fhomoglyphattacksdetector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjackaduma%2Fhomoglyphattacksdetector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackaduma%2Fhomoglyphattacksdetector/lists"}