Install Havoc C2 on Ubuntu 22.04 (2025)
Step by step demonstration of installing Havoc C2 on Ubuntu 22.04 and addressing some errors with the current release.
I recently decided to try out Havoc C2 in my lab. The official documentation provides step-by-step installation commands but I faced some issue while installing the latest release (as of 19 January 2025). If you are in the same bucket, follow the steps below to resolve errors and successfully setup Havoc C2.
I did this on a fresh install on Ubuntu 22.04.
Git and curl are not available in a fresh install of Ubuntu 22.04. Let’s install them first:
sudo apt install git sudo apt install curl
Download the Havoc C2 source code from GitHub:
git clone https://github.com/HavocFramework/Havoc.git cd Havoc
Setup and install prerequisites (I have removed git from the fourth command as it was already installed in step 1):
sudo add-apt-repository ppa:deadsnakes/ppa sudo apt update sudo apt install python3.10 python3.10-dev sudo apt install -y 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 golang-go qtbase5-dev libqt5websockets5-dev python3-dev libboost-all-dev mingw-w64 nasm
Next, install required go modules
cd teamserver go mod download golang.org/x/sys go mod download github.com/ugorji/go cd ..
These commands will throw following errors:
go: errors parsing go.mod:
/home/havoc/Havoc/teamserver/go.mod:3: invalid go version '1.21.0': must match format 1.23
go: module github.com/ugorji/go: not a known dependency
To fix the first error, edit the go.mod file in the teamserver folder and change the golang version from 1.21.0 to 1.23. There is already an issue open for this.
You can ignore the second one as it doesn’t impact the installation.
While at it, lets update the Golang as well. Head over to the Go Programming Language website and download the latest golang release. In this case, I downloaded go1.23.5.linux-amd64.tar.gz as it was the latest release at the time of writing.
Next, delete the previously installed go binary:
sudo rm -rf /usr/bin/go
Install the downloaded version and update the PATH variable:
sudo tar -C /usr/local -xzf go1.23.5.linux-amd64.tar.gz export PATH=$PATH:/usr/local/go/bin
In case your downloaded version is later than 1.23.5, remember to change the version number in the above command.
You should have the latest version of Golang installed now
Now, build the team server by issuing the following command from Havoc root directory:
make ts-build # Run the teamserver ./havoc server --profile ./profiles/havoc.yaotl -v --debug
If you build it without updating Golang you will see the following error (this will be fixed after updating Golang to the latest version):
.. / .. /go/pkg/mod/github.com/pelletier/go-toml/v2@v2.2.3/marshaler.go:11:2: package slices is not in GOROOT (/usr/lib/go-1.18/src/slices)
make: *** [makefile:12: ts-build] Error 1
Finally, build the client by issuing the following command from Havoc root directory:
make client-build # Run the client ./havoc client
You can find the password for the user 5spider in
profiles/havoc.yaotl
file.
Red Team Notes
- If you are facing any issues in installing Havoc C2, use this step by step guide.
Follow my journey of 100 Days of Red Team on WhatsApp or Discord.
The following video demonstrates the above steps in my lab: