You can also run PoshC2 using Docker, this allows more stable and running and enables PoshC2 to easily run on other operating systems.
To start with, install Docker on the host and then add the PoshC2 installation and project directories to the Docker as shared directories. By default on Debian these are /opt/PoshC2 and /opt/PoshC2_Project.
Debian based hosts¶
Automatic PoshC2 install for Python3 using curl & bash
curl -sSL https://raw.githubusercontent.com/nettitude/PoshC2/master/Install-for-Docker.sh | bash
wget https://raw.githubusercontent.com/nettitude/PoshC2/master/Install-for-Docker.sh chmod +x ./Install-for-Docker.sh ./Install-for-Docker.sh
On other *nix flavours and MacOS, copy the posh-docker* commands to your path. On Windows, import the PoshC2.psm1 PowerShell module.
Running PoshC2 in Docker¶
You can build the Docker image after installing by issuing this command:
Once this has completed, then edit the configuration file as usual with
Then run the server in a container with:
Or as a service on *nix with:
The Implant-Handler can then be started using:
posh-docker -u <username>
All project content is stored in the project directory on the host.
You can clean the Docker containers and images on the host using the following command: