├── contribute.php ├── LICENSE ├── ReadMe.md ├── blockedservers.txt └── Contribute.java /contribute.php: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /ReadMe.md: -------------------------------------------------------------------------------- 1 | # Minecraft-Blocked-Servers 2 | 3 | ## Description 4 | 5 | Since Minecraft 1.9.3 r2 Mojang wants to ban servers if they don't comply with the Minecraft EULA. Mojang contacts 6 | these servers by email ("Mojang BrandEnforcement"). If they still not follow the EULA the server address will be added 7 | (hashed with SHA-1) to the list below. If the Minecraft client wants to connect to the banned server, they will just 8 | disconnect with the message: "java.net.SocketException: Network is unreachable" which actual means the server is down. 9 | (=>misleading message) 10 | 11 | Update: Found out that they have also wildcard support. So for example `*.server.com` or `0.0.0.*` can be banned too. 12 | 13 | Update 2: Cracked/offline mode player will also receive this message 14 | 15 | Update 3: Thanks to @DutchPlays for nearly completing the list of all servers (just one server is missing) 16 | 17 | Update 4: All servers are found 18 | 19 | ## List of all blocked servers 20 | 21 | https://sessionserver.mojang.com/blockedservers 22 | 23 | ## Reddit post 24 | 25 | https://www.reddit.com/r/Minecraft/comments/4h3c6u/mojang_is_blocking_certain_servers_as_of_193_r2/ 26 | 27 | ## Minecraft related code 28 | 29 | ### In Minecraft 1.9.3 r2 30 | 31 | * Disconnect: **File**: ```beg.class``` **Line**: ```52-67``` **Method**: 32 | ```java 33 | private void a(String, int) 34 | ``` 35 | * Download the list and check every entry: **File**: ```bcd.class``` **Line**: 2968-3002 **Method**: 36 | ```java 37 | public boolean a(String) 38 | ``` 39 | * Hash generate from address **File**: bcd.class **Line**: 3006 **Method**: 40 | ```java 41 | public boolean a(String) 42 | ``` 43 | 44 | ### In Minecraft 1.9.3 r3 and 1.9.3 official release 45 | 46 | Implementation was re-added. Now with wildcards. 47 | 48 | Mojang introduced a new library. This can be found in .minecraft/libraries/com/mojang/netty/1.4 49 | 50 | There you can find the method 51 | ```java 52 | isBlockedServer(String) 53 | ``` 54 | , which is nearly equal to the one in 1.9.3 r2. **This makes it possible to block these servers also for older Minecraft 55 | versions** . 56 | -------------------------------------------------------------------------------- /blockedservers.txt: -------------------------------------------------------------------------------- 1 | 27ae74becc8cd701b19f25d347faa71084f69acd : *.arkhamnetwork.org 2 | 986204c70d368d50ffead9031e86f2b9e70bb6d0 : *.playmc.mx 3 | d42339c120bc10a393a0b1d2c6a2e0ed4dbdd61b : *.herowars.org 4 | 8bf58811e6ebca16a01b842ff0c012db1171d7d6 : *.eulablows.host 5 | 8789800277882d1989d384e7941b6ad3dadab430 : *.moredotsmoredots.xyz 6 | e40c3456fb05687b8eeb17213a47b263d566f179 : *.brandonlovescock.bid 7 | 278b24ffff7f9f46cf71212a4c0948d07fb3bc35 : *.brandonlovescock.club 8 | 7dca807cc9484b1eed109c003831faf189b6c8bf : *.brandonlovescock.online 9 | c6a2203285fb0a475c1cd6ff72527209cc0ccc6e : *.brandonlovescock.press 10 | 9f0f30820cebb01f6c81f0fdafefa0142660d688 : *.kidslovemy500dollarranks.club 11 | b21d77260ed7a792c216b18c7287d683b2a271bd : *.kidslovemy500dollarranks.online 12 | cc90e7b39112a48064f430d3a08bbd78a226d670 : *.eccgamers.com 13 | 88f155cf583c930ffed0e3e69ebc3a186ea8cbb7 : *.fucktheeula.com 14 | 7ea72de5f8e70a2ac45f1aa17d43f0ca3cddeedd : *.trollingbrandon.club 15 | 605e6296b8dba9f0e4b8e43269fe5d053b5f4f1b : *.mojangendorsesbrazzers.webcam 16 | 4a1b3b860ba0b441fa722bbcba97a614f6af9bb8 : justgiveinandblockddnsbitches.ddns.net 17 | e2e12f3b7b85eab81c0ee5d2e9e188df583fe281 : *.eulablacklist.club 18 | b8c876f599dcf5162911bba2d543ccbd23d18ae5 : brandonisagainst.health-carereform.com 19 | 48f04e89d20b15de115503f22fedfe2cb2d1ab12 : brandonisan.unusualperson.com 20 | 9a9ae8e9d0b6f3bf54c266dcd1e4ec034e13f714 : brandonwatchesporn.onthewifi.com 21 | 336e718ffbc705e76b4a72884172c6b95216b57c : canyouwildcardipsplease.gotdns.ch 22 | 27cf97ecf24c92f1fe5c84c5ff654728c3ee37dd : letsplaysome.servecounterstrike.com 23 | 0acba7b130712cb4260d40b031fe36c668cdefce 24 | 32066aa0c7dc9b097eed5b00c5629ad03f250a2d : mojangbrokeintomy.homesecuritymac.com 25 | 5d2e23d164a43fbfc4e6093074567f39b504ab51 : touchmybody.redirectme.net 26 | 79aecb5b9fafced11f05bbb6939262f5d4e3626b : *.blacklistthisifyousupportrape.host 27 | f3df314d1f816a8c2185cd7d4bcd73bbcffc4ed8 : *.mojangsentamonkeyinto.space 28 | 65ca8860fa8141da805106c0389de9d7c17e39bf : *.howdoiblacklistsrv.host 29 | dcc1f876e258ac5ecab28244da7a94ed44d4b43f : 198.27.77.72 30 | 6f2520f8bd70a718c568ab5274c56bdbbfc14ef4 : *.minetime.com 31 | b13009db1e2fbe05465716f67c8d58b9c0503520 : *.endercraft.com 32 | 3e560742576af9413fca72e70f75d7ddc9416020 : *.insanefactions.org 33 | e3985eb936d66c9b07aa72c15358f92965b1194e : *.insanenetwork.org 34 | b140bec2347bfbe6dcae44aa876b9ba5fe66505b : *.phoenixnexus.net 35 | c005ad34245a8f2105658da2d6d6e8545ef0f0de : *.skygod.us 36 | 11a2c115510bfa6cb56bbd18a7259a4420498fd5 : *.slaughterhousepvp.com 37 | 75df09492c6c979e2db41116100093bb791b8433 : *.timelesspvp.net 38 | c78697e385bfa58d6bd2a013f543cdfbdc297c4f : *.mineaqua.net 39 | c645d6c6430db3069abd291ec13afebdb320714b : *.mineaqua.es 40 | 709a849e4e7a986c8165083dccb9857bcb04c67b 41 | 073ca448ef3d311218d7bd32d6307243ce22e7d0 : *.diacraft.org 42 | 33839f4006d6044a3a6675c593fada6a690bb64d : *.diacraft.de 43 | -------------------------------------------------------------------------------- /Contribute.java: -------------------------------------------------------------------------------- 1 | 2 | import java.io.File; 3 | import java.io.IOException; 4 | import java.math.BigInteger; 5 | import java.nio.charset.StandardCharsets; 6 | import java.nio.file.Files; 7 | import java.security.MessageDigest; 8 | import java.security.NoSuchAlgorithmException; 9 | import java.util.ArrayList; 10 | import java.util.Arrays; 11 | import java.util.List; 12 | 13 | public class Contribute { 14 | 15 | private static final String IP_DELIMETER = "."; 16 | private static final int HASH_LENGTH = 40; 17 | private static final String HASH_ALGO = "SHA-1"; 18 | 19 | public static void main(String[] args) throws Exception { 20 | System.out.println(isBanned("example.minecraft.com")); 21 | } 22 | 23 | public static String hashServer(String serverAddress) { 24 | try { 25 | MessageDigest digest = MessageDigest.getInstance(HASH_ALGO); 26 | byte[] inputBytes = serverAddress.getBytes(StandardCharsets.UTF_8); 27 | byte[] hashedBytes = digest.digest(inputBytes); 28 | return String.format("%0" + (hashedBytes.length << 1) + "x", new BigInteger(1, hashedBytes)); 29 | } catch (NoSuchAlgorithmException noSuchAlgorithmException) { 30 | //ignore - sha1 is available in all vm 31 | return ""; 32 | } 33 | } 34 | 35 | public static boolean isBanned(String serverAddress) throws IOException { 36 | File bannedList = new File("./blockedservers.txt"); 37 | List lines = Files.readAllLines(bannedList.toPath()); 38 | lines.parallelStream() 39 | .filter(line -> !line.startsWith(line)) 40 | .filter(line -> !line.trim().isEmpty()) 41 | .map(line -> line.substring(0, HASH_LENGTH)) 42 | .anyMatch(hash -> { 43 | if (hash.equals(hashServer(serverAddress.trim().toLowerCase()))) { 44 | return true; 45 | } 46 | 47 | //\\ is used for escaping regEx 48 | List components = new ArrayList<>(Arrays.asList(serverAddress.split("\\" + IP_DELIMETER))); 49 | boolean isIp = components.size() == 4; 50 | if (isIp) { 51 | for (String component : components) { 52 | try { 53 | int number = Integer.parseInt(component); 54 | if (number < 0 || number > 255) { 55 | //ip range is from 0.0.0.0 to 255.255.255.255 56 | isIp = false; 57 | break; 58 | } 59 | } catch (NumberFormatException numberFormatException) { 60 | //not a ip 61 | isIp = false; 62 | break; 63 | } 64 | } 65 | } 66 | 67 | while (components.size() > 1) { 68 | components.remove(isIp ? (components.size() - 1) : 0); 69 | 70 | String toTest; 71 | if (isIp) { 72 | //example: 0.0.0.* 73 | toTest = String.join(IP_DELIMETER, components) + ".*"; 74 | } else { 75 | //example: *.server.com 76 | toTest = ("*." + String.join(IP_DELIMETER, components)); 77 | } 78 | 79 | if (hash.equals(hashServer(toTest))) { 80 | return true; 81 | } 82 | } 83 | 84 | return false; 85 | }); 86 | 87 | return false; 88 | } 89 | } 90 | --------------------------------------------------------------------------------