From 3f600ad59806f00a1195e074b625a6dbc3a95b85 Mon Sep 17 00:00:00 2001 From: Valentin VERDIER Date: Wed, 15 Feb 2023 14:23:08 +0100 Subject: [PATCH] nouveaux challenges --- .../cryptanalyse/decomposition-pixelisee/run.py | 2 +- .../elf64-chiffrement-avec-le-pid/exploit.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 rootme/challenges/cryptanalyse/elf64-chiffrement-avec-le-pid/exploit.py 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}'")