Tunneling through http server

can you use a http(s) server like a proxy?

I have a public webserver and a (ssh) server -- let's call it -- "Internal" behind it. Now I want to download files from the Internal server.

Now the trivial way would be to put a webshell on the webserver, copy the files from Internal server to the webserver with scp, and then download them from there through http(s).

But the files are too big for that. I cannot copy them on the webserver. Unless I split them into chunks, but that would take like forever

I cannot use a reverse shell, since I am behind a NAT. I cannot open new ports on the webserver since it is behind a firewall.

Could I scp the files into a fifo file and then download the fifo file with the browser? That might depend on the server? I think it is apache. But that only gives one file. If I do tar | gz > fifo, and it times out, I am stuck with an incomplete download and cannot continue it.

Ideally, I would connect to the webserver on an http port, and then take the connection away from the http server and give it to another process. To a proxy tunnel process. Is that possible? Perhaps if I attach gdb to apache and set a breakpoint on accept? But I need to keep the webserver running.

submitted by /u/lilgrogu
[link] [comments]

from hacking: security in practice https://ift.tt/BAy6OfC

Comments