docker
parent
125a98fd1a
commit
3f5efeb516
|
@ -5,4 +5,7 @@ set -ex
|
|||
USERNAME=empireproject
|
||||
# image name
|
||||
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 .
|
||||
|
|
54
Dockerfile
54
Dockerfile
|
@ -21,40 +21,42 @@
|
|||
# image base
|
||||
FROM ubuntu:16.04
|
||||
|
||||
# author
|
||||
MAINTAINER Killswitch-GUI
|
||||
# pull from BUILD
|
||||
ARG empirversion
|
||||
|
||||
# extra metadata
|
||||
LABEL version="1.0"
|
||||
LABEL maintainer="EmpireProject"
|
||||
LABEL description="Dockerfile base for Empire server."
|
||||
LABEL version=${empirversion}
|
||||
|
||||
# expose ports for Empire C2 listerners
|
||||
# EXPOSE 80,443
|
||||
# env setup
|
||||
ENV STAGING_KEY=RANDOM
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# update repo sources
|
||||
RUN apt-get clean
|
||||
RUN apt-get update
|
||||
# set the def shell for ENV
|
||||
SHELL ["/bin/bash", "-c"]
|
||||
|
||||
# build depends
|
||||
RUN apt-get install -qy apt-utils
|
||||
RUN apt-get install -qy git
|
||||
RUN apt-get install -qy wget
|
||||
RUN apt-get install -qy curl
|
||||
RUN apt-get install -qy sudo
|
||||
RUN apt-get install -qy lsb-core
|
||||
RUN apt-get install -qy python2.7
|
||||
RUN apt-get install -qy python-pip
|
||||
# install basic build items
|
||||
RUN apt-get update && apt-get install -qy \
|
||||
wget \
|
||||
curl \
|
||||
git \
|
||||
sudo \
|
||||
apt-utils \
|
||||
lsb-core \
|
||||
python2.7 \
|
||||
python-pip
|
||||
|
||||
# cleanup image
|
||||
RUN apt-get -qy autoremove
|
||||
RUN apt-get -qy clean \
|
||||
autoremove
|
||||
|
||||
# build empire
|
||||
RUN git clone https://github.com/EmpireProject/Empire.git /opt/Empire
|
||||
ENV STAGING_KEY=RANDOM
|
||||
RUN cd /opt/Empire/setup/ && ./install.sh
|
||||
# build empire from source
|
||||
RUN git clone https://github.com/EmpireProject/Empire.git /opt/Empire && \
|
||||
cd /opt/Empire/setup/ && \
|
||||
./install.sh && \
|
||||
rm -rf /opt/Empire/data/empire*
|
||||
|
||||
WORKDIR "/opt/Empire"
|
||||
ENTRYPOINT ["./empire"]
|
||||
# -----END OF BUILD-----
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
7
empire
7
empire
|
@ -1,6 +1,6 @@
|
|||
#!/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
|
||||
from flask import Flask, request, jsonify, make_response, abort, url_for
|
||||
from time import localtime, strftime, sleep
|
||||
|
@ -1326,6 +1326,11 @@ if __name__ == '__main__':
|
|||
|
||||
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:
|
||||
args.restport = '1337'
|
||||
else:
|
||||
|
|
|
@ -33,6 +33,9 @@ then
|
|||
rm -rf ./downloads/
|
||||
fi
|
||||
|
||||
# start up Empire
|
||||
# ./empire --debug 2
|
||||
# start up Empire if not in docker otherwise return
|
||||
if [ -f /.dockerenv ]; then
|
||||
echo " [*] Empire reset complete returning back to Docker"
|
||||
else
|
||||
./empire
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue