Enabling Cloud C2 as a service on boot with SystemD
Note: From version 3.0.0 onward all, Cloud C2 editions (Community, Edition, Teams) use the same binary. Filenames for Cloud C2 will differ from example - however all parameters remain the same.
# Enabling Cloud C2 as a service on a Linux-64 host with SystemD
# Builds on Hak5 episodes 2701 and 2702 with credit to Void-Byte
# Expects Cloud C2 Community edition has run once before, generating c2.db
# Move Cloud C2 binary.
sudo mv c2_community-linux-64 /usr/local/bin
# Create directory for database file
sudo mkdir /var/cloudc2
# Move database file
sudo mv c2.db /var/cloudc2/
# Create systemd service file.
sudo vi /etc/systemd/system/cloudc2.service
# Replace parameters as necessary for your instance
Description=Hak5 Cloud C2
ExecStart=/usr/local/bin/c2_community-linux-64 -hostname example.com -https -db /var/cloudc2/c2.db
# Reload, enable on boot, start and inspect the newly created Cloud C2 service
sudo systemctl daemon-reload
sudo systemctl enable cloudc2.service
sudo systemctl start cloudc2.service
sudo systemctl status cloudc2.service