Maintaining Access
WireGuard is an extremely simple yet fast and modern VPN that utilizes state-of-the-art cryptography. In penetration testing, it is used to create secure, persistent tunnels for maintaining access to compromised networks.
sudo apt install wireguard
wg-quick up <interface>
WireGuard is a modern VPN protocol that uses state-of-the-art cryptography to create secure network tunnels. In penetration testing, it enables persistent, encrypted access to compromised networks with minimal latency.
Unlike traditional VPNs, WireGuard integrates directly into the Linux kernel, provides seamless roaming, and requires minimal configuration — making it the go-to choice for red teams requiring reliable covert channels.
wg genkey > privatekeyGenerate a new private key and save it to a filewg pubkey < privatekey > publickeyDerive the public key from an existing private keywg genkey | tee privatekey | wg pubkey > publickeyGenerate a private key and its matching public key in one pipelinewg genpsk > presharedkeyGenerate a preshared key for extra symmetric protectionwg showShow status of all active WireGuard interfaceswg show allExplicitly show every interface's peers and statswg show wg0Show status, peers and handshakes for interface wg0wg show wg0 dumpPrint a tab-separated machine-readable dump of wg0wg show interfacesList the names of all WireGuard interfaceswg show wg0 public-keyPrint only the public key of interface wg0wg showconf wg0Print the current configuration of wg0 in config-file formatwg-quick up wg0Bring up the interface defined in /etc/wireguard/wg0.confwg-quick down wg0Tear down the wg0 interface and restore routingwg-quick save wg0Save the running config of wg0 back to its .conf filewg-quick strip wg0Print the config with wg-quick-only keys removed (for wg setconf)Maintain long-term encrypted access to compromised networks.
Route C2 traffic through encrypted WireGuard tunnels.
Access internal subnets via encrypted tunnel.
Hide C2 traffic within legitimate VPN connections.
This tool is designed for authorized security testing, educational purposes, and legitimate network administration only. Unauthorized access to computer systems is illegal.