This seems like a CTF trick. If I were faced with this problem, I would do an SSH local port forward, and then just wget the file, hosted locally with python -m SimpleHTTPServer
ssh -L 9000:127.0.0.1:8000 user@host
But when I visit http://127.0.0.1:9000/ on my local system, I get a connection reset by peer error. At the same time, in the terminal where I have set up the port forward with the ssh command above, I get this error: open failed: unknown channel type
The SSH gateway is forbidding port forwarding as well.A possible workaround for this specific scenario would be to use 'sshutle' which runs a python script on the remote end to terminate the traffic.
Except in your specific scenario you'd have to somehow trick it to execute using a login shell like one of the other comments shows.
Having said all of that, I would just do what you did :)