Skip to content

Server As Systemd

Maxime Landon edited this page Feb 24, 2020 · 4 revisions

The C2 server can be run as a Systemd daemon.

The Unit file for the C2 server is at the root of the repo (if you cloned it) as wiregost.service.

Setting up the Unit

The content is the following (that you can just copy/paste of course):

[Unit]
Description=Wiregost (Golang Exploitation Framework)
ConditionPathExists=$PATH_TO_C2_BINARY
After=network.target

[Service]
Type=simple
User=$USER
Group=$GROUP
LimitNOFILE=1024

Restart=on-failure
RestartSec=10
startLimitIntervalSec=60

WorkingDirectory=$PATH_TO_REPO
ExecStart=$PATH_TO_C2_BINARY --name=wiregost

[Install]
WantedBy=multi-user.target

The following fields should be changed/set:

  • $USER: the user name you want to run Wiregost with
  • $GROUP: the group name you want to run Wiregost with
  • $PATH_TO_C2_BINARY: The path to the C2 Server executable
  • $PATH_TO_REPO: The path the Wiregost repo (if you cloned it), or wherever you want if you use either the statically-compiled server or one of the binary releases

Then copy the Unit file to /usr/lib/systemd/system/ directory (for Arch Linux at least, check for you distribution)

Running the Unit

Then you can use the classics:

systemctl start wiregost.service

or

systemctl enable wiregost.service

Logging

You can check logs from Wiregost by using the following command:

journalctl -f -u wiregost.service 
Clone this wiki locally