ThePorgs / Exegol

Fully featured and community-driven hacking environment

Home Page:https://exegol.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add command line argument -P

MattPlayGamez opened this issue · comments

Dear,

Would it be possible to add the -P (publish all ports) with docker.
There is an example at: https://docs.docker.com/desktop/networking/
At the end of the page.
Kind Regards,
Matt

Hello,

The -P docker function allows to expose automatically the ports to be exposed (to random host port) declared in the image and not all the ports.

For example, the nginx docker image is built with the configuration EXPOSE 80, if a container based on this image is created with the -P option, only the declared port 80 will be exposed on the host with a random port.

PoC:

docker run --rm --name test -d -P nginx
docker ps | grep test
docker stop test

The exegol image do not configure any port to be exposed by default, so this parameter will unfortunately be useless...

Thanks anyway for the request, it could indeed have been an omissions.

Regards

Dear @Dramelac,

I see the issue in it.
Does there exists another way to publish all ports/all used ports.
It's incredibly anoying when needing to restart a container to forward the ports.

Kind Regards,
Matt

Hey @MattPlayGamez,

I assume you are using the ARM architecture, because with AMD you can use --network=host.
I had the same problem on my Mac M2. I think there are 2 solutions :

  • The first is to expose a range of ports (docker run -p 7000-8000:7000-8000)
  • The second (I prefer) is to use a VPN tunnel between your Host and your Container. Actually, I use Tailscale (https://tailscale.com). It's simple and easy to have a tunnel.

At the moment, there are not very good solutions to solve this problem with Docker.

Regards,

The --network=host limitation is not ARM, it's just Docker desktop so this limitation apply to Windows and Mac hosts.

For the moment the Exegol wrapper does not allow to open a list of ports unfortunately (only specifically designated ports).

One of the manual workarounds is to set up a VPN tunnel between the container and the host to bypass the docker limitation (similar @QU35T-code 2nd solution). An automatic implementation of this kind of setup might be implemented in the Exegol wrapper at some point but not at the moment.

Hi @QU35T-code,
I'm on Windows, so --network=host doesn't work.
I've also been using Tailscale, but I can't really forward ports to outside my network/devices without Tailscale.

@Dramelac I think I'm going to setup OpenVPN until there is a universal solution. But I think I still have the problems with getting a reverse shell to Exegol. Sorry to answer too late, I hadn't pinged you. I just noticed

Thanks for responding,
Matt

I'm closing the issue.
This will be resolved in the future