Do you really want a guide for this? :(

You might want to script the last 2 levels using pwntools (there’s a community dojo for that)