Frankenstein’s Password Generator
Challenge description
Dr. Frankenstein left behind a strange password generator in an abandoned NJIT laboratory. The machine refuses to start without an activation phrase. His last notebook entry reads, “A bolt at midnight gave it life.” Can you figure out what the program expects and wake the creature?
Solution
Ta thấy chương trình check bytes mình nhập vào ở hàm sub_401176, sau đó sẽ in flag ra.
Hàm check yêu cầu số byte mình nhập vào là 14 bytes, sau đó so sánh
(a1[i] ^ 0x5D) + 7 * (_BYTE)i + 11 != *(_BYTE *)(i + 0x402010)
=> a[i] = (*(_BYTE *)(i + 0x402010) - 11 - 7 * (_BYTE)i) ^ 0x5D
Ta gdb được 14 bytes ở địa chỉ 0x402010 là:
Ta viết chương trình tìm a[i]
haha = bytearray(b"\x2a\x24\x2a\x29\x43\x37\x45\x50\x5c\x5d\x65\x72\x74\x6f")
hihi = bytearray()
for i in range (14):
x = (haha[i] - 7 * i - 11)^0x5d
hihi.append(x)
print(hihi)
Ta được kết quả input:
Chạy chương trình ta có được flag:
flag: spooky{its_alive_at_midnight}