-
-
Notifications
You must be signed in to change notification settings - Fork 604
Created domain typosquatting checker #1644
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
base: master
Are you sure you want to change the base?
Created domain typosquatting checker #1644
Conversation
|
Thanks for the PR. Its a nice concept but my concern is with false positives. Have you done any analysis for that? |
|
The 75 is a good enough number. Depending on the case, users can make it stricter but several tests has shown this is good enough. Any threshold lower than 75 would be too much noise. I first considered having a detect-only mod but if we don't do blocking, we cannot enrich logging. So, my initial plan failed. Because we return I will add one more change today. It rebuilds the fuzzy search and bloom filter capabilities very often while the file has not changed. I'll keep a hash of the file and return early if the file has not changed for some time. |
Its possible to do that by querying the DNS server from the app itself and then add EDE for it. But since nobody is practically going to read that EDE message, its not really useful. So blocking it the only practical way to make it effective. Will check the app once I have some time available. My only major concern is false positives which has potential to generate too many support requests. The other minor concern is sourcing the csv data which adds maintenance task if its self hosted and not sourced directly from some reliable 3rd party. |
|
I agree with the CSV issue. It's a replacement of Alexa Top 1M list. If this becomes obsolete, I'd replace it with a new one. Second list, the custom one is expected to be a single column with no header. For me, it would contain only "zaferbalkan.com", for instance. So, it is a combination of a dynamic and a static list. |
|
Another thing is that I first used the enums like HIGH, MEDIUM, etc., but then moved to a numeric threshold for fine tuning. Those Enums are now only for adding metadata so that user can have some actionable insight. I'd write the description more detailed. Users must be careful. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a new DNS application called "TyposquattingDetector" that helps protect against phishing by detecting potential typosquatting domain queries. The detector uses fuzzy string matching against a list of the top 1 million legitimate domains (from Majestic) to identify domains that are suspiciously similar but not exact matches, blocking them with extended DNS error responses.
- Implements a bloom filter and fuzzy matching algorithm to detect typosquatting attempts
- Downloads and maintains the Majestic Million domain list with periodic updates
- Provides configurable thresholds and blocking behavior with extended DNS error codes
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 26 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Adds SonarCloud quality gate badge |
| DnsServer.sln | Adds TyposquattingDetector project to solution and updates VS version |
| Apps/TyposquattingDetector/dnsApp.config | Configuration file defining default settings for fuzzy matching, update intervals, and blocking behavior |
| Apps/TyposquattingDetector/TyposquattingDetector.csproj | Project file with dependencies for bloom filter, fuzzy matching, and public suffix parsing |
| Apps/TyposquattingDetector/TyposquattingDetector.cs | Core detection logic implementing bloom filter prefiltering and parallel fuzzy matching |
| Apps/TyposquattingDetector/Config.cs | Configuration class with validation for settings including domain file paths and update intervals |
| Apps/TyposquattingDetector/App.cs | Main application entry point implementing DNS request blocking handler with periodic domain list updates |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 16 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ck to avoid missing second-character typos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Zafer Balkan <zafer@zaferbalkan.com>
|
Fixing concurrency issues took time but finally made it work. |
Summary
This is a simple app which may be helpful or phishing domains:
Example output
For
microsoft.com:For
rnicrosoft.com:Reference