mirror of
https://github.com/pezkuwichain/phishing.git
synced 2026-07-19 20:25:43 +00:00
Adjust wildcard check & add problematic <url>.on.fleek.co (#1871)
* Adjust wildcard check & add problematic <url>.on.fleek.co * Adjust
This commit is contained in:
@@ -12,6 +12,7 @@ const all = JSON.parse(fs.readFileSync('all.json', 'utf8')) as { allow: string[]
|
||||
const TOP_LEVEL = [
|
||||
// wildcards
|
||||
'*.fleek.co', // storageapi.fleek.co, storageapi2.fleek.co
|
||||
'on.fleek.co',
|
||||
|
||||
// root domains
|
||||
'ddns.net',
|
||||
@@ -74,7 +75,8 @@ describe('added urls', (): void => {
|
||||
it('has no entries for allowed top-level domains', (): void => {
|
||||
const invalids = all.deny.filter((u) =>
|
||||
TOP_LEVEL.some((t) =>
|
||||
t.startsWith('*.')
|
||||
// for *. count the parts before the check
|
||||
(t.startsWith('*.') && (u.split('.').length === t.split('.').length))
|
||||
? (u.endsWith(t.substring(1)) || u === t.substring(2))
|
||||
: u === t
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user