So, if you've read the article on Sliver C2, and are ready for some more fun, try multiplayer mode in Sliver.
It's "real" server mode, so multiple clients can share a server instance, instead f running their own local Sliver instance. I do recommend you try the easy setup first, since there's a few caveats to running in multiplayer mode.
Also note that this config won't be dealing with setting it up on a domain, and port forwarding through the router, since in a testing scenario I don't see any use for this kind of config, it's only for a real penetration testing / external attack scenario this would be needed, and since we're dealing with a lab scenario, this won't be further discussed, but left as something for the reader to do :)
Okish. First go to Bisho Fox's Github, and under releases download sliver-server and sliver-client, you'll need them both. I assume you downloaded them to /root
#copy client and server in place
cp sliver-server /usr/bin/
cp sliver-client /usr/bin/
Chmod them +x, so they can execute
chmod +x /usr/bin/sliver-server
chmod +x /usr/bin/sliver-client
Next, we need some config files generated for the server. It does this by itself the first time it executes, so start it.
/usr/bin/sliver-server
Now, it's gonna drop you into a command prompt in sliver. Check that you got the multiplayer commands, by calling the help command. These should be among others the new-player command.
Multiplayer:
============
kick-player Kick a player from the server
multiplayer Enable multiplayer mode
new-player Create a new player config file
players Manage operators
[server] sliver >
Now, if you don't see them, it's because the server is running in daemon mode. This can be set true or false in /root/.sliver/configs/server.json
cat server.json
{
"daemon_mode": false,
"daemon": {
"host": "",
"port": 31337
},
"logs": {
"level": 4,
"grpc_unary_payloads": false,
"grpc_stream_payloads": false
},
"jobs": {},
"watch_tower": null
}
To access multiplayer config commands, daemon mode have to be set to false. When you have that, start the server by calling /usr/bin/sliver-server, and configure the first users.
Remember to config the first user you use to start / stop the server, this would be root. If you have more users, congfirure them at this point, since you cant add them when we enable daemon mode, because the multi-user commands are going to be turned off by the server.
The format for adding users an exporting client configurations for later import is
new-player -l <HOST-IP> -n <USER-NAME> -s <PATH/TO/CERT/FILE/FILENAME>
When that is done, exit the server, and change it's daemon setting to true in /root/./sliver/configs/server.json.
Next, we need to setup a systemd init script for the server.
touch /etc/systemd/system/sliver-server.service
Edit with your preferred editor, and give the file this content.
cat /etc/systemd/system/sliver-server.service
[Unit]
Description=Sliver
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=on-failure
RestartSec=3
User=root
ExecStart=/usr/bin/sliver-server
[Install]
WantedBy=multi-user.target
Save the file, and do a daemon reload
systemctl daemon-reload
And, start the server, and check it starts as it should.
# start the server
systemctl start sliver-server
# Check status
systemctl status sliver-server
systemctl status sliver-server
● sliver-server.service - Sliver
Loaded: loaded (/etc/systemd/system/sliver-server.service; disabled; vendor preset: disabled)
Active: active (running) since Fri 2021-07-30 12:25:28 CEST; 51s ago
Main PID: 9701 (sliver-server)
Tasks: 12 (limit: 23835)
Memory: 16.7M
CPU: 106ms
CGroup: /system.slice/sliver-server.service
└─9701 /usr/bin/sliver-server
Now for the fun part. start sliver-client, and note it problably are going to refuse connecting. This is normal, since we haven't imported the config file yet. But it will setup some files we need, so let's import the keyfile
sliver-client import <KEYFILE>
Last, start the client, and choose your server. Note that the client supports multiple servers if you imported their user certs. Simply choose the server when the client starts.
└─# sliver-client
? Select a server: [Use arrows to move, enter to select, type to filter]
> root@10.x.x.x (93dcXXXXXXXXX)
root@10.x.x.x (5b76dXXXXXXXX)
That's all there is to it. If you want to update the server / client. Simply go download it from the releases page on Fox's Github, and copy it into /usr/bin/ to replace the old versions. It's just that simple.
Happy Hacking :)