mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Housekeeping
This commit is contained in:
@@ -5,6 +5,6 @@ import { calcDomainAbuseScore } from './get-phishing-domains';
|
|||||||
|
|
||||||
describe('sortDomains', () => {
|
describe('sortDomains', () => {
|
||||||
it('nmdj.pl', () => {
|
it('nmdj.pl', () => {
|
||||||
console.log(calcDomainAbuseScore('.01462ccca801fed55370d79231c876e5.nmdj.pl'));
|
console.log(calcDomainAbuseScore('.01462ccca801fed55370d79231c876e5.nmdj.pl', '.01462ccca801fed55370d79231c876e5', false));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -100,7 +100,8 @@ export const WHITELIST_MAIN_DOMAINS = new Set([
|
|||||||
'fleek.cool', // ipfs gateway
|
'fleek.cool', // ipfs gateway
|
||||||
'business.site', // Drag'n'Drop site building platform
|
'business.site', // Drag'n'Drop site building platform
|
||||||
'page.link', // Firebase URL Shortener
|
'page.link', // Firebase URL Shortener
|
||||||
'notion.site'
|
'notion.site',
|
||||||
|
'vercel.app'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const sensitiveKeywords = createKeywordFilter([
|
const sensitiveKeywords = createKeywordFilter([
|
||||||
@@ -168,7 +169,7 @@ export const getPhishingDomains = (parentSpan: Span) => parentSpan.traceChild('g
|
|||||||
});
|
});
|
||||||
|
|
||||||
for (const domain in domainCountMap) {
|
for (const domain in domainCountMap) {
|
||||||
if (domainCountMap[domain] >= 8 && !WHITELIST_MAIN_DOMAINS.has(domain)) {
|
if (domainCountMap[domain] >= 10 && !WHITELIST_MAIN_DOMAINS.has(domain)) {
|
||||||
domainArr.push(`.${domain}`);
|
domainArr.push(`.${domain}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -179,11 +180,6 @@ export const getPhishingDomains = (parentSpan: Span) => parentSpan.traceChild('g
|
|||||||
export function calcDomainAbuseScore(line: string, subdomain: string | null, sensitiveKeywordsHit: boolean | null) {
|
export function calcDomainAbuseScore(line: string, subdomain: string | null, sensitiveKeywordsHit: boolean | null) {
|
||||||
let weight = 1;
|
let weight = 1;
|
||||||
|
|
||||||
const isPhishingDomainMockingCoJp = line.includes('-co-jp');
|
|
||||||
if (isPhishingDomainMockingCoJp) {
|
|
||||||
weight += 0.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
const hitLowKeywords = lowKeywords(line);
|
const hitLowKeywords = lowKeywords(line);
|
||||||
|
|
||||||
sensitiveKeywordsHit ??= sensitiveKeywords(line);
|
sensitiveKeywordsHit ??= sensitiveKeywords(line);
|
||||||
|
|||||||
Reference in New Issue
Block a user