Initialisation

This commit is contained in:
2021-07-25 00:20:57 +02:00
commit cead6ee8fa
16 changed files with 303 additions and 0 deletions

View File

@ -0,0 +1,31 @@
import time
from aztrom.irc.clientv1 import IRCClient
rot13 = str.maketrans('ABCDEFGHIJKLMabcdefghijklmNOPQRSTUVWXYZnopqrstuvwxyz', 'NOPQRSTUVWXYZnopqrstuvwxyzABCDEFGHIJKLMabcdefghijklm')
client = IRCClient("irc.root-me.org", 6667)
time.sleep(2)
print(client.recv())
client.auth("aztrom")
time.sleep(2)
print(client.recv())
client.join("#root-me_challenge")
time.sleep(1)
print(client.recv())
client.send("candy", "!ep3")
time.sleep(1)
resp = client.recv()
print(resp)
for line in resp.split("\n"):
if line.startswith(":Candy!Candy@root-me.org PRIVMSG aztrom :"):
code = line.split("aztrom :")[1]
print("Code = " + code)
decoded = code.translate(rot13)
print("Decoded = " + decoded)
client.send("candy", "!ep3 -rep " + decoded)
time.sleep(1)
print(client.recv())
break

View File

@ -0,0 +1,7 @@
#!/bin/sh
BASEDIR=$(dirname "$0")
export PYTHONPATH="$BASEDIR/../../../../lib/python"
python3 "$BASEDIR/hack.py"

View File

@ -0,0 +1,32 @@
import time
import base64
import zlib
from aztrom.irc.clientv1 import IRCClient
client = IRCClient("irc.root-me.org", 6667)
time.sleep(2)
print(client.recv())
client.auth("aztrom")
time.sleep(2)
print(client.recv())
client.join("#root-me_challenge")
time.sleep(1)
print(client.recv())
client.send("candy", "!ep4")
time.sleep(1)
resp = client.recv()
print(resp)
for line in resp.split("\n"):
if line.startswith(":Candy!Candy@root-me.org PRIVMSG aztrom :"):
b64data = line.split("aztrom :")[1]
zdata = base64.b64decode(b64data)
data = zlib.decompress(zdata)
decoded = data.decode("UTF-8")
print("Decoded = " + decoded)
client.send("candy", "!ep4 -rep " + decoded)
time.sleep(1)
print(client.recv())
break

View File

@ -0,0 +1,7 @@
#!/bin/sh
BASEDIR=$(dirname "$0")
export PYTHONPATH="$BASEDIR/../../../../lib/python"
python3 "$BASEDIR/hack.py"

View File

@ -0,0 +1,30 @@
import time
import base64
from aztrom.irc.clientv1 import IRCClient
client = IRCClient("irc.root-me.org", 6667)
time.sleep(2)
print(client.recv())
client.auth("aztrom")
time.sleep(2)
print(client.recv())
client.join("#root-me_challenge")
time.sleep(1)
print(client.recv())
client.send("candy", "!ep2")
time.sleep(1)
resp = client.recv()
print(resp)
for line in resp.split("\n"):
if line.startswith(":Candy!Candy@root-me.org PRIVMSG aztrom :"):
code = line.split("aztrom :")[1]
print("Code = " + code)
decoded = base64.b64decode(code).decode("UTF-8")
print("Decoded = " + decoded)
client.send("candy", "!ep2 -rep " + decoded)
time.sleep(1)
print(client.recv())
break

View File

@ -0,0 +1,7 @@
#!/bin/sh
BASEDIR=$(dirname "$0")
export PYTHONPATH="$BASEDIR/../../../../lib/python"
python3 "$BASEDIR/hack.py"