[or-cvs] [https-everywhere/master] try to detect homoglyph attacks by finding non-ASCII characters in rules

schoen at torproject.org schoen at torproject.org
Sun Oct 31 09:09:53 UTC 2010


Author: Seth Schoen <schoen at eff.org>
Date: Sun, 31 Oct 2010 02:09:38 -0700
Subject: try to detect homoglyph attacks by finding non-ASCII characters in rules
Commit: c0a0cb4759e8b581d3b28fa407aa76467767be47

---
 pending-rules/trivial-validate |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/pending-rules/trivial-validate b/pending-rules/trivial-validate
index 7a10988..4087338 100755
--- a/pending-rules/trivial-validate
+++ b/pending-rules/trivial-validate
@@ -32,3 +32,15 @@ then
 else
   echo "-- Could not check XML validity because xmllint not found."
 fi
+echo
+echo "-- Rules containing non-ASCII characters (possible homoglyph attacks):"
+none=true
+for i in *.xml
+do
+  if egrep '(from|to)=' "$i" | tr -d '[:print:]' | tr -d '[:space:]' | grep . >/dev/null
+  then
+    echo "$i contains non-ASCII character(s)."
+    none=false
+  fi
+done
+$none && echo "(None.)"
-- 
1.7.1



More information about the tor-commits mailing list