Looking at the decompiled secure_enclave.ko, we find
// read back to struct
iVar1 = enclave_read(auStack552,param_3,param_3,0);
...| %% ROFdenoise | |
| % | |
| % Copyright (c) 2022, Carl Löndahl & Philippe Magiera | |
| % | |
| % Redistribution and use in source and binary forms, with or without | |
| % modification, are permitted provided that the following conditions are met: | |
| % | |
| % Redistributions of source code must retain the above copyright notice, | |
| % this list of conditions and the following disclaimer. | |
| % Redistributions in binary form must reproduce the above copyright notice, |
| from pwn import * | |
| L, zz, m = 1024, 15, 3 | |
| def H(params, msg, u): | |
| K, m = params | |
| r, z = K.characteristic(), K.gens()[0] | |
| h = 0 | |
| while msg > 0: | |
| h *= z | |
| h += msg % r |
| import os | |
| import math | |
| import random | |
| import multiprocessing | |
| THREADS = multiprocessing.cpu_count() | |
| def close_factor_worker(n, delta, ub, ret): |
| import math | |
| poly = 0xa195150d15*2+1 | |
| degree = int(math.log(poly)/math.log(2)) | |
| f = (1 << degree) | |
| def multiply(a, b, poly): | |
| r = 0 | |
| for i in range(64): | |
| if ((a & (1 << i)) != 0): |
| from hashlib import sha256 | |
| from pwn import * | |
| s = remote("appelgrens-01.pwn.beer", 31337) | |
| user = "admin " | |
| print [sha256(user).digest().decode("cp1252")] |