38 lines
1.0 KiB
Python
38 lines
1.0 KiB
Python
|
import random,os,threading,requests
|
||
|
from mcstatus import JavaServer
|
||
|
def threaded(func):
|
||
|
def wrapper(*_args, **kwargs):
|
||
|
t = threading.Thread(target=func, args=_args)
|
||
|
t.start()
|
||
|
return
|
||
|
return wrapper
|
||
|
|
||
|
def hit(host):
|
||
|
with open("./ip.txt", "a") as f:
|
||
|
f.write(f"{host}\n")
|
||
|
print(f"[+] Hit on {host}")
|
||
|
requests.post('http://localhost:9000/server', data={"server": host}, headers={"authorization": "13ADAFE6492EC9C4A04E9F9677687C4CA647931CD43E87419349CDDA69AEA9B9DBFE689EAC381DE10BFF9E9891175E6205DECAF0AB05A9698CA77F78FC7EE7A1"})
|
||
|
|
||
|
def generateIP():
|
||
|
ip = ".".join(map(str, (random.randint(0, 255) for _ in range(4))))
|
||
|
return ip
|
||
|
|
||
|
with open('./ip.txt', 'r') as f:
|
||
|
arab = f.read()
|
||
|
|
||
|
@threaded
|
||
|
def lookup():
|
||
|
ip = generateIP()
|
||
|
if ip in arab:
|
||
|
pass
|
||
|
try:
|
||
|
server = JavaServer.lookup(ip + ":25565")
|
||
|
if server.ping():
|
||
|
hit(ip)
|
||
|
except Exception:
|
||
|
pass
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
os.system("clear")
|
||
|
while True:
|
||
|
lookup()
|