mirror of
https://github.com/pezkuwichain/phishing.git
synced 2026-06-13 08:11:11 +00:00
Move allow list in all.json (#1872)
* Move allow list in all.json * Correct error message
This commit is contained in:
@@ -1,5 +1,28 @@
|
|||||||
{
|
{
|
||||||
"allow": [],
|
"allow": [
|
||||||
|
"*.fleek.co",
|
||||||
|
"ddns.net",
|
||||||
|
"ddns.us",
|
||||||
|
"github.io",
|
||||||
|
"herokuapp.com",
|
||||||
|
"hopto.org",
|
||||||
|
"js.org",
|
||||||
|
"netlify.app",
|
||||||
|
"on.fleek.co",
|
||||||
|
"pagekite.me",
|
||||||
|
"pages.dev",
|
||||||
|
"plesk.page",
|
||||||
|
"servehttp.com",
|
||||||
|
"square.site",
|
||||||
|
"sytes.net",
|
||||||
|
"timeweb.ru",
|
||||||
|
"vercel.app",
|
||||||
|
"web.app",
|
||||||
|
"webflow.io",
|
||||||
|
"weebly.com",
|
||||||
|
"wixsite.com",
|
||||||
|
"zapto.org"
|
||||||
|
],
|
||||||
"deny": [
|
"deny": [
|
||||||
"07e96d43-381a-46a3-9c16-6daf97213efc.co",
|
"07e96d43-381a-46a3-9c16-6daf97213efc.co",
|
||||||
"0vvwvuniswap.top",
|
"0vvwvuniswap.top",
|
||||||
|
|||||||
@@ -9,33 +9,6 @@ const addresses = JSON.parse(fs.readFileSync('address.json', 'utf-8')) as Record
|
|||||||
const allowed = JSON.parse(fs.readFileSync('known.json', 'utf-8')) as Record<string, string[]>;
|
const allowed = JSON.parse(fs.readFileSync('known.json', 'utf-8')) as Record<string, string[]>;
|
||||||
const all = JSON.parse(fs.readFileSync('all.json', 'utf8')) as { allow: string[]; deny: string[] };
|
const all = JSON.parse(fs.readFileSync('all.json', 'utf8')) as { allow: string[]; deny: string[] };
|
||||||
|
|
||||||
const TOP_LEVEL = [
|
|
||||||
// wildcards
|
|
||||||
'*.fleek.co', // storageapi.fleek.co, storageapi2.fleek.co
|
|
||||||
'on.fleek.co',
|
|
||||||
|
|
||||||
// root domains
|
|
||||||
'ddns.net',
|
|
||||||
'ddns.us',
|
|
||||||
'github.io',
|
|
||||||
'herokuapp.com',
|
|
||||||
'hopto.org',
|
|
||||||
'js.org',
|
|
||||||
'netlify.app',
|
|
||||||
'pagekite.me',
|
|
||||||
'pages.dev',
|
|
||||||
'plesk.page',
|
|
||||||
'servehttp.com',
|
|
||||||
'sytes.net',
|
|
||||||
'timeweb.ru',
|
|
||||||
'vercel.app',
|
|
||||||
'web.app',
|
|
||||||
'webflow.io',
|
|
||||||
'weebly.com',
|
|
||||||
'wixsite.com',
|
|
||||||
'zapto.org'
|
|
||||||
];
|
|
||||||
|
|
||||||
describe('added addresses', (): void => {
|
describe('added addresses', (): void => {
|
||||||
it('has no malformed addresses', (): void => {
|
it('has no malformed addresses', (): void => {
|
||||||
const invalids = Object
|
const invalids = Object
|
||||||
@@ -72,9 +45,9 @@ describe('added addresses', (): void => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('added urls', (): void => {
|
describe('added urls', (): void => {
|
||||||
it('has no entries for allowed top-level domains', (): void => {
|
it('has no entries matching top-level domains in allow', (): void => {
|
||||||
const invalids = all.deny.filter((u) =>
|
const invalids = all.deny.filter((u) =>
|
||||||
TOP_LEVEL.some((t) =>
|
all.allow.some((t) =>
|
||||||
// for *. count the parts before the check
|
// for *. count the parts before the check
|
||||||
(t.startsWith('*.') && (u.split('.').length === t.split('.').length))
|
(t.startsWith('*.') && (u.split('.').length === t.split('.').length))
|
||||||
? (u.endsWith(t.substring(1)) || u === t.substring(2))
|
? (u.endsWith(t.substring(1)) || u === t.substring(2))
|
||||||
|
|||||||
Reference in New Issue
Block a user