npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@infinitywallet/crypto-phishing-detector

v1.0.2

Published

Crypto phishing & scam list and detector utility for URLs and Smart Contracts

Downloads

17

Readme

Crypto Phishing Detector

This repository provides a list of URLs and contracts that can be checked against, to see if a URL or contract is well known or potentially malicious. For this there are two lists, a blacklist and a whitelist. This repository also contains a utility to check URLs against the whitelist and blacklist.

This repository is open to public contribution and use. However, it was initially created for use within the Infinity Wallet, to protect users by warning them when they interact with a malicious URL. We use this library to check a URL when visited within the Infinity Wallet Web3 Browser. When the Infinity Wallet detects a URL to visit is in the blacklist, it takes the user to a warning page as shown in the example below.

Infinity Wallet Blacklist UI Example

We also have token and DApp information and custom icon list repositories, which are used to add tokens or DApps in the Infinity Wallet. With DApps added in the DApp list being displayed within the Infinity Wallet Web3 listings (https://github.com/InfinityWallet/Crypto-Assets).

Data Lists

There are 2 types of lists, the URL list and the Smart Contract list. These can be used to help provide a higher degree of protection for users against scams, malware and phishing attempts.

URLS

The URL list can be used to protect users against crypto and non-crypto scam, phishing and malware sites, as well as other dangers.

  • Whitelist = A list of official URLs which may be targeted by malicious actors;
  • Blacklist = A list of malicious and dangerous URLs that all platforms should block;

Smart Contracts

The smart contract list can be used to protect users from interacting with malicious or scam contracts (Tokens, NFTs, protocols and etc..)

  • Whitelist = A list of well established smart contracts;

  • Blacklist = A list of reported malicious contracts;

  • URLContracts = This folder is used to list the contracts of a known web3 project. Once this list becomes more established it could be used to protect users against some cases of compromised domains or interfaces.

Installation & Usage of the Utility

You can install the package (https://www.npmjs.com/package/@infinitywallet/crypto-phishing-detector) in your project by:

Using yarn

yarn add @infinitywallet/crypto-phishing-detector

Using npm

npm install @infinitywallet/crypto-phishing-detector

Usage of the package

To use the package to check a URL against the whitelist and blacklist you can:

Basic Usage:

This example shows how to use the local whitelist and blacklist. However, if you want to use the most up-to-date version of the lists, it's recommended to use the advanced example.

const checkURL = require('@infinitywallet/crypto-phishing-detector');

const urlToCheck = checkURL('infinitywallets.io')
console.log(urlToCheck)

Advanced Usage:

This example allows you to pass an object with the whitelist and blacklist. You can pull the lists (directly from github, your own list, hosted api or anywhere else) and then pass the object in the correct format to the urlToCheck function as in the example below.

If you want to use the latest github lists then use the following url:

  • Whitelist: https://cdn.jsdelivr.net/gh/InfinityWallet/crypto-phishing-detector@main/Securitylist/Urls/whitelist.json
  • Blacklist: https://cdn.jsdelivr.net/gh/InfinityWallet/crypto-phishing-detector@main/Securitylist/Urls/blacklist.json

The urlToCheck function for advanced usage should be used in the following way checkDomain(URL_TO_CHECK, "custom", LIST_TO_CHECK) as shown in the example below:

const checkURL = require('@infinitywallet/crypto-phishing-detector');

var dataLists = {
  "whitelist": ["infinitywallet.io"],
  "blacklist": ["infinityswallet.io"]
}

const urlToCheck = checkDomain("infinityswallet.io", "custom", dataLists);
console.log(urlToCheck)

Response format

block -

  • true = When returns TRUE this means the URL could be malicious, as it is in the blacklist;
  • false = When returns FALSE this means the URL could be safe, as it is not in the blacklist;

resultType -

  • nomatch = This means that the URL could not be found in either the whitelist or blacklist;
  • allowlist = This means that the url was found in the whitelist;
  • blocklist = This means that the url was found in the blacklist (in this case you should forward a user to an interface with a warning);
{
  block: false,
  resultType: 'nomatch'
}

Reporting

To report a URL or Smart Contract you can open an issue. When reporting make sure to provide for each URL or Smart Contract a reason and what list it should be added to.

Report here: https://github.com/InfinityWallet/crypto-phishing-detector/issues/new/choose

Contributing

How to Contribute

If you would like to contribute and update the list of URLs or Smart Contracts, then you will need to open a pull request to the main branch of this repository.

Contribute Rules

  • Add the URL(s) or Contract(s) to the bottom of the list and in the same format as the existing URLs;
  • The URL should not contain https://, http:// or www.;
  • URLs need to be formatted to target the correct domain or subdomain that is either to be blacklisted or whitelisted. A further explanation can be found in URL formatting.

URL formatting

When contributing to the whitelist or blacklist you need to make sure to format the URL based on the root domain/subdomain for the website you want to whitelist or blacklist. This is because the detector will consider what you place + all subdomains after it, as an example:

  • Domain, example (host.com) - This will trigger a detection on the domain "host.com" and any subdomain after such as "sub.host.com", "sub.sub.host.com" and etc;

  • Subdomain, example (domain.host.com) - This will trigger a detection on the subdomain "domain.host.com" and any following subdomain such as "sub.domain.host.com", but it won't trigger a detection on the domain "host.com". This format should be used when the domain is not the targeted domain;

  • Multi-subdomain, example (sub.domain.host.com) - This will trigger a detection on the subdomain "sub.domain.host.com" and any following subdomain such as "sub.sub.domain.host.com", but it won't trigger a detection on the higher sub-domain "domain.host.com" or the domain "host.com". This format should be used when the domain and higher subdomain is not the target;

Reason for adding

Each URL or Smart Contract added should have a description as to the reason why it has been added to the blacklist (it is optional to add a reason for whitelisting). To add a description go to the reason folder.

When adding a description to the blacklist you need to provide a reason and severity level, while when optionally adding a description to the whitelist you will only need to provide a reason. When adding a new reason for a URL add a new line at the bottom of the list in the same format.

reason - A description as to why a URL or Contract is whitelisted or blacklisted

severity (Only needed for the blacklist) - A severity level to describe the level of threat the URL or Contract poses. With level 1 being the lowest and level 3 the highest.

  • Level 1 = Fake using trademark or name of another;
  • Level 2 = Phishing or scam;
  • Level 3 = Malware or any other malicious activity;

Blocking Policy

We are always looking to protect users from malicious actors within the space, and we will add to the lists as more threats become known. Please be aware however that this is not an exhaustive list, and a URL or Smart Contract's presence or lack thereof does not guarantee that it is or is not safe to use. Here are a few reasons why a URL or Smart Contract may be added to the blacklist:

URL-

  • Impersonating known or well established websites;
  • Websites/DApps reported to be scamming or phishing;
  • Websites/DApps that try to trick users into providing their private keys or seed phrase;
  • Websites/DApps that have any malware or malicious activity;

Smart Contracts-

  • Any contracts reported to be malicious (such as scamming/stealing from users);
  • Fake Tokens and NFTs;

We will ultimately do our best to keep our users safe and the list up-to-date with the support of contributors.