From 79965ab47274ebd571b7d3aac1b4d9db5dde36d4 Mon Sep 17 00:00:00 2001 From: sangge <2251250136@qq.com> Date: Sat, 26 Aug 2023 01:00:03 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E6=9C=9F=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crypto/easy_pow/crack.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 crypto/easy_pow/crack.py diff --git a/crypto/easy_pow/crack.py b/crypto/easy_pow/crack.py new file mode 100644 index 0000000..3840482 --- /dev/null +++ b/crypto/easy_pow/crack.py @@ -0,0 +1,25 @@ +import hashlib +import itertools +from pwn import * +import string + +context.log_level = 'debug' + +r = remote("localhost",10001) + +strings=r.recvline().decode('utf-8') +alpha_bet = string.ascii_letters+string.digits +strlist = itertools.permutations(alpha_bet, 4) +obj = re.search('\w{64}', strings)[0] +obj2 = re.search('\w{16}', strings)[0] + +for i in strlist: + data=i[0]+i[1]+i[2]+i[3]+obj2 + data_sha=hashlib.sha256(data.encode('utf-8')).hexdigest() + if(data_sha==obj): + print(data[:4]) + r.sendline(data[:4].encode()) + break +r.recvline() +r.recvline() +r.close() \ No newline at end of file