diff --git a/rootme/challenges/cryptanalyse/decomposition-pixelisee/run.py b/rootme/challenges/cryptanalyse/decomposition-pixelisee/run.py index f4f05de..3f9dbee 100644 --- a/rootme/challenges/cryptanalyse/decomposition-pixelisee/run.py +++ b/rootme/challenges/cryptanalyse/decomposition-pixelisee/run.py @@ -9,7 +9,7 @@ for line in lines: chunks = line.split("+") for chunk in chunks: s = chunk.split("x") - color = "0" if s[0] == "1" else " " + color = " " if s[0] == "1" else "#" count = int(s[1]) print(color * count, end="") print("") diff --git a/rootme/challenges/cryptanalyse/elf64-chiffrement-avec-le-pid/exploit.py b/rootme/challenges/cryptanalyse/elf64-chiffrement-avec-le-pid/exploit.py new file mode 100644 index 0000000..8774636 --- /dev/null +++ b/rootme/challenges/cryptanalyse/elf64-chiffrement-avec-le-pid/exploit.py @@ -0,0 +1,9 @@ +#!/usr/bin/python3 + +import os +import crypt + +f = open("/proc/sys/kernel/ns_last_pid", mode="r") +pid = int(f.readlines()[0]) + 2 +pidcrypt = crypt.crypt(str(pid), "$1$awesome") +os.system(f"./ch21 '{pidcrypt}'")