├── .github └── workflows │ └── main.yml ├── .gitignore ├── Gemfile ├── Gemfile.lock ├── MIT-LICENSE ├── README.md ├── bin ├── console ├── generate_allowed_idn_characters ├── generate_digits_characters ├── release └── test ├── homographic_spoofing.gemspec ├── lib ├── homographic_spoofing.rb └── homographic_spoofing │ ├── detector │ ├── base.rb │ ├── detection.rb │ ├── email_address.rb │ ├── idn.rb │ ├── local.rb │ ├── quoted_string.rb │ └── rule │ │ ├── base.rb │ │ ├── context.rb │ │ ├── data │ │ ├── allowed_idn_characters.txt │ │ └── digits.csv │ │ ├── disallowed_characters.rb │ │ ├── idn │ │ ├── base.rb │ │ ├── context.rb │ │ ├── dangerous_pattern.rb │ │ ├── deviation_characters.rb │ │ ├── digits.rb │ │ ├── invisible_characters.rb │ │ ├── script_confusable.rb │ │ ├── script_specific.rb │ │ └── unsafe_middle_dot.rb │ │ ├── local │ │ ├── dot_atom_text.rb │ │ └── nfkc.rb │ │ ├── mixed_digits.rb │ │ ├── mixed_scripts.rb │ │ └── quoted_string │ │ ├── bidi_control.rb │ │ ├── data │ │ └── nonspacing_marks.txt │ │ ├── nfc.rb │ │ └── nonspacing_marks.rb │ ├── railtie.rb │ ├── sanitizer │ ├── base.rb │ ├── email_address.rb │ ├── idn.rb │ └── quoted_string.rb │ └── version.rb └── test ├── detector ├── email_address_test.rb ├── idn_test.rb ├── local_test.rb └── quoted_string_test.rb ├── sanitizer ├── email_address_test.rb ├── idn_test.rb └── quoted_string_test.rb └── test_helper.rb /.github/workflows/main.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/.github/workflows/main.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .byebug_history 2 | *.gem 3 | coverage/* 4 | .DS_Store 5 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/Gemfile -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/Gemfile.lock -------------------------------------------------------------------------------- /MIT-LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/MIT-LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/README.md -------------------------------------------------------------------------------- /bin/console: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/bin/console -------------------------------------------------------------------------------- /bin/generate_allowed_idn_characters: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/bin/generate_allowed_idn_characters -------------------------------------------------------------------------------- /bin/generate_digits_characters: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/bin/generate_digits_characters -------------------------------------------------------------------------------- /bin/release: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/bin/release -------------------------------------------------------------------------------- /bin/test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/bin/test -------------------------------------------------------------------------------- /homographic_spoofing.gemspec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/homographic_spoofing.gemspec -------------------------------------------------------------------------------- /lib/homographic_spoofing.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/base.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/base.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/detection.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/detection.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/email_address.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/email_address.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/idn.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/idn.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/local.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/local.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/quoted_string.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/quoted_string.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/rule/base.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/rule/base.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/rule/context.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/rule/context.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/rule/data/allowed_idn_characters.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/rule/data/allowed_idn_characters.txt -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/rule/data/digits.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/rule/data/digits.csv -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/rule/disallowed_characters.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/rule/disallowed_characters.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/rule/idn/base.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/rule/idn/base.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/rule/idn/context.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/rule/idn/context.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/rule/idn/dangerous_pattern.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/rule/idn/dangerous_pattern.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/rule/idn/deviation_characters.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/rule/idn/deviation_characters.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/rule/idn/digits.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/rule/idn/digits.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/rule/idn/invisible_characters.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/rule/idn/invisible_characters.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/rule/idn/script_confusable.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/rule/idn/script_confusable.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/rule/idn/script_specific.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/rule/idn/script_specific.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/rule/idn/unsafe_middle_dot.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/rule/idn/unsafe_middle_dot.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/rule/local/dot_atom_text.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/rule/local/dot_atom_text.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/rule/local/nfkc.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/rule/local/nfkc.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/rule/mixed_digits.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/rule/mixed_digits.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/rule/mixed_scripts.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/rule/mixed_scripts.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/rule/quoted_string/bidi_control.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/rule/quoted_string/bidi_control.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/rule/quoted_string/data/nonspacing_marks.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/rule/quoted_string/data/nonspacing_marks.txt -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/rule/quoted_string/nfc.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/rule/quoted_string/nfc.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/detector/rule/quoted_string/nonspacing_marks.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/detector/rule/quoted_string/nonspacing_marks.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/railtie.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/railtie.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/sanitizer/base.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/sanitizer/base.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/sanitizer/email_address.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/sanitizer/email_address.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/sanitizer/idn.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/sanitizer/idn.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/sanitizer/quoted_string.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/lib/homographic_spoofing/sanitizer/quoted_string.rb -------------------------------------------------------------------------------- /lib/homographic_spoofing/version.rb: -------------------------------------------------------------------------------- 1 | module HomographicSpoofing 2 | VERSION = "0.1.2" 3 | end 4 | -------------------------------------------------------------------------------- /test/detector/email_address_test.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/test/detector/email_address_test.rb -------------------------------------------------------------------------------- /test/detector/idn_test.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/test/detector/idn_test.rb -------------------------------------------------------------------------------- /test/detector/local_test.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/test/detector/local_test.rb -------------------------------------------------------------------------------- /test/detector/quoted_string_test.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/test/detector/quoted_string_test.rb -------------------------------------------------------------------------------- /test/sanitizer/email_address_test.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/test/sanitizer/email_address_test.rb -------------------------------------------------------------------------------- /test/sanitizer/idn_test.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/test/sanitizer/idn_test.rb -------------------------------------------------------------------------------- /test/sanitizer/quoted_string_test.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/test/sanitizer/quoted_string_test.rb -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/basecamp/homographic_spoofing/HEAD/test/test_helper.rb --------------------------------------------------------------------------------