首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
OSSEC 2.8.1 Local Root Escalation
来源:vfocus.net 作者:Widdersheim 发布时间:2015-06-12  
Fix for CVE-2015-3222 which allows for root escalation via syscheck - https://github.com/ossec/ossec-hids/releases/tag/2.8.2
 
Affected versions: 2.7 - 2.8.1
 
Beginning is OSSEC 2.7 (d88cf1c9) a feature was added to syscheck, which
is the daemon that monitors file changes on a system, called
"report_changes". This feature is only available on *NIX systems. It's
purpose is to help determine what about a file has changed. The logic to
do accomplish this is as follows which can be found in
src/syscheck/seechanges.c:
 
252 /* Run diff */
253 date_of_change = File_DateofChange(old_location);
254 snprintf(diff_cmd, 2048, "diff \"%s\" \"%s\"> \"%s/local/%s/diff.%d\" "
255     "2>/dev/null",
256     tmp_location, old_location,
257     DIFF_DIR_PATH, filename + 1, (int)date_of_change);
258 if (system(diff_cmd) != 256) {
259     merror("%s: ERROR: Unable to run diff for %s",
260            ARGV0,  filename);
261     return (NULL);
262 }
 
Above, on line 258, the system() call is used to shell out to the
system's "diff" command. The raw filename is passed in as an argument
which presents an attacker with the possibility to run arbitrary code.
Since the syscheck daemon runs as the root user so it can inspect any
file on the system for changes, any code run using this vulnerability
will also be run as the root user.
 
An example attack might be creating a file called "foo-$(touch bar)"
which should create another file "bar".
 
Again, this vulnerability exists only on *NIX systems and is contingent
on the following criteria:
 
1. A vulnerable version is in use.
2. The OSSEC agent is configured to use syscheck to monitor the file
system for changes.
3. The list of directories monitored by syscheck includes those writable
by underprivileged users.
4. The "report_changes" option is enabled for any of those directories.
 
The fix for this is to create temporary trusted file names that symlink
back to the original files before calling system() and running the
system's "diff" command.   


 
[推荐] [评论(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
  相关文章
·This POODLE Bites: Exploiting
·D-Link DSP-W110 Command Execut
·Libmimedir VCF Memory Corrupti
·foobar2000 1.3.8 (.m3u) Local
·GeoVision (GeoHttpServer) Webc
·OpenBSD 5.7 sys_execve() Denia
·ProFTPD 1.3.5 Mod_Copy Command
·Putty 0.64 Denial Of Service
·Apexis IP CAM Username / Passw
·FileZilla 3.11.0.2 Denial Of S
·Microsoft Internet Explorer 11
·WordPress NativeChurch Theme 1
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved