How to finish the Python assisted exploitation in easy way?!

Hello,

I’m not sure how to finish it or when to use brute-forcing; could you please explain the steps so I know where I’m going wrong?

Thank you, everyone!