Skip to content

Commit faa5507

Browse files
Merge pull request EmpireProject#848 from EmpireProject/dev-docker
Docker build release
2 parents 8862a83 + 29618fc commit faa5507

File tree

6 files changed

+101
-2
lines changed

6 files changed

+101
-2
lines changed

.build.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
set -ex
3+
# SET THE FOLLOWING VARIABLES
4+
# docker hub username
5+
USERNAME=empireproject
6+
# image name
7+
IMAGE=empire
8+
docker build -t $USERNAME/$IMAGE:latest .

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ empire.debug
55
*.pyc
66
downloads/*
77
.vscode/*
8+
.idea/*
89
*.txt
910
LastTask*
1011
data/obfuscated_module_source/*.ps1

.release.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
set -ex
3+
4+
# SET THE FOLLOWING VARIABLES
5+
USERNAME=empireproject
6+
IMAGE=empire
7+
VERSION="$(curl -s https://raw.githubusercontent.com/EmpireProject/Empire/master/lib/common/empire.py | grep "VERSION =" | cut -d '"' -f2)"
8+
9+
# UPDATE THE SOURCE CODE
10+
git pull
11+
12+
# ALERT VERSION
13+
echo "Building Version: $VERSION"
14+
15+
# START BUILD
16+
./.build.sh
17+
18+
# DOCKER TAG/VERSIONING
19+
docker tag $USERNAME/$IMAGE:latest $USERNAME/$IMAGE:$VERSION
20+
21+
# PUSH TO DOCKER HUB
22+
docker push $USERNAME/$IMAGE:latest
23+
echo "Docker image pushed: $USERNAME/$IMAGE:latest"
24+
docker push $USERNAME/$IMAGE:$VERSION
25+
echo "Docker image pushed: $USERNAME/$IMAGE:$VERSION"

Dockerfile

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# NOTE: Only use this when you want to build image locally
2+
# else use `docker pull empireproject\empire:{VERSION}`
3+
# all image versions can be found at: https://hub.docker.com/r/empireproject/empire/
4+
5+
# -----BUILD COMMANDS----
6+
# 1) build command: `docker build -t empireproject/empire .`
7+
# 2) create volume storage: `docker create -v /opt/Empire --name data empireproject/empire`
8+
# 3) run out container: `docker run -ti --volumes-from data empireproject/empire /bin/bash`
9+
10+
# -----RELEASE COMMANDS----
11+
# 1) `USERNAME=empireproject`
12+
# 2) `IMAGE=empire`
13+
# 3) `git pull`
14+
# 4) `export VERSION="$(curl -s https://raw.githubusercontent.com/EmpireProject/Empire/master/lib/common/empire.py | grep "VERSION =" | cut -d '"' -f2)"`
15+
# 5) `docker tag $USERNAME/$IMAGE:latest $USERNAME/$IMAGE:$VERSION`
16+
# 1) `docker push $USERNAME/$IMAGE:latest`
17+
# 2) `docker push $USERNAME/$IMAGE:$VERSION`
18+
19+
# -----BUILD ENTRY-----
20+
21+
# image base
22+
FROM ubuntu:16.04
23+
24+
# author
25+
MAINTAINER Killswitch-GUI
26+
27+
# extra metadata
28+
LABEL version="1.0"
29+
LABEL description="Dockerfile base for Empire server."
30+
31+
# expose ports for Empire C2 listerners
32+
# EXPOSE 80,443
33+
34+
# update repo sources
35+
RUN apt-get clean
36+
RUN apt-get update
37+
38+
# build depends
39+
RUN apt-get install -qy apt-utils
40+
RUN apt-get install -qy git
41+
RUN apt-get install -qy wget
42+
RUN apt-get install -qy curl
43+
RUN apt-get install -qy sudo
44+
RUN apt-get install -qy lsb-core
45+
RUN apt-get install -qy python2.7
46+
RUN apt-get install -qy python-pip
47+
48+
# cleanup image
49+
RUN apt-get -qy autoremove
50+
51+
# build empire
52+
RUN git clone https://github.com/EmpireProject/Empire.git /opt/Empire
53+
ENV STAGING_KEY=RANDOM
54+
RUN cd /opt/Empire/setup/ && ./install.sh
55+
56+
# -----END OF BUILD-----
57+
58+
59+
60+

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22

33
Empire is a post-exploitation framework that includes a pure-PowerShell2.0 Windows agent, and a pure Python 2.6/2.7 Linux/OS X agent. It is the merge of the previous PowerShell Empire and Python EmPyre projects. The framework offers cryptologically-secure communications and a flexible architecture. On the PowerShell side, Empire implements the ability to run PowerShell agents without needing powershell.exe, rapidly deployable post-exploitation modules ranging from key loggers to Mimikatz, and adaptable communications to evade network detection, all wrapped up in a usability-focused framework. PowerShell Empire premiered at [BSidesLV in 2015](https://www.youtube.com/watch?v=Pq9t59w0mUI) and Python EmPyre premeiered at HackMiami 2016.
44

5-
To install, run the `./setup/install.sh` script. There's also a [quickstart here](http://www.powershellempire.com/?page_id=110) and full [documentation here](http://www.powershellempire.com/?page_id=83).
6-
75
Empire relies heavily on the work from several other projects for its underlying functionality. We have tried to call out a few of those people we've interacted with [heavily here](http://www.powershellempire.com/?page_id=2) and have included author/reference link information in the source of each Empire module as appropriate. If we have failed to improperly cite existing or prior work, please let us know.
86

97
Empire is developed by [@harmj0y](https://twitter.com/harmj0y), [@sixdub](https://twitter.com/sixdub), [@enigma0x3](https://twitter.com/enigma0x3), [rvrsh3ll](https://twitter.com/424f424f), [@killswitch_gui](https://twitter.com/killswitch_gui), and [@xorrior](https://twitter.com/xorrior).
108

119
Feel free to join us on Slack! http://adaptiveempire.herokuapp.com/
1210

11+
## Install
12+
13+
To install, run the `./setup/install.sh` script or use the corresponding docker image `docker pull empireproject/empire`.
14+
15+
There's also a [quickstart here](http://www.powershellempire.com/?page_id=110) and full [documentation here](http://www.powershellempire.com/?page_id=83).
1316

1417
## Contribution Rules
1518

changelog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ Running
22
------------
33
- Added Kevin Robertson's Invoke-SMBExec.ps1
44
- Update Invoke-DCOM
5+
- Added Dockerfile, Docker Hub images, Build/Release scripts
6+
- Updated README for cleaner install instructions with new options
57

68
10/29/2017
79
------------

0 commit comments

Comments
 (0)