题目比较简单,可以利用sudo和多种suid程序提权,做个记录
进入靶场题目环境

获得节点信息

远程连接上
执行命令id,发现只是admin普通账户

sudo提权
发现存在 /usr/bin/vim, /usr/bin/bash, /usr/bin/more, /usr/bin/less, /usr/bin/nano, /usr/bin/cp, /usr/bin/awk, /usr/bin/wget, /usr/bin/su, /usr/bin/cat 多个拥有权限的应用。
其中的/usr/bin/bash可以直接执行命令,/usr/bin/su允许普通用户提升到管理员账户。
/usr/bin/bash

/usr/bin/su
使用exit命令退回普通用户,再使用sudo su命令可以提权到root。

suid提权
例如我们发现cat、more等命令是有root权限的,可以利用它们来读取root权限的文件


如果sudo -l没法用,可以使用find命令找到以后root执行权限的程序
find / -user root -perm -4000 -print 2>/dev/null

PS:像find这种也是可以执行额外命令的
