readme-wiki
Alexander Rymdeko-Harvey 2017-12-19 23:03:16 -05:00
parent 125a98fd1a
commit 3f5efeb516
4 changed files with 52 additions and 39 deletions

5
.build.sh Normal file → Executable file
View File

@ -5,4 +5,7 @@ set -ex
USERNAME=empireproject USERNAME=empireproject
# image name # image name
IMAGE=empire IMAGE=empire
docker build -t $USERNAME/$IMAGE:latest . # version
VERSION="$(curl -s https://raw.githubusercontent.com/EmpireProject/Empire/master/lib/common/empire.py | grep "VERSION =" | cut -d '"' -f2)"
docker build --build-arg empireversion="$VERSION" -t $USERNAME/$IMAGE:latest .

View File

@ -21,40 +21,42 @@
# image base # image base
FROM ubuntu:16.04 FROM ubuntu:16.04
# author # pull from BUILD
MAINTAINER Killswitch-GUI ARG empirversion
# extra metadata # extra metadata
LABEL version="1.0" LABEL maintainer="EmpireProject"
LABEL description="Dockerfile base for Empire server." LABEL description="Dockerfile base for Empire server."
LABEL version=${empirversion}
# expose ports for Empire C2 listerners # env setup
# EXPOSE 80,443 ENV STAGING_KEY=RANDOM
ENV DEBIAN_FRONTEND=noninteractive
# update repo sources # set the def shell for ENV
RUN apt-get clean SHELL ["/bin/bash", "-c"]
RUN apt-get update
# build depends # install basic build items
RUN apt-get install -qy apt-utils RUN apt-get update && apt-get install -qy \
RUN apt-get install -qy git wget \
RUN apt-get install -qy wget curl \
RUN apt-get install -qy curl git \
RUN apt-get install -qy sudo sudo \
RUN apt-get install -qy lsb-core apt-utils \
RUN apt-get install -qy python2.7 lsb-core \
RUN apt-get install -qy python-pip python2.7 \
python-pip
# cleanup image # cleanup image
RUN apt-get -qy autoremove RUN apt-get -qy clean \
autoremove
# build empire # build empire from source
RUN git clone https://github.com/EmpireProject/Empire.git /opt/Empire RUN git clone https://github.com/EmpireProject/Empire.git /opt/Empire && \
ENV STAGING_KEY=RANDOM cd /opt/Empire/setup/ && \
RUN cd /opt/Empire/setup/ && ./install.sh ./install.sh && \
rm -rf /opt/Empire/data/empire*
WORKDIR "/opt/Empire"
ENTRYPOINT ["./empire"]
# -----END OF BUILD----- # -----END OF BUILD-----

7
empire
View File

@ -1,6 +1,6 @@
#!/usr/bin/env python #!/usr/bin/env python
import sqlite3, argparse, sys, argparse, logging, json, string import sqlite3, argparse, sys, argparse, logging, json, string, subprocess
import os, re, time, signal, copy, base64, pickle, random import os, re, time, signal, copy, base64, pickle, random
from flask import Flask, request, jsonify, make_response, abort, url_for from flask import Flask, request, jsonify, make_response, abort, url_for
from time import localtime, strftime, sleep from time import localtime, strftime, sleep
@ -1326,6 +1326,11 @@ if __name__ == '__main__':
args = parser.parse_args() args = parser.parse_args()
if os.path.exists('/.dockerenv')
if not os.path.exists('data/empire.db')
print '[*] Fresh start in docker, running reset.sh for you'
subprocess.call(['./setup/reset.sh']
if not args.restport: if not args.restport:
args.restport = '1337' args.restport = '1337'
else: else:

View File

@ -33,6 +33,9 @@ then
rm -rf ./downloads/ rm -rf ./downloads/
fi fi
# start up Empire # start up Empire if not in docker otherwise return
# ./empire --debug 2 if [ -f /.dockerenv ]; then
./empire echo " [*] Empire reset complete returning back to Docker"
else
./empire
fi