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

Bugfix/afqdn check #6891

Merged
merged 4 commits into from
Mar 22, 2022
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: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eth-phishing-detect",
"version": "1.1.15",
"version": "1.1.16",
"description": "Utility for detecting phishing domains targeting Ethereum users",
"main": "src/index.js",
"scripts": {
Expand Down
6 changes: 5 additions & 1 deletion src/detector.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ class PhishingDetector {
}

check (domain) {
const source = domainToParts(domain)
let fqdn = domain.substring(domain.length - 1) === "."
? domain.slice(0, -1)
: domain;

const source = domainToParts(fqdn)

// if source matches whitelist domain (or subdomain thereof), PASS
const whitelistMatch = matchPartsAgainstList(source, this.whitelist)
Expand Down
1 change: 1 addition & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function startTests () {
"metamask.com",
"wallet-ethereum.net",
"etherclassicwallet.com",
"wallet-ethereum.net." //Test for absolute fully-qualified domain name
])

// whitelist
Expand Down