Re:File Transfer with SSH, Tee, and Base64
by djent on Thursday September 17, 2020 @11:35AM
(#24505923)
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
[ Parent
| on HN ]
Re:File Transfer with SSH, Tee, and Base64
by susam on Thursday September 17, 2020 @01:05PM
(#24507146)
I mentioned in my blog post that there is an SSH gateway in between. I tried this on my local system:
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.
Re:File Transfer with SSH, Tee, and Base64
by lathiat on Thursday September 17, 2020 @11:07PM
(#24512573)
I know we're getting into the weeds here but for the benefit of people learning random things that work slightly differently (tm)
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 :)
Re:File Transfer with SSH, Tee, and Base64
by livre on Thursday September 17, 2020 @12:54PM
(#24507002)
I think we can assume that if they are restricting things as the article describes they also disabled port forwarding.
Re:File Transfer with SSH, Tee, and Base64
by susam on Thursday September 17, 2020 @01:06PM
(#24507156)
That's right. See https://news.ycombinator.com/item?id=24507146 for example.
Re:File Transfer with SSH, Tee, and Base64
by AnotherGoodName on Thursday September 17, 2020 @01:01PM
(#24507092)
Port forwarding your local machine is always an option.
Re:File Transfer with SSH, Tee, and Base64
by AnotherGoodName on Thursday September 17, 2020 @12:49PM
(#24506928)
Or you can open SSH back to your local port forwarded server from the remote SSH shell. At that point you can pipe whatever you want to/from your local server using the standard SSH commands.