Update CDN & Reject Hosts

This commit is contained in:
SukkaW
2024-09-05 23:41:06 +08:00
parent 2185a5e806
commit f61804ff51
4 changed files with 36 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
import { processDomainLists } from './parse-filter';
import * as tldts from 'tldts-experimental';
import type { Span } from '../trace';
import { dummySpan, type Span } from '../trace';
import { appendArrayInPlaceCurried } from './append-array-in-place';
import { PHISHING_DOMAIN_LISTS_EXTRA } from '../constants/reject-data-source';
import { loosTldOptWithPrivateDomains } from '../constants/loose-tldts-opt';
@@ -13,6 +13,7 @@ const BLACK_TLD = new Set([
'accountant',
'autos',
'bar',
'beauty',
'bid',
'biz',
'bond',
@@ -55,10 +56,13 @@ const BLACK_TLD = new Set([
'live',
'link',
'loan',
'lol',
'ltd',
'me',
'men',
'ml',
'mobi',
'mom',
'net.pl',
'one',
'online',
@@ -122,18 +126,24 @@ const sensitiveKeywords = createKeywordFilter([
'virus-',
'icloud-',
'apple-',
'www.apple.',
'www.apple',
'-coinbase',
'coinbase-',
'lcloud.',
'lcloud-'
'lcloud-',
'booking-com',
'booking.com-',
'booking-eu',
'vinted-cz',
'inpost-pl'
]);
const lowKeywords = createKeywordFilter([
'-co-jp',
'customer.',
'customer-',
'.www-',
'instagram'
'instagram',
'microsoft'
]);
const cacheKey = createCacheKey(__filename);
@@ -198,11 +208,12 @@ export const getPhishingDomains = (parentSpan: Span) => parentSpan.traceChild('g
|| (domainScoreMap[domain] >= 5 && domainCountMap[domain] >= 4)
)
) {
console.log({ domain });
domainArr.push(`.${domain}`);
}
}
// console.log(domainScoreMap['']);
return domainArr;
});
@@ -252,3 +263,8 @@ export function calcDomainAbuseScore(subdomain: string | null) {
return weight;
}
if (require.main === module) {
getPhishingDomains(dummySpan)
.catch(console.error);
}