Last active
April 11, 2024 06:34
-
-
Save zaknesler/e9836cae78456f50f7399b2ebd094923 to your computer and use it in GitHub Desktop.
Mojang VPN bypass
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, ctypes, sys, socket | |
# Windows only. | |
# Mojang rightfully blocks banned IP addresses from authenticating. Most IP addresses on most VPN providers are banned. | |
# Running this file will route known Mojang IP addresses to the default gateway, bypassing any VPNs. | |
hosts = [ | |
'sessionserver.mojang.com', | |
'authserver.mojang.com', | |
'mcoapi.minecraft.net', | |
'minecraft.net', | |
'mojang.com', | |
] | |
gateway = '192.168.0.1' | |
try: | |
if ctypes.windll.shell32.IsUserAnAdmin(): | |
for host in hosts: | |
address = socket.gethostbyname(host) | |
print(f'Resolved { host} as { address }') | |
os.system(f'route add { address } { gateway }') | |
print() | |
else: | |
ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, __file__, None, 1) | |
except: | |
print('Yeah that didn\'t work.') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment