
이 프로젝트는 취약한 버전의 mholt/archiver 패키지를 사용하여 **Zip Slip 취약점(CVE-2019-10743)**을 시연합니다.
Zip Slip은 Snyk의 보안 연구원들이 발견한 취약점입니다. 이 취약점은 실제 환경에서 사용되는 여러 패키지에 영향을 미치는 것으로 밝혀졌습니다. 이 취약점은 다음과 같은 문제를 초래할 수 있습니다:
mholt/archiver는 아카이브 파일과 압축 파일을 다루기 위한 간단하고 일관된 API를 제공하는 Go 패키지입니다. .zip, .tar, .tar.gz, .7z 또는 .rar과 같은 형식을 지원합니다.
mholt/archiver 패키지를 사용하여 파일을 추출합니다../../../../../tmp/hacked.txt)이 포함될 수 있습니다# Start the vulnerable server
./docker-run.sh start
# Stop the server
./docker-run.sh stop
# View logs
./docker-run.sh logs
# Clean up
./docker-run.sh cleanup
주의: docker-run.sh에 실행 권한이 있는지 확인하십시오:
# Give execution rights
chmod +x ./docker-run.sh
컨테이너가 실행된 후 다음 명령과 유사한 명령을 사용하여 테스트 환경에 액세스할 수 있습니다:
# Connect to the container that is running the application
docker exec -it zipslip-vulnerable-server /bin/bash
# Install Python dependencies
pip3 install -r requirements.txt
# Execute the payload
python3 test_exploit.py -p "../../../../../../tmp/hacked.txt" -c "You were pwned!"
참고: 명령은 컨테이너 내부에서 실행할 수 있어야 합니다.
-u, --url: 서버 URL (기본값: http://localhost:8080)-z, --zip: ZIP 파일 이름 (기본값: malicious_test.zip)-p, --path: 경로 탐색 파일 이름 (기본값: ../../../malicious_escaped.txt)-c, --content: 파일 내용이 취약점을 해결하려면:
mholt/archiver 버전 3.3.2 이상 사용