mirror of
https://github.com/HavocFramework/Havoc
synced 2026-06-08 11:13:29 +00:00
remove docker support for client
This commit is contained in:
@@ -1,123 +0,0 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
# Dockerfile for Havoc-C2 Teamserver Client
|
||||
#
|
||||
# Commands for usage:
|
||||
#
|
||||
# Build image file:
|
||||
# 'docker build -t havoc-client -f Client-Dockerfile .'
|
||||
#
|
||||
# Run Built Image file(`-d` for persistence):
|
||||
# 'docker run -t -d -v havoc-c2-client-data:/data havoc-client'
|
||||
#
|
||||
# Copy built havoc-client from container:
|
||||
# 'docker cp <containerID>:/go/Build/bin/havoc /host/path/target'
|
||||
#
|
||||
# Let your (Linux)host accept the connection:
|
||||
# `xhost +"local:docker@"`
|
||||
# Run Havoc Teamserver client from a container:
|
||||
# `sudo docker run -t -d --net=host -e DISPLAY=$DISPLAY havoc-client`
|
||||
# Enter the Container and launch the teamserver client:
|
||||
# `sudo docker exec -it <container_name> bash`
|
||||
# Once inside the container, issue the following command to launch the teamserver client:
|
||||
# `cd /go/Build/Bin/ && ./Havoc`
|
||||
# You should now see the Havoc teamserver client running in a window!
|
||||
#
|
||||
# Install dependencies for running client locally
|
||||
# 'sudo apt-get update && sudo apt-get install -y git build-essential apt-utils cmake libfontconfig1 libglu1-mesa-dev libgtest-dev libspdlog-dev libboost-all-dev mesa-common-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5websockets5 libqt5websockets5-dev qtdeclarative5-dev'
|
||||
#
|
||||
# Extras
|
||||
# Create Data storage for persistence
|
||||
# 'docker volume create havoc-c2-client-data'
|
||||
#
|
||||
# Enter Container:
|
||||
# 'docker run exec -it <containerID> bash'
|
||||
# ------------------------------------------------------------------------------
|
||||
ARG GO_VERSION="1.19.1"
|
||||
FROM golang:${GO_VERSION}
|
||||
#
|
||||
# Set ENVs
|
||||
ENV PATH=/root/.local/bin:$PATH
|
||||
ENV TZ=Europe/Kiev
|
||||
ENV USER=root
|
||||
#
|
||||
# Add Debian Bookworm repo:
|
||||
RUN echo 'deb http://ftp.de.debian.org/debian bookworm main' >> /etc/apt/sources.list
|
||||
# Take care of TZ dep
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
#
|
||||
# Manual cmake install
|
||||
RUN apt-get update && apt-get -y install wget
|
||||
#
|
||||
# Install dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
git \
|
||||
build-essential \
|
||||
apt-utils \
|
||||
cmake \
|
||||
libfontconfig1 \
|
||||
libglu1-mesa-dev \
|
||||
libgtest-dev \
|
||||
libspdlog-dev \
|
||||
libboost-all-dev \
|
||||
mesa-common-dev \
|
||||
mingw-w64 \
|
||||
nasm \
|
||||
sudo \
|
||||
python3 \
|
||||
python3-all-dev \
|
||||
python3-pip
|
||||
#
|
||||
# qt5-default is deprecated on Ubuntu 22.04...
|
||||
RUN apt-get update && apt-get install -y \
|
||||
qtbase5-dev \
|
||||
qtchooser \
|
||||
qt5-qmake \
|
||||
qtbase5-dev-tools \
|
||||
libqt5websockets5 \
|
||||
libqt5websockets5-dev \
|
||||
qtdeclarative5-dev
|
||||
#
|
||||
# Build cmake as the repo version is out-of-date...
|
||||
RUN wget https://github.com/Kitware/CMake/releases/download/v3.24.1/cmake-3.24.1-Linux-x86_64.sh -O cmake.sh
|
||||
RUN sh cmake.sh --prefix=/usr/local/ --exclude-subdir
|
||||
#
|
||||
# Install Python3.10 from Source
|
||||
RUN apt-get install -y \
|
||||
build-essential \
|
||||
zlib1g-dev \
|
||||
libncurses5-dev \
|
||||
libgdbm-dev \
|
||||
libnss3-dev \
|
||||
libssl-dev \
|
||||
libreadline-dev \
|
||||
libffi-dev \
|
||||
libsqlite3-dev \
|
||||
wget \
|
||||
libbz2-dev
|
||||
|
||||
RUN cd /tmp/ \
|
||||
&& wget https://www.python.org/ftp/python/3.10.13/Python-3.10.13.tgz \
|
||||
&& tar -xf Python-3.10.*.tgz \
|
||||
&& cd Python-3.10.*/ \
|
||||
&& ./configure --prefix=/usr/local --enable-optimizations --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib" \
|
||||
&& make -j $(nproc) \
|
||||
&& sudo make altinstall
|
||||
|
||||
#
|
||||
# Copy over the client
|
||||
#COPY . Build/
|
||||
#RUN cd Build/ && make
|
||||
#
|
||||
# Pull the repo from Github
|
||||
RUN git clone https://github.com/HavocFramework/Havoc
|
||||
#
|
||||
# Build the cloned repos copy of the Teamserver-Client
|
||||
RUN cd Havoc/client/ && make
|
||||
#
|
||||
# Add VNC Support
|
||||
RUN apt-get update && apt-get install -y x11vnc xvfb
|
||||
#RUN echo "exec /Build/Bin/Havoc" > ~/.xinitrc && chmod +x ~/.xinitrc
|
||||
#CMD ["x11vnc", "-create", "-forever"]
|
||||
# Cleanup
|
||||
RUN rm -rf /var/lib/apt/lists/*
|
||||
#
|
||||
@@ -1,103 +0,0 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
# Dockerfile for Havoc-C2 Teamserver Client
|
||||
#
|
||||
# Commands for usage:
|
||||
#
|
||||
# Build image file:
|
||||
# 'docker build -t havoc-client -f Client-Dockerfile .'
|
||||
#
|
||||
# Run Built Image file(`-d` for persistence):
|
||||
# 'docker run -t -d -v havoc-c2-client-data:/data havoc-client'
|
||||
#
|
||||
# Copy built havoc-client from container:
|
||||
# 'docker cp <containerID>:/go/Build/bin/havoc /host/path/target'
|
||||
#
|
||||
# Let your (Linux)host accept the connection:
|
||||
# `xhost +"local:docker@"`
|
||||
# Run Havoc Teamserver client from a container:
|
||||
# `sudo docker run -t -d --net=host -e DISPLAY=$DISPLAY havoc-client`
|
||||
# Enter the Container and launch the teamserver client:
|
||||
# `sudo docker exec -it <container_name> bash`
|
||||
# Once inside the container, issue the following command to launch the teamserver client:
|
||||
# `cd /go/Build/Bin/ && ./Havoc`
|
||||
# You should now see the Havoc teamserver client running in a window!
|
||||
#
|
||||
# Install dependencies for running client locally
|
||||
# 'sudo apt-get update && sudo apt-get install -y git build-essential apt-utils cmake libfontconfig1 libglu1-mesa-dev libgtest-dev libspdlog-dev libboost-all-dev mesa-common-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5websockets5 libqt5websockets5-dev qtdeclarative5-dev'
|
||||
#
|
||||
# Extras
|
||||
# Create Data storage for persistence
|
||||
# 'docker volume create havoc-c2-client-data'
|
||||
#
|
||||
# Enter Container:
|
||||
# 'docker run exec -it <containerID> bash'
|
||||
# ------------------------------------------------------------------------------
|
||||
ARG GO_VERSION="1.19.1"
|
||||
FROM golang:${GO_VERSION}
|
||||
#
|
||||
# Set ENVs
|
||||
ENV PATH=/root/.local/bin:$PATH
|
||||
ENV TZ=Europe/Kiev
|
||||
ENV USER=root
|
||||
#
|
||||
# Add Debian Bookworm repo:
|
||||
RUN echo 'deb http://ftp.de.debian.org/debian bookworm main' >> /etc/apt/sources.list
|
||||
# Take care of TZ dep
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
#
|
||||
# Manual cmake install
|
||||
RUN apt-get update && apt-get -y install wget
|
||||
#
|
||||
# Install dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
git \
|
||||
build-essential \
|
||||
apt-utils \
|
||||
cmake \
|
||||
libfontconfig1 \
|
||||
libglu1-mesa-dev \
|
||||
libgtest-dev \
|
||||
libspdlog-dev \
|
||||
libboost-all-dev \
|
||||
mesa-common-dev \
|
||||
mingw-w64 \
|
||||
nasm \
|
||||
sudo \
|
||||
python3 \
|
||||
python3-all-dev \
|
||||
python3-pip
|
||||
#
|
||||
# qt5-default is deprecated on Ubuntu 22.04...
|
||||
RUN apt-get update && apt-get install -y \
|
||||
qtbase5-dev \
|
||||
qtchooser \
|
||||
qt5-qmake \
|
||||
qtbase5-dev-tools \
|
||||
libqt5websockets5 \
|
||||
libqt5websockets5-dev \
|
||||
qtdeclarative5-dev
|
||||
#
|
||||
# Build cmake as the repo version is out-of-date...
|
||||
RUN wget https://github.com/Kitware/CMake/releases/download/v3.24.1/cmake-3.24.1-Linux-x86_64.sh -O cmake.sh
|
||||
RUN sh cmake.sh --prefix=/usr/local/ --exclude-subdir
|
||||
#
|
||||
# Install Python3.10
|
||||
RUN apt install -y python3.10-dev libpython3.10 libpython3.10-dev python3.10 build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev
|
||||
#
|
||||
# (Local) Copy over the client
|
||||
COPY . Build/
|
||||
#
|
||||
# Pull the repo from Github
|
||||
#RUN git clone https://github.com/HavocFramework/Havoc
|
||||
#
|
||||
# Build the cloned repos copy of the Teamserver-Client
|
||||
RUN cd Build/ && make
|
||||
#
|
||||
# Add VNC Support
|
||||
RUN apt-get update && apt-get install -y x11vnc xvfb
|
||||
#RUN echo "exec /Build/Bin/Havoc" > ~/.xinitrc && chmod +x ~/.xinitrc
|
||||
#CMD ["x11vnc", "-create", "-forever"]
|
||||
# Cleanup
|
||||
RUN rm -rf /var/lib/apt/lists/*
|
||||
#
|
||||
|
||||
+1
-44
@@ -1,46 +1,3 @@
|
||||
# Havoc Teamserver Client
|
||||
|
||||
Havoc Gui Client source code.
|
||||
|
||||
### Build the Teamserver Client
|
||||
- **Pre-requisites**
|
||||
- Package list:
|
||||
1. `Python-3.10`
|
||||
2. `python3-dev`
|
||||
3. `libspdlog-dev`
|
||||
4. `qt5`-packages
|
||||
5. `libboost-all-dev`
|
||||
- **If you are running Ubuntu 20.04/22.04** as your base OS, you must first enable Python3.10 in your APT repos before you will be able to run the client successfully:
|
||||
1. `sudo apt install build-essential`
|
||||
2. `sudo add-apt-repository ppa:deadsnakes/ppa`
|
||||
3. `sudo apt update`
|
||||
4. `sudo apt install python3.10 python3.10-dev`
|
||||
- **If you are running Debian 10/11** as your base OS, you must also first setup the `bookworm` repo for getting Python3.10:
|
||||
1. `sudo apt install build-essential`
|
||||
2. `sudo apt update`
|
||||
2. `echo 'deb http://ftp.de.debian.org/debian bookworm main' >> /etc/apt/sources.list`
|
||||
4. `sudo apt install python3-dv python3.10-dev libpython3.10 libpython3.10-dev python3.10`
|
||||
5. One liner for installing all necessary packages: `sudo apt install -y git build-essential apt-utils cmake libfontconfig1 libglu1-mesa-dev libgtest-dev libspdlog-dev libboost-all-dev libncurses5-dev libgdbm-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev libbz2-dev mesa-common-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5websockets5 libqt5websockets5-dev qtdeclarative5-dev`
|
||||
- **Local Build**
|
||||
- To build the Teamserver Client locally, perform the following steps:
|
||||
1. `make`
|
||||
5. `./Havoc`
|
||||
- You should now have a fully built Teamserver client available.
|
||||
- **Docker Build**
|
||||
- To build the Teamserver Client with Docker, perform the following steps:
|
||||
1. Build the Dockerfile with Jenkins:
|
||||
* `sudo docker build -t havoc-client -f Client-Dockerfile .``
|
||||
2. (Optionally) Create a data volume for persistence:
|
||||
* `sudo docker volume create havoc-c2-client`
|
||||
2. Next, we want to run the container:
|
||||
* `sudo docker run -p 443:443 -p 40056:40056 -it -d -v havoc-c2-client:/data havoc-client`
|
||||
3. We can now enter the built container and execute the client.
|
||||
* Currently, there is no remote viewing of the container, so, good luck with that.
|
||||
- **Jenkins Docker Build**
|
||||
- To Create a Jenkins instance to perform repeated or modified builds of the Teamserver client, perform the following steps:
|
||||
1. Build the Dockerfile with Jenkins(located in the `Havoc`-root folder):
|
||||
* `sudo docker build -f JC-Dockerfile .`
|
||||
2. Next, we want to run the container:
|
||||
* `sudo docker run -p8080:8080 -it -d -v havoc-c2-data:/data havoc-client`
|
||||
3. We can now visit Jenkins at `localhost:8080` and create a Pipeline to build the Havoc Teamserver!
|
||||
* For a pre-done Groovy script, please see the `Havoc-Teamserver.groovy` in the `Assets` folder.
|
||||
Havoc Gui Client source code.
|
||||
Reference in New Issue
Block a user