HackPathHackPath
CoursesRoadmapPracticePricing
>_
HackPath

C2 & Post-Exploitation

0%
Lessons
Understanding C2
01What is a C2?
40 min
02Listener / Agent / Teamserver Architecture
45 min
Advanced Metasploit
03Advanced Meterpreter
50 min
04Metasploit Post-Exploitation Modules
48 min
05Pivoting with Metasploit
55 min
Cobalt Strike concepts
06Beacon and Listeners — C2 Concepts
45 min
07Malleable C2 Profiles
52 min
Persistence
08Windows Persistence
58 min
09Linux Persistence
52 min
Pivoting & Tunneling
10SSH Port Forwarding
44 min
11Proxychains and SOCKS
48 min
12Chisel and ligolo-ng
60 min

Lesson 01

What is a C2?

Define what a C2 is, why it exists, and how it differs from a simple shell.

C2 & Post-Exploitation/What is a C2?

What is a C2?

A Command & Control (C2 or C&C) is the infrastructure an attacker uses to control their agents deployed on compromised systems. It is the brain of the offensive operation: without a C2, an attacker cannot maintain access, run commands, or exfiltrate data.

High-level C2 architecture diagram: operator, teamserver, listeners, and an agent that checks in periodically to pull tasks and send results.
A C2 is an infrastructure: operator → teamserver → listener(s) ↔ agent (check-ins + task queue).

The attacker / agent / C2 model

In any offensive operation, three elements coexist:

ElementRoleExamples
Attacker (operator)Sends orders, receives resultsRed teamer, pentester
C2 server (teamserver)Receives agent connections, relays ordersMetasploit, Cobalt Strike, Sliver
Agent (beacon / implant)Runs on the compromised target, executes commandsMeterpreter, Beacon, custom implant
C2 agent teamserver operator

Why a C2 and not just a reverse shell?

A basic reverse shell (bash -i >& /dev/tcp/...) is fragile:

  • It dies on the slightest network interruption
  • It does not support multiple operators simultaneously
  • It does not encrypt communications
  • It is trivial to detect (raw TCP connection)

A professional C2 provides:

FeatureWhat it provides
Encrypted communications (TLS, HTTPS)Evades IDS/IPS that inspect traffic
Sleep / jitterThe agent wakes up randomly → less detectable
Multi-sessionsManage dozens of agents from a single interface
Built-in pivotingHop into internal networks that are not exposed
Post-exploitation modulesKeylogger, screenshot, dump credentials, privilege escalation
PersistenceSurvives reboots via registry, services, scheduled tasks
encryption sleep/jitter multi-sessions persistence

The most well-known C2s

C2LicenseAgentUsed by
Metasploit FrameworkOpen sourceMeterpreterPentesters, CTF
Cobalt StrikeCommercial (5,000$/year)BeaconRed teams, APTs (cracked versions)
SliverOpen source (BishopFox)Go implantModern red teams
HavocOpen sourceDemonAdvanced red teams
Brute Ratel C4CommercialBadgerRed teams, APT groups
Metasploit Cobalt Strike Sliver Havoc

C2 communication protocols

An agent must communicate with its server without getting detected. Modern C2s support multiple protocols to mimic legitimate traffic:

ProtocolAdvantageDrawback
HTTPSWorks almost everywhere, natively encryptedInspected by corporate proxies
DNSRarely filtered, traverses firewallsVery low bandwidth
SMB (named pipe)Internal lateral movement, no external trafficLimited to internal networks
HTTP via CDNTraffic looks legitimate (Cloudflare, AWS)More complex configuration
HTTPS DNS SMB CDN

C2 in the attack cycle (Kill Chain)

C2 happens after the initial compromise:


Reconnaissance → Weaponization → Delivery → Exploitation
→ Installation (agent deployed) → C2 (communication) → Actions on Objectives

C2 phases include:

  • Lateral movement: reach other machines from the agent
  • Privilege escalation: move from user to SYSTEM/root
  • Exfiltration: extract sensitive data
  • Persistence: survive reboots
kill chain lateral movement exfiltration

Flashcards

Flashcards
Flashcard

What is the difference between a reverse shell and a C2 agent?

Flashcard

What is 'sleep/jitter' in a C2?

Flashcard

Why is DNS used as a C2 channel despite its low bandwidth?

Flashcard

Which Kill Chain phase corresponds to the use of C2?

Open Questions

Question 1 — What are the trade-offs between responsiveness and stealth (sleep/jitter) in a C2?

Next Lesson

You now understand C2 fundamentals. The next lesson covers C2 architecture in detail: listeners, agents, and how a teamserver coordinates command and control.

Next: C2 Architecture — Listener, Agent, Teamserver

Hands-on challenge

Practice what you learned — run it on your machine.

Do the challenge →

You're on a free lesson

Ready to go further?

Unlock all courses, exercises, real-world scenarios and flashcards — everything to build real skills.

Unlock full access →

No commitment · Cancel anytime

Sign in to track your progress.

Sign in to validate →

11 lessons locked in this course · 800+ students enrolled

$99/year — save 31% vs monthly

Unlock full access →