Coder Social home page Coder Social logo

varrickkoh / idn-homograph-detector Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 248 KB

Detect IDN homographs and phishing domains

Home Page: https://intothethickof.it/2023/08/15/generating-and-detecting-phishing-domains-with-idn-homograph-attacks

License: MIT License

Python 100.00%
cybersecurity idn idn-homograph-attack infosec phishing python

idn-homograph-detector's Introduction

IDN Homograph Detector

The IDN Homograph Detector is a Python script used to detect homograph attacks of Internationalized Domain Names (IDNs). A write-up covering the concept of this script can be found at my blog at intothethickof.it.

The script uses a mapping of Unicode characters that are visually-similar to Latin letters and a list of keywords to check to detect possible IDN homograph attacks.

Some use-cases include:

  • Raising awareness of IDN homograph attacks
  • Monitoring of newly registered domains to detect IDN homograph attacks of your company/brand

Requirements

  1. The script was developed in Python 3.10.5 and requires the idna library which can be installed using pip:
pip install idna
  1. The script takes in as input a dictionary file (.txt file) which contains a mapping of Latin letters to visually-similar Unicode characters in their Hex values. The contents of the dictionary file should look like this:
a|0251|03B1|0430|203|...
b|13CF|1472|15AF|...
c|1D04|2CA5|0441|1043D|188|107...
.
.
.
x|0445|1541|157D|1E8D|3C7|...
y|0263|028F|03B3|0443|04AF|...
z|1D22|17A|17C|1E95|17E|...
  1. The script takes in as input a text file of keywords to monitor. Each keyword should be separated by a new line. The contents of the file should look like this:
google
facebook
youtube
twitter
instagram
linkedin
apple
microsoft
...
  1. The script takes in a text file of punycode domains to check. Each punycode domain should be separated by a new line. The contents of the file should look like this:
xn----ktbjphfiq9e1a.xn--p1acf
xn--65-1lc3f.xn--p1ai
xn--j1ai0c.com
xn--j1ai0c.store
xn--j1aij3c.xn--p1acf
xn--h1af0dg.xn--d1acj3b
xn--h1ahgigg2f.top
...

The contents of the dictionary can be adjusted depending on what is visually-similar to you. The input files will affect the output of the script and the amount of time/resources to complete the script as it will increase/decrease the number of possible IDN homographs. A free list of newly registered domains can be obtained from WhoisDS.

Usage

To run the script:

python idn_homograph_detector.py <dictionary_file> <keyword_file> <punycode_domains_file>

The script will output detected IDN homographs by printing the results to your console and saving them to a text file named detected_homograph.txt.

For example, the console will look like this:

detector_output

The detected_homograph.txt file will look like this:

detector_output_2

Disclaimer

THIS SCRIPT IS FOR EDUCATIONAL AND INFORMATIONAL PURPOSES ONLY. THE AUTHOR DOES NOT TAKE RESPONSIBILITY FOR ANY MISUSE, LOSS, OR DAMAGE CAUSED BY THE USE OF THIS SCRIPT.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.