Taking control by overwriting GOT
In dynamically linked programs, when each external function (printf, strcpy, etc.) is called, it actually jumps to an address in a table called the GOT (Global Offset Table) — this table stores the REAL (library) address of the function. If you have an arbitrary write primitive (for example, via %n in the previous challenge), you can change the GOT entry so that the next time the program calls that function, it jumps to the address you want INSTEAD.
The program's GOT table:
| Function name | GOT entry (address) |
|---|---|
memcpy | 0x006015C8 |
printf | 0x00601688 |
strlen | 0x00601BB0 |
malloc | 0x00601BE8 |
free | 0x00601E08 |
strcpy | 0x00601FA0 |
The vulnerable program calls the printf() function internally to copy the text entered by the user. You have a secret function located at the address 0x00401A3E (if it is called — it prints the flag).
If you replace the printf entry in the GOT table with the value 0x00401A3E, the next time the program calls printf(), your secret function will actually be executed.
Submit the answer in the format BAYROQ{PWN_GOT_<yoziladigan GOT manzili>_<yangi qiymat>} (both in uppercase hex without 0x).