Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jarelllama authored Nov 8, 2024
1 parent 7148453 commit a085d2a
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions scripts/retrieve_domains.sh
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,41 @@ source_regex() {
done <<< "$targets"
}

source_greek_tax_scam() {
# https://github.com/hagezi/dns-blocklists/issues/4191
source='Greek Tax Scam'
results_file='data/pending/domains_greek_tax_scam.tmp'

[[ "$USE_EXISTING" == true ]] && { process_source; return; }

# Install AdGuard's Dead Domains Linter
if ! command -v dead-domains-linter &> /dev/null; then
npm install -g @adguard/dead-domains-linter > /dev/null
fi

# Get the top 15 TLDs from the NRD feed
tlds="$(shuf -n 10000 nrd.tmp | mawk -F '.' '{print $NF}' | sort | uniq -c \
| sort -nr | head -n 15 | mawk '{print $2}')"

# Get matching NRDs
while read -r tld; do
grep -E "gr\.${tld}$" nrd.tmp >> results.tmp
done <<< "$tlds"

# Append 'gov' subdomain
sed -i 's/^/gov./' results.tmp
sort -u results.tmp -o results.tmp

# Format to Adblock Plus syntax
sed 's/.*/||&^/' results.tmp > formatted.tmp

# Get resolving subdomains
dead-domains-linter -i formatted.tmp --export dead.tmp > /dev/null
comm -23 results.tmp dead.tmp > "$results_file"

rm results.tmp formatted.tmp
}

source_manual() {
source='Manual'
results_file='data/pending/domains_manual.tmp'
Expand Down

0 comments on commit a085d2a

Please sign in to comment.