mirror of
https://github.com/FlipsideCrypto/eth-phishing-detect.git
synced 2026-02-06 11:16:45 +00:00
ignore www in fuzzy & add EAL whitelist and blacklist tests
This commit is contained in:
parent
2489f63b05
commit
36b5cba9d1
@ -59,11 +59,16 @@
|
||||
"myetherweb.com.de",
|
||||
"myetherieumwallet.com",
|
||||
"myethervallet.com",
|
||||
"myetherwallet.com.cm",
|
||||
"myetherwallet.com.co",
|
||||
"myetherwallet.com.de",
|
||||
"myetherwallet.com.gl",
|
||||
"myetherwallet.com.im",
|
||||
"myetherwallet.com.ua",
|
||||
"xn--mytherwallet-fvb.com",
|
||||
"xn--myetherwallt-7db.com",
|
||||
"xn--myetherwallt-leb.com",
|
||||
"xn--myetherwallt-yeb.com",
|
||||
"secure-myetherwallet.com",
|
||||
"update-myetherwallet.com",
|
||||
"etherclassicwallet.com",
|
||||
|
||||
@ -22,7 +22,10 @@ class PhishingDetector {
|
||||
if (blacklistMatch) return { type: 'blacklist', result: true }
|
||||
|
||||
// check if near-match of whitelist domain, FAIL
|
||||
const fuzzyForm = domainPartsToFuzzyForm(source)
|
||||
let fuzzyForm = domainPartsToFuzzyForm(source)
|
||||
// strip www
|
||||
fuzzyForm = fuzzyForm.replace('www.', '')
|
||||
// check against fuzzylist
|
||||
const levenshteinMatched = this.fuzzylist.find((targetParts) => {
|
||||
const fuzzyTarget = domainPartsToFuzzyForm(targetParts)
|
||||
const distance = levenshtein.get(fuzzyForm, fuzzyTarget)
|
||||
|
||||
3256
test/ealBlacklist.json
Normal file
3256
test/ealBlacklist.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -3,6 +3,8 @@ const PhishingDetector = require("../src/detector")
|
||||
const config = require("../src/config.json")
|
||||
const alexaTopSites = require("./alexa.json")
|
||||
const popularDapps = require("./dapps.json")
|
||||
const ealWhitelist = require("./ealWhitelist.json")
|
||||
const ealBlacklist = require("./ealBlacklist.json")
|
||||
const detector = new PhishingDetector(config)
|
||||
|
||||
|
||||
@ -121,6 +123,16 @@ test("popular dapps", (t) => {
|
||||
t.end()
|
||||
})
|
||||
|
||||
test("eal whitelist", (t) => {
|
||||
testAnyType(t, false, ealWhitelist)
|
||||
t.end()
|
||||
})
|
||||
|
||||
test("eal blacklist", (t) => {
|
||||
testAnyType(t, true, ealBlacklist.filter((domain) => !domain.includes('/')))
|
||||
t.end()
|
||||
})
|
||||
|
||||
|
||||
function testBlacklist(t, domains) {
|
||||
domains.forEach((domain) => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user