Rating:

Format string vulnerability to leak stack and libc addresses. Overwrite return address to return to main for more input opportunities. Overwrite printf GOT with system and send /bin/sh\x00 as next payload. See original for more details.

Original writeup (https://github.com/acsjakub/writeups/tree/master/angstromctf2020/LIBrary_in_C).