Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eth-phishing-detect

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eth-phishing-detect - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

test/dapps.json

2

package.json
{
"name": "eth-phishing-detect",
"version": "1.0.2",
"version": "1.1.0",
"description": "Utility for detecting phishing domains targeting Ethereum users",

@@ -5,0 +5,0 @@ "main": "src/index.js",

# eth-phishing-detect
[![Greenkeeper badge](https://badges.greenkeeper.io/MetaMask/eth-phishing-detect.svg)](https://greenkeeper.io/)
Utility for detecting phishing domains targeting Ethereum users.

@@ -19,3 +21,3 @@

const detector = new PhishingDetector({ whitelist, blacklist, tolerance })
const detector = new PhishingDetector({ whitelist, blacklist, fuzzylist, tolerance })
const value = detector.check('etherclassicwallet.com')

@@ -22,0 +24,0 @@ console.log(value)

{
"tolerance": 4,
"fuzzylist": [
"ethereum.org",
"metamask.io",
"myetherwallet.com"
],
"whitelist": [
"ethereum.org",
"metamask.io",

@@ -7,7 +14,12 @@ "myetherwallet.com",

"myetherapi.com",
"ledgerwallet.com"
"ledgerwallet.com",
"etherscan.io",
"etherid.org",
"ether.cards",
"etheroll.com",
"ethnews.com",
"ethex.market"
],
"blacklist": [
"wallet-ethereum.net",
"myelherwallel.com",
"etherswap.org",

@@ -17,29 +29,12 @@ "eos.ac",

"ziber.io",
"mvetherwallet.com",
"etherswap.org",
"myethewallet.net",
"multiply-ethereum.info",
"bittrex.comze.com",
"karbon.vacau.com",
"xn--myetherwallt-7db.com",
"xn--myetherwallt-leb.com",
"etherdelta.gitlhub.io",
"etherdelta.glthub.io",
"myethewallet.net",
"myetherwillet.com",
"digitaldevelopersfund.vacau.com",
"myetherwallel.com",
"myeltherwallet.com",
"myelherwallet.com",
"wwwmyetherwallet.com",
"myethermwallet.com",
"district-0x.io",
"coin-dash.com",
"coindash.ru",
"myethervallet.com",
"myetherwallet.com.gl",
"myetherwallet.com.ua",
"myÄ—therwallet.com",
"myetherwallet.com.gl",
"xn--mytherwallet-fvb.com",
"district0x.net",

@@ -50,36 +45,18 @@ "aragonproject.io",

"contribute-status.im",
"secure-myetherwallet.com",
"update-myetherwallet.com",
"ether-api.com",
"ether-wall.com",
"mycoinwallet.net",
"etherclassicwallet.com",
"ethereumchamber.com",
"ethereumchamber.net",
"ethereumchest.com",
"myethervvallet.com",
"metherwallet.com",
"mtetherwallet.com",
"my-etherwallet.com",
"my-etherwallet.in",
"myeherwallet.com",
"myetcwallet.com",
"myetehrwallet.com",
"myeterwallet.com",
"myethe.rwallet.com",
"myethereallet.com",
"myetherieumwallet.com",
"myetherswallet.com",
"myetherw.allet.com",
"myetherwal.let.com",
"myetherwalet.com",
"myetherwaliet.com",
"myetherwall.et.com",
"myetherwaller.com",
"myetherwallett.com",
"myetherwaillet.com",
"myetherwalllet.com",
"myetherweb.com.de",
"myethetwallet.com",
"myethewallet.com",
"myethervallet.com",
"myetherwallet.com.gl",
"myetherwallet.com.ua",
"xn--mytherwallet-fvb.com",
"xn--myetherwallt-7db.com",
"xn--myetherwallt-leb.com",
"secure-myetherwallet.com",
"update-myetherwallet.com",
"etherclassicwallet.com",
"omg-omise.co",

@@ -86,0 +63,0 @@ "omise-go.com",

const levenshtein = require('fast-levenshtein')
const DEFAULT_TOLERANCE = 4
const DEFAULT_TOLERANCE = 3

@@ -7,4 +7,5 @@ class PhishingDetector {

constructor (opts) {
this.whitelist = processDomainList(opts.whitelist || [])
this.blacklist = processDomainList(opts.blacklist || [])
this.whitelist = processDomainList(opts.whitelist || [])
this.fuzzylist = processDomainList(opts.fuzzylist || [])
this.tolerance = ('tolerance' in opts) ? opts.tolerance : DEFAULT_TOLERANCE

@@ -26,3 +27,3 @@ }

const fuzzyForm = domainPartsToFuzzyForm(source)
const levenshteinMatched = this.whitelist.find((targetParts) => {
const levenshteinMatched = this.fuzzylist.find((targetParts) => {
const fuzzyTarget = domainPartsToFuzzyForm(targetParts)

@@ -29,0 +30,0 @@ const distance = levenshtein.get(fuzzyForm, fuzzyTarget)

@@ -5,3 +5,3 @@ const test = require('tape')

const alexaTopSites = require('./alexa.json')
const popularDapps = require('./dapps.json')
const detector = new PhishingDetector(config)

@@ -16,7 +16,4 @@

'metamask.com',
'myetherwaillet.com',
'myetherwaller.com',
'myetherweb.com.de',
'myeterwallet.com',
'xn--mytherwallet-fvb.com',
'wallet-ethereum.net',
'etherclassicwallet.com',
])

@@ -29,2 +26,4 @@

'metamask.io',
'etherscan.io',
'ethereum.org',
// whitelist subdomains

@@ -48,8 +47,6 @@ 'www.metamask.io',

// no match
// not detected as phishing
testNoMatch(t, [
testAnyType(t, false, [
'example.com',
'etherscan.io',
'ethereum.org',
'etherid.org',

@@ -65,2 +62,50 @@ 'ether.cards',

// do detect as phishing
testAnyType(t, true, [
"myethervvallet.com",
"metherwallet.com",
"mtetherwallet.com",
"my-etherwallet.com",
"my-etherwallet.in",
"myeherwallet.com",
"myetcwallet.com",
"myetehrwallet.com",
"myeterwallet.com",
"myethe.rwallet.com",
"myethereallet.com",
"myetherieumwallet.com",
"myetherswallet.com",
"myetherw.allet.com",
"myetherwal.let.com",
"myetherwalet.com",
"myetherwaliet.com",
"myetherwall.et.com",
"myetherwaller.com",
"myetherwallett.com",
"myetherwaillet.com",
"myetherwalllet.com",
"myetherweb.com.de",
"myethetwallet.com",
"myethewallet.com",
"myÄ—therwallet.com",
"myelherwallel.com",
"mvetherwallet.com",
"myethewallet.net",
"myetherwillet.com",
"myetherwallel.com",
"myeltherwallet.com",
"myelherwallet.com",
"wwwmyetherwallet.com",
"myethermwallet.com",
])
// etc...
testNoMatch(t, [
'MetaMask',
'localhost',
'bancor',
'127.0.0.1',
])
t.end()

@@ -70,3 +115,2 @@ })

test('alexa top sites', (t) => {
// alexa top sites
testAnyType(t, false, alexaTopSites)

@@ -76,3 +120,8 @@ t.end()

test('popular dapps', (t) => {
testAnyType(t, false, popularDapps)
t.end()
})
function testBlacklist(t, domains) {

@@ -79,0 +128,0 @@ domains.forEach((domain) => {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc