diff --git a/address.json b/address.json index 13004ece4..6e0f5cfc1 100644 --- a/address.json +++ b/address.json @@ -51,6 +51,9 @@ "polkabonus.com": [ "16XuqCCe8kBK7SbLhaLhUQQzRLJthB2hdrPzKghVGZqwAsRs" ], + "polkacoinbonus.com": [ + "13WKPgYxPyzL8KMcqZ94eSFp2FoQH4AUxxLgjj7Sgkdhw6R9" + ], "polkadot-airdrop.info": [ "13DUJB2UFQYJNG8eAgvbPUDZowTnb45cq7EM7WvtkNksPMZW" ], diff --git a/packages/phishing/src/addrcheck.spec.ts b/packages/phishing/src/addrcheck.spec.ts index df94e6fca..a87baf0cd 100644 --- a/packages/phishing/src/addrcheck.spec.ts +++ b/packages/phishing/src/addrcheck.spec.ts @@ -10,11 +10,15 @@ import { fetchWithTimeout } from './fetch'; const TICKS = '```'; +function fetch (url: string): Promise { + return fetchWithTimeout(url, 5000); +} + // loop through each site for a number of times, applying the transform async function loopSome (site: string, matcher: () => Promise): Promise<[string, string[]]> { const found: string[] = []; - for (let i = 0; i < 20; i++) { + for (let i = 0; i < 10; i++) { try { const addresses = await matcher(); @@ -36,7 +40,7 @@ async function loopSome (site: string, matcher: () => Promise): // shared between polkadot.center & polkadot-event.com (addresses are also the same on first run) function checkGetWallet (site: string): Promise<[string, string[]]> { return loopSome(site, async (): Promise => { - const result = await (await fetchWithTimeout(`https://${site}/get_wallet.php`)).json() as Record; + const result = await (await fetch(`https://${site}/get_wallet.php`)).json() as Record; return (result && result.wallet) ? [result.wallet.replace('\r', '').trim()] @@ -49,7 +53,7 @@ function checkTag (url: string, tag: string, attr?: string): Promise<[string, st const site = url.split('/')[2]; return loopSome(site, async (): Promise => { - const result = await (await fetchWithTimeout(url)).text(); + const result = await (await fetch(url)).text(); // /

(.*?)<\/p>/g const match = new RegExp(`<${tag}${attr ? ` ${attr}` : ''}>(.*?)`, 'g').exec(result); @@ -72,7 +76,7 @@ function checkAttr (url: string, attr: string): Promise<[string, string[]]> { const site = url.split('/')[2]; return loopSome(site, async (): Promise => { - const result = await (await fetchWithTimeout(url)).text(); + const result = await (await fetch(url)).text(); const match = new RegExp(`${attr}"[a-zA-Z0-9]+"`, 'g').exec(result); return match && match.length @@ -94,6 +98,7 @@ function checkAll (): Promise<[string, string[]][]> { 'https://polkadot-gift.org/block.html' ].map((u) => checkTag(u, 'p', 'id="trnsctin"')), ...[ + 'https://polkacoinbonus.com/verification/index.html', 'https://polkagiveaway.com/verification/index.html', 'https://polkadot.activebonus.live/claim/' ].map((u) => checkTag(u, 'span', 'id="trnsctin"')),