Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added homoglyph support #35

Merged
merged 4 commits into from
Jan 24, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Features
* Geographic IP to flag
* Google safe browsing integration
* Bit flipping / squatting - http://dinaburg.org/bitsquatting.html
* Homoglyph attack identification
* Whois

Dependencies
Expand All @@ -50,6 +51,7 @@ What it does
* replace characters with adjacent keyboard characters depending on keyboard map supplied
* swap the global TLD for each of the current valid TLDs list at - http://data.iana.org/TLD/tlds-alpha-by-domain.txt
* flip bits in the legit domain to detect the bitsquatting attacks
* swaps characters with similar looking characters to find homoglyph attacks
* checks web sites against Google's Safe Browsing API<sup>1</sup>

Usage
Expand Down
6 changes: 4 additions & 2 deletions TypoMagic/TypoMagic.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,10 @@ def do_POST(self):

bBitFlip = 'bitflip' in post_data

bHomoglyphs = 'homoglyph' in post_data

# stupid user
if(bTypos == False and bTLD == False and bBitFlip == False):
if(not bTypos and not bTLD and not bBitFlip and not bHomoglyphs):
print("[i] No typos to process for " + strHost + " due to user option")
# this will cause an error in the JavaScript client which is relied upon
self.output("[!] No typos for " + strHost)
Expand All @@ -190,7 +192,7 @@ def do_POST(self):
# domain name validation
if _typogen.is_domain_valid(strHost):
print("[i] Processing typos for " + strHost)
lstTypos = _typogen.generatetyposv2(strHost, "gb", bTypos, iTypoIntensity, bTLD, bBitFlip)
lstTypos = _typogen.generatetyposv2(strHost, "gb", bTypos, iTypoIntensity, bTLD, bBitFlip, bHomoglyphs)
if lstTypos is not None:
self.output(json.dumps([strTypoHost for strTypoHost in lstTypos]))
else:
Expand Down
Loading