commit cb2001cd44fb2e7221b9704d63a7c1f703ff1fb8 Author: cynic Date: Sat Feb 22 22:36:08 2025 -0500 init~ diff --git a/c.py b/c.py new file mode 100644 index 0000000..06a832d --- /dev/null +++ b/c.py @@ -0,0 +1,63 @@ +import requests, os, time + +# go get hokierux@@@!!!! +if not os.path.exists("hkt.png"): + r = requests.get("https://vtluug.org/hokietux.png") + with open("hkt.png", "wb") as f: + f.write(r.content) +#uisbt he so cute... + +def run(thread, node, threads, nodes): + im = Image.open("./hkt.png") + im.thumbnail((500, int((500 * im.width)/im.height))) + + tgt = "2602:f75c:c0::XXXX:YYYY:RRGG:BBAA" + + xo = 0 + yo = 0 + + xchunk = im.width // nodes + xrange = (xchunk * node, xchunk * node + xchunk) + + ychunk = im.height // threads + yrange = (ychunk * thread, ychunk * thread + ychunk) + + d = im.load() + for x in range(xrange[0], xrange[1]): + for y in range(yrange[0], yrange[1]): + c = d[x, y] + if c[-1] == 0: continue + c = [hex(i).replace("0x", "") for i in c] + cmap = ["RR", "GG", "BB", "AA", "XXXX", "YYYY"] + sx = hex(x + xo).replace("0x", "") + sy = hex(y + yo).replace("0x", "") + while len(sx) < 4: sx = "0"+sx + while len(sy) < 4: sy = "0"+sy + for i in range(len(c)): + cc = c[i] + while len(cc) < 2: cc = "0"+cc + c[i] = cc + c.extend([sx, sy]) + sighted = tgt + for i in range(len(cmap)): + sighted = sighted.replace(cmap[i], c[i]) + os.system("ping -c 1 -W .001 "+sighted+" > /dev/null") + time.sleep(0.001) + #print(x, y, sx, sy, sighted) + +import subprocess, json, sys +with open("./nodez.json", "r") as f: + nodes = json.loads(f.read()) + +whoami = subprocess.check_output(["hostname"]).decode("ascii").split(".")[0].strip() + +if not whoami in nodes.keys(): + print("dyign", whoami, nodes.keys()) + sys.exit(1) +print("running openbased on "+whoami+"... ^///.///^") + +from PIL import Image +threads = nodes[whoami]["threads"] +import threading +for i in range(threads): + threading.Thread(target=run, args=(i, list(nodes.keys()).index(whoami), threads, len(nodes.keys()))).start() \ No newline at end of file diff --git a/hkt.png b/hkt.png new file mode 100644 index 0000000..14ac5bb Binary files /dev/null and b/hkt.png differ diff --git a/nodez.json b/nodez.json new file mode 100644 index 0000000..f46019f --- /dev/null +++ b/nodez.json @@ -0,0 +1,32 @@ +{ + "acidburn": + { + "u" : "rsk", + "fqdn" : "acidburn.vtluug.org", + "threads" : 1 + }, + "meltdown": + { + "u" : "rsk", + "fqdn" : "meltdown.vtluug.org", + "threads" : 8 + }, + "gibson": + { + "u" : "rsk", + "fqdn" : "gibson.vtluug.org", + "threads" : 8 + }, + "tacomanarrows": + { + "u" : "rsk", + "fqdn" : "tacomanarrows.wuvt.vt.edu", + "threads" : 2 + }, + "dirtycow": + { + "u" : "rsk", + "fqdn" : "dirtycow.vtluug.org", + "threads" : 2 + } +} \ No newline at end of file diff --git a/run.py b/run.py new file mode 100644 index 0000000..594e192 --- /dev/null +++ b/run.py @@ -0,0 +1,10 @@ +import subprocess, json, sys, os, threading +with open("./nodez.json", "r") as f: + nodes = json.loads(f.read()) + +def run(tgt): + #os.system(f"ssh {tgt['u']}@{tgt['fqdn']} sudo apt install -y python3-pillow") + os.system(f"ssh {tgt['u']}@{tgt['fqdn']} \"cd ~/repos/openbased/ && python3 c.py\"") + +for node in nodes.values(): + threading.Thread(target=run, args=(node,)).start() \ No newline at end of file