This guide walks you through setting up Sliver C2 integration with wish.
Sliver is an open-source Command and Control (C2) framework designed for security professionals. It provides:
- Cross-platform implant generation
- Secure communication channels
- Post-exploitation capabilities
- Team collaboration features
- OS: Linux, macOS, or Windows
- Architecture: x86_64 or ARM64
- Privileges: Root/Administrator access for server installation
- Network: Port 31337 (default) must be accessible
- Python 3.11 or higher
- wish installed (
pip install wish-sh)
# Download and install (requires sudo/root)
curl https://sliver.sh/install|sudo bash- Visit Sliver Releases
- Download the appropriate binary for your system
- Extract and install:
tar -xzf sliver-server_*.tar.gz sudo mv sliver-server /usr/local/bin/ sudo chmod +x /usr/local/bin/sliver-server
# Start Sliver server in background
sliver-server daemon
# Verify it's running
ps aux | grep sliver-server
# Expected output: /usr/local/bin/sliver-server daemon# Start with console interface
sliver-serverOperator configurations contain the certificates and connection details needed to connect to the Sliver server.
# Generate a new operator configuration
sliver-server operator --name $USER --lhost localhost --save wish.cfg
# Create configs directory if it doesn't exist
mkdir -p ~/.sliver-client/configs
# Move configuration to standard location
mv wish.cfg ~/.sliver-client/configs/--name: Operator name (appears in logs)--lhost: Server address (use actual IP for remote access)--save: Output filename
Sliver implements mutual TLS (mTLS) authentication:
- Server Certificate: Identifies the Sliver server
- Client Certificate: Authenticates the operator
- CA Certificate: Validates both server and client
Each operator configuration file contains:
- CA certificate (to verify server)
- Client certificate (your identity)
- Client private key (proves identity)
- Keep them secure (file permissions 600)
- Don't share them
- Generate unique configs per user
Add the following to ~/.wish/config.toml:
[c2.sliver]
enabled = true
mode = "real" # Use "real" for actual server, "mock" for testing
config_path = "~/.sliver-client/configs/wish.cfg"[c2.sliver]
enabled = true
mode = "real"
# Optional: Override server settings
# server = "192.168.1.100:31337" # Override config file server
# Optional: Safety features
[c2.sliver.safety]
sandbox_mode = true # Enable command filtering
read_only = false # Prevent write operations
allowed_commands = ["ls", "pwd", "whoami", "id", "ps"]
blocked_paths = ["/etc/shadow", "/root/.ssh"]# Check if config file exists and is readable
ls -la ~/.sliver-client/configs/wish.cfg
# Should show: -rw------- (permissions 600)# Start wish
wish
# In the wish shell, check Sliver status
/sliver status
# Expected: "Connected to Sliver C2 server"
# List active sessions (if any)
/sliver sessions# Use official Sliver client to verify server is accessible
sliver-client -c ~/.sliver-client/configs/wish.cfgCause: The operator config doesn't match the running server.
Solutions:
-
Generate a new operator configuration:
sliver-server operator --name $USER --lhost localhost --save new-config.cfg cp new-config.cfg ~/.sliver-client/configs/wish.cfg
-
Use an existing working configuration:
# If you have a working Sliver client config cp ~/.sliver-client/configs/working-config.cfg ~/.sliver-client/configs/wish.cfg
Cause: Server was restarted or certificates were regenerated.
Solution: Generate a new operator configuration (see above).
Causes:
- Server not running
- Firewall blocking port 31337
- Wrong server address in config
Debug Steps:
# Check if server is listening
netstat -tlnp | grep 31337
# Test connectivity
telnet localhost 31337
# Check firewall (Linux)
sudo iptables -L | grep 31337To inspect certificate details in your config:
import json
from pathlib import Path
config_path = Path("~/.sliver-client/configs/wish.cfg").expanduser()
with open(config_path, 'r') as f:
config = json.load(f)
print(f"Server: {config.get('lhost')}:{config.get('lport')}")
print(f"Operator: {config.get('operator')}")
print(f"Has CA cert: {'ca_certificate' in config}")
print(f"Has client cert: {'certificate' in config}")
print(f"Has private key: {'private_key' in config}")-
Unique Operators: Generate separate configs for each user
sliver-server operator --name alice --lhost server.example.com --save alice.cfg sliver-server operator --name bob --lhost server.example.com --save bob.cfg
-
Network Security:
- Use actual hostnames/IPs (not localhost) for remote access
- Configure firewall rules to limit access
- Consider VPN for additional security
-
File Permissions: Configs are automatically created with 600 permissions. Verify:
chmod 600 ~/.sliver-client/configs/*.cfg
-
Audit Logs: Sliver logs all operator actions. Monitor:
# Check Sliver logs sudo journalctl -u sliver-server
-
Mock Mode: Use mock mode for development without a real server:
[c2.sliver] enabled = true mode = "mock"
-
Local Testing: Use localhost configurations for isolated testing
-
Cleanup: Remove test configs when done:
rm ~/.sliver-client/configs/test-*.cfg
- Generate Implants: Use Sliver to create implants for target systems
- Execute Commands: Use wish's
/sliver shellcommand - Explore Features: Try file operations, port forwarding, etc.