feat: finish xiaosai

This commit is contained in:
2023-10-15 19:42:16 +08:00
parent 7fe37b52eb
commit c2de294d1c
13 changed files with 571 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
from pwn import *
from flag import flag
from Crypto.Cipher import AES
from hashlib import sha256
import base64
flag = b''
first_flag = b''
wordlist = b'123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM{}_'
for i in range(16):
for j in wordlist:
r = remote("127.0.0.1", 10002)
payload = b'0'*(16-5) + b'0' * (15 - i)\
+ first_flag + j.to_bytes() + \
b'0' * (15 - i)
r.sendline(payload)
cipher = r.recvline()
cipher = base64.b64decode(cipher)
if cipher[16:32] == cipher[32:48]:
first_flag = first_flag + j.to_bytes()
break
last_flag = b''
for i in range(21-16):
for j in wordlist:
r = remote("127.0.0.1", 10002)
payload = b'0' * 11 + j.to_bytes() + \
last_flag + b'0' * 27
r.sendline(payload)
cipher = r.recvline()
cipher= base64.b64decode(cipher)
if cipher[16:32] == cipher[64:80]:
last_flag = j.to_bytes() + last_flag
break
print(first_flag + last_flag)