├── Dockerfile ├── README.md └── launch.sh /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM kalilinux/kali-linux-docker 2 | MAINTAINER @evasiv3 (x [at] attactics.org | PGP 2AB3FA6FCA75105F) 3 | RUN echo "deb http://http.kali.org/kali kali-rolling main contrib non-free" > /etc/apt/sources.list && \ 4 | echo "deb-src http://http.kali.org/kali kali-rolling main contrib non-free" >> /etc/apt/sources.list 5 | ENV DEBIAN_FRONTEND noninteractive 6 | RUN apt-get -y update && apt-get -y dist-upgrade && apt-get clean && apt-get -y update 7 | RUN apt-get -y install python git python-pip libssl-dev libffi-dev python-dev python-m2crypto swig lsb-release 8 | RUN pip install pyopenssl 9 | RUN mkdir /root/empire 10 | ADD launch.sh /root/ 11 | RUN git clone https://github.com/PowerShellEmpire/Empire.git /root/empire 12 | ENV STAGING_KEY=RANDOM 13 | RUN bash -c "cd /root/empire/setup && /root/empire/setup/install.sh" 14 | RUN chmod +x /root/launch.sh 15 | CMD ["/root/launch.sh"] 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PowerShell Empire Docker Build 2 | A docker build for PowerShell Empire by evasiv3 (x *at* attactics.org | PGP 2AB3FA6FCA75105F) 3 | 4 | ###Usage & Considerations 5 | In order to build the docker container yourself, you will need to clone this repository: 6 | ```sh 7 | git clone https://github.com/attactics/PowerShellEmpireDocker 8 | ``` 9 | Once you have the repository cloned you will need to build the image from within the cloned directory: 10 | ```sh 11 | cd PowerShellEmpireDocker 12 | docker build -t PowerShellEmpire . 13 | ``` 14 | Once the image has been built, a container can be created and ran. For example: 15 | ```sh 16 | docker run -it --name PowerShellEmpireDocker -p [HOST_IP]:[HOST_PORT]:[CONTAINER_PORT] -v /tmp:/tmp PowerShellEmpire 17 | ``` 18 | Taking a look at the run command: 19 | * -it instructs docker to let us interact with the container (input & output) 20 | * -p instructs docker to forward communication received on the host IP on port 8080 to the container on port 8080. This can be modified as desired, however it is important to specify the host interface you intend stagers to communicate with. 21 | * -v create a volume linking the host /tmp directory to the containers /tmp directory. This exists to conveniently write stager output files to the host for use. By default, PowerShell Empire writes generated stager files to /tmp. The host location is arbitrary. 22 | 23 | #####Important Note 24 | Bear in mind that when configuring listeners you must specify the IP address of the _host_ interface you intend to receive connections on. PowerShell Empire will bind a listener to 0.0.0.0, as such even if you specify an IP that does not exist within the container, it will bind without issue. Specifying the host interface when configuring the listener ensures that the stager is built with this same host interface, allowing it to connect back to the host as opposed to a local network interface that exists within docker networking. 25 | 26 | ###I'm lazy! 27 | If the above build process consists of more keys than you can bring yourself to type, the pre-built image can be found on docker hub. I intend to update them regulary. You can pull the image to your local device by executing the following 28 | ```sh 29 | docker pull attactics/powershellempire 30 | ``` 31 | -------------------------------------------------------------------------------- /launch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd /root/empire 3 | ./empire 4 | --------------------------------------------------------------------------------