Skip to main content

Enumerate possible ASCII text being spoofed by a particular IDN domain name

Project description

xn-reverser

Enumerate possible ASCII text being spoofed by a particular IDN domain name

How it works

The basic algorithm for how this library works is as follows:

  • Convert raw xn-- IDN domain to Unicode representation (using idna library)
  • For each Unicode char in the domain:
  • Check a pre-built mapping for possible ASCII characters that look similar to the Unicode character (i.e. plaintext ASCII characters that the Unicode character could be spoofing)
  • Compute the Cartesian product of the character lists (using itertools.product) to generate the possible plaintext domain names

Usage

import xn_reverser

result = xn_reverser.xn_reverser("xn--80ak6aa92e.com")
print(result["possible_spoofed_ascii"])

xn_reverser() returns a dict containing the following elements:

  • domain_raw (string): the actual xn-- raw IDN domain provided as the input
  • domain_idn_rendered (string): the rendered Unicode form of the IDN domain
  • possible_spoofed_ascii (list): a list of possible ASCII domains converted from the IDN form

Caveats

  • Does not parse subdomains. Must provide a base domain

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xn_reverser-1.0.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file xn_reverser-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: xn_reverser-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for xn_reverser-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d4254a36b24b76b624b8fe3bb67a5677ff3dc696198be294701b11ff79c7645d
MD5 e387777cd59c6f9c5d2343878a83089c
BLAKE2b-256 1a85ade2105f5ec1cec720762b01e9e80835bb0f2b505ed9f988c890ed1f9d22

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page