For completeness, here is a short script that automates the whole process – useful when the challenge runs on a remote host.