Skip to content

Running Web GUI in a Docker container

fiki574 edited this page Nov 1, 2020 · 7 revisions

Original source

To be able to even run the Web GUI application inside a Docker container, you must first build a Docker image out of the provided source code. The following Dockerfile snippet does exactly that.

FROM ubuntu:bionic

WORKDIR /app
RUN apt-get update && \
    apt-get upgrade -y && \
    apt-get install -y build-essential git cmake && \
    apt-get install -y python3.6 python3-pip

RUN git clone https://github.com/malwaredllc/byob.git . && \
    rm -rf .github .gitattributes .gitignore .travis.yml LICENSE README.md

WORKDIR /app/web-gui
RUN python3.6 -m pip install pip --upgrade && \
    python3.6 -m pip install -r requirements.txt && \
    rm -rf .gitignore .travis.yml README.md requirements.txt startup.sh docker-pyinstaller*

EXPOSE 5000 1337 1338 1339
ENTRYPOINT ["python3.6", "run.py"]

The git clone in the second RUN is not a proper way of building Docker images from source code. Instead, you are advised to remove that line, remove the git package installation and add the upper snippet as Dockerfile to the appropriate root directory. This is optional step.

NOTE: Cross-compilation within a container using this image is not supported.

To build the image with the Dockerfile snippet, run the following command in the appropriate root directory containing the mentioned Dockerfile.

docker build -t byob-web:latest .

To run the built image as a container in detached mode, simply type the following command:

docker run --name byob-web -d -p 5000:5000 -p 1337:1337 -p 1338:1338 -p 1339:1339 byob-web:latest

Port 5000 serves the GUI. C2 server is running on port 1337. Port 1338 serves modules. Port 1339 serves packages.