mojang-blocklist/README.md

56 lines
1.8 KiB
Markdown
Raw Normal View History

# sudofox/mojang-blacklist
I figured I'd try to get a more comprehensive list of the domains blocked by Mojang, so this is my stab at it.
## useful bash snippets
Get a list of TLDs (idk if this is super up to date)
```
2022-08-24 17:32:05 -04:00
curl -s https://raw.githubusercontent.com/umpirsky/tld-list/master/data/en/tld.txt|grep -Po "\(\K.+?(?=\))" > tld.txt
```
Get the middle segment (part before the TLD) of all entries, excluding ddns.net, spit it out as *.string
```
2022-08-23 19:23:26 -04:00
awk -F= '{print $2}' data/identified.txt|grep -v ddns|awk -F. '{print $(NF-1)}'|sort -u > middle_segments.txt
```
2022-08-23 19:23:26 -04:00
For all TLDs in tld.txt, try *.string.tld (try also: no subdomain, `play.`, `mc.`, etc)
```
2022-08-23 19:23:26 -04:00
for tld in $(cat tld.txt); do cat middle_segments.txt|awk '{print $1".'$tld'"}'; done|pv -l |xargs -P3 node try_url.js
```
2022-08-23 17:57:48 -04:00
Get a list of hashes which have not yet been identified
```
comm -23 <(sort -u data/current.txt) <(awk -F= '{print $1}' data/identified.txt |sort -u) > todo.txt
```
2022-08-23 20:40:38 -04:00
# for big lists of minecraft server urls:
remove first subdomain. replace with *.<domain>. this also strips port numbers and normalizes casing
```
cat minecraftservers_org_scrape.txt| grep -Po ".+?(?=:)" | grep -Po ".+?(?=\.)\K.*" | tr '[[:upper:]]' '[[:lower:]]'|awk '{print "*"$1}'|xargs node try_url.js
```
Do srv lookups for a list of domains
```
cat domains.txt| grep -Po ".+?(?=:)" | tr '[[:upper:]]' '[[:lower:]]'|grep [[:alpha:]]| xargs -I{} -P10 timeout 5 dig srv _minecraft._tcp.{} +short | tee -a domains_srv_resolved.txt
```
2022-08-23 20:40:38 -04:00
Given a list of raw `dig` output for many srv lookups, filter for domains only and strip the trailing dot:
```
tr ' ' '\n'|egrep [[:alpha:]]|sort -u|grep -Po ".+?(?=\.$)"
```
try *.mc or *.play subdomains for existing
```
awk -F= '{print $NF}' data/identified.txt |grep [[:alpha:]]|grep -Po "\*\.\K.*"|awk '{print "*.mc."$1}'|xargs node try_url.js
```