Docker

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

Manual install:

wget https://raw.githubusercontent.com/nettitude/PoshC2/master/Install-for-Docker.sh
chmod +x ./Install-for-Docker.sh
./Install-for-Docker.sh

Other OSs

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:

posh-docker-build

Once this has completed, then edit the configuration file as usual with

posh-config

Then run the server in a container with:

posh-docker-server

Or as a service on *nix with:

posh-docker-service

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:

posh-docker-clean