瀏覽代碼

Housekeeping

SukkaW 1 年之前
父節點
當前提交
9e4332a079
共有 2 個文件被更改,包括 4 次插入8 次删除
  1. 1 1
      Build/lib/get-phishing-domains.test.ts
  2. 3 7
      Build/lib/get-phishing-domains.ts

+ 1 - 1
Build/lib/get-phishing-domains.test.ts

@@ -5,6 +5,6 @@ import { calcDomainAbuseScore } from './get-phishing-domains';
 
 describe('sortDomains', () => {
   it('nmdj.pl', () => {
-    console.log(calcDomainAbuseScore('.01462ccca801fed55370d79231c876e5.nmdj.pl'));
+    console.log(calcDomainAbuseScore('.01462ccca801fed55370d79231c876e5.nmdj.pl', '.01462ccca801fed55370d79231c876e5', false));
   });
 });

+ 3 - 7
Build/lib/get-phishing-domains.ts

@@ -100,7 +100,8 @@ export const WHITELIST_MAIN_DOMAINS = new Set([
   'fleek.cool', // ipfs gateway
   'business.site', // Drag'n'Drop site building platform
   'page.link', // Firebase URL Shortener
-  'notion.site'
+  'notion.site',
+  'vercel.app'
 ]);
 
 const sensitiveKeywords = createKeywordFilter([
@@ -168,7 +169,7 @@ export const getPhishingDomains = (parentSpan: Span) => parentSpan.traceChild('g
   });
 
   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}`);
     }
   }
@@ -179,11 +180,6 @@ export const getPhishingDomains = (parentSpan: Span) => parentSpan.traceChild('g
 export function calcDomainAbuseScore(line: string, subdomain: string | null, sensitiveKeywordsHit: boolean | null) {
   let weight = 1;
 
-  const isPhishingDomainMockingCoJp = line.includes('-co-jp');
-  if (isPhishingDomainMockingCoJp) {
-    weight += 0.5;
-  }
-
   const hitLowKeywords = lowKeywords(line);
 
   sensitiveKeywordsHit ??= sensitiveKeywords(line);