首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Ruby Gem Minimagic Command Execution
来源:http://vapid.dhs.org 作者:Cashdollar 发布时间:2013-03-14  
MiniMagic ruby gem remote code execution 

3/12/2013

https://github.com/hcatlin/mini_magick

A ruby wrapper for ImageMagick or GraphicsMagick command line.

Tested on both Ruby 1.9.2 and Ruby 1.8.7.

If a URL is from an untrusted source, commands can be injected into it for remote code execution with the ; character.

image = MiniMagick::Image.open(remoteurl) image.resize "5x5"
image.format "gif"
image.write "localcopy.gif"

./hcatlin-mini_magick-1.3.1/lib/mini_magick.rb

Lines

172 command = "#{MiniMagick.processor} #{command} {args.join(' ')}".strip 173

174       if ::MiniMagick.use_subexec
175         sub = Subexec.run(command, :timeout => MiniMagick.timeout)
176         exit_status = sub.exitstatus
177         output = sub.output
178       else 
179         output = `{command} 2>&1`
180         exit_status = $?.exitstatus
181       end

The .strip will only remove whitespace from the beginning and end of the command.

Larry W. Cashdollar
@_larry0
http://vapid.dhs.org

 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Ruby Gem Fastreader 1.0.8 Comm
·Ruby Gem Curl Command Executio
·Linux Kernel 'SCTP_GET_ASSOC_S
·Fedora Linux SOCK_DIAG Local R
·Microsoft Office PowerPoint 20
·Google Chrome 21.0.1180.57 NUL
·Honeywell HSC Remote Deployer
·Nitro Pro 8.0.3.1 - Crash PoC
·Fedora Ubuntu kernel 3.3-3.8 L
·OpenPLI Webif Arbitrary Comman
·Ubuntu 12.10 64bit Local Root
·Sami FTP Server LIST Command B
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved