Skip to content

Commit

Permalink
Updated homoglyph fuzzer: shorter window
Browse files Browse the repository at this point in the history
  • Loading branch information
elceef committed Sep 16, 2023
1 parent de727cf commit 88d1767
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dnstwist.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,12 +678,12 @@ def _homoglyph(self):
md = lambda a, b: {k: set(a.get(k, [])) | set(b.get(k, [])) for k in set(a.keys()) | set(b.keys())}
glyphs = md(self.glyphs_ascii, self.glyphs_idn_by_tld.get(self.tld, self.glyphs_unicode))
def mix(domain):
for w in range(1, len(domain)):
for w in (1, 2):
for i in range(len(domain)-w+1):
pre = domain[:i]
win = domain[i:i+w]
suf = domain[i+w:]
for c in (set(win) | {win[:2]}):
for c in (set(win) | {win}):
for g in glyphs.get(c, []):
yield pre + win.replace(c, g) + suf
result1 = set(mix(self.domain))
Expand Down

0 comments on commit 88d1767

Please sign in to comment.