INE Command and Control C2 CC Course File (3)
INE Command and Control C2 CC Course File (3)
Course Introduction
Alexis Ahmed
Senior Penetration Tester @HackerSploit
Offensive Security Instructor @INE
[email protected]
@HackerSploit
@alexisahmed
Course
Topic + Introduction to Command and Control
Overview (C&C/C2)
+ How C2 Frameworks Work
+ C2 Essential Terminology
+ Deploying and Operating C2 Infrastructure
+ Selecting the Correct C2 Framework
+ Red Team Operations with PowerShell-
Empire and Starkiller
+ Exploring Other Popular C2 Frameworks
+ Knowledge and
experience in
penetration testing
+ Familiarity with
Prerequisites
Windows and Linux
+ Basic familiarity with the
Metasploit Framework
+ You will have an understanding of what Command and Control is
Learning with regards to Red Team/Offensive operations.
Objectives: + You will have an understanding of what C2 Frameworks are, how
they work, what functionality they offer and the role they play in
red team operations.
+ You will have an understanding of the various communication
models and protocols used in designing, deploying and operating
C2 infrastructure .
+ You will be able to identify the correct C2 Framework to use
based on the nature of engagement you are performing in
addition to the features you require for a successful operation.
+ You will have the ability to install, configure and effectively use
PowerShell-Empire and Stakiller for Red Team operations in
Windows environments.
+ You will have the knowledge and experience in using some of the
most popular C2 Frameworks available.
Let’s Get Started!
Introduction to Command and
Control
Command and Control
● Command and Control (C2 or C&C) refers to the communication
structure used by attackers to remotely control and coordinate activities
across compromised systems.
Lateral Movement
● A key capability of C2 frameworks is facilitating lateral movement across
networks. They provide tools for compromising additional systems,
exploiting network vulnerabilities, and navigating through different
network segments.
C2 Framework Functionality
Privilege Escalation
● C2 frameworks often include modules or techniques for escalating
privileges on compromised systems. This allows operators to gain
higher-level access, enabling deeper control and broader impact on the
target environment.
Data Exfiltration
● C2 frameworks can be used to collect and exfiltrate data from
compromised systems. This is often achieved through specific
commands or scripts that retrieve sensitive information and send it back
to the C2 server.
C2 Framework Functionality
Automation & Scripting
● Many C2 frameworks support automation and scripting, allowing
operators to create custom scripts and automate repetitive tasks. This
capability is useful for streamlining complex operations and conducting
coordinated attacks.
Evasion Techniques
● C2 frameworks offer evasion techniques to help operators avoid
detection by security tools like firewalls, intrusion detection systems
(IDS), and endpoint security solutions. This might involve obfuscating
network traffic, using common ports, or employing domain fronting.
C2 Framework Functionality
Payload Development
● C2 frameworks often allow for custom payload development, giving
operators flexibility to create unique payloads or modify existing ones.
This enables red teamers to adapt their approach to specific scenarios or
environments.
Listener Listener process that runs on the C2 server or redirector. Listens for call backs from compromised hosts over a specific port or protocol and
maintains communication between the two.
Agent An agent is a piece of code or the mechanism that is generated by a C2 framework and calls back to a listener on a C2 Server.
Beacon/Beaconing This refers to when a compromised host with an active implant/agent calls-back to the C2 server for instructions.
Interface Control mechanism providing operators with interactive access to the C2 server. (Empire Client)
Payload Piece of code executed on target system in order to achieve a specific goal like establishing a reverse shell.
Stager A stager is a small executable that is an initial payload. It is a relatively small piece of code that is executed to prepare for a much larger and
more capable payload known as the stage payload.
Sleep Timer Sleep Timers are used to modify the rate at which an agent sends beacons to a C2 server. (Sleep timer of 10 seconds means that the agent
will send a beacon out every 10 seconds)
Jitter Jitter allows you to add some variability to the sleep timer in order to make the communication/traffic look less sequential. Some C2
Frameworks provide the ability to modify packets.
C2 Deployment & Operation
C2 Infrastructure Deployment
● When designing and deploying a C2 infrastructure, it is very important to
consider the following factors:
● As a result, you must choose the correct C2 framework that aligns with
the aforementioned factors.
○ Over the last decade, not much was known about C2 frameworks, how they
work and what differentiates them.
○ Another issue that has plagued Red Teamers has been the sheer number of
frameworks available in the wild.
● Website: https://www.thec2matrix.com/matrix
Demo: The C2 Matrix
Introduction To PowerShell-Empire
PowerShell-Empire
● Empire 4 is a pure PowerShell C2/post-exploitation framework built on
cryptological-secure communications and flexible architecture.
dbx Dropbox listener (Requires token in order to interact with the Dropbox API)
http_hop HTTP/HTTPS listener that redirects commands to another listener to conceal the initial IP
address
http_mapi HTTP/HTTPS listener that uses the Liniaal utility allowing you to gain control over the target
host through an Exchange server
PowerShell-Empire Stagers
LISTENER FUNCTIONALITY
Csharp_exe PowerShell C# PE