Linux提权思路
先写个大概
0. dirtycow
不同的dirtycow有不同执行条件。
使用前先对照此表根据内核版本确认是否已经修复 https://github.com/dirtycow/dirtycow.github.io/wiki/Patched-Kernel-Versions
比如 https://github.com/dirtycow/dirtycow.github.io/wiki/PoCs 列表中
Ubuntu最常用的应该是 https://github.com/FireFart/dirtycow/blob/master/dirty.c 。
https://github.com/securifera/cowcron 支持RHEL系。
1. 内核漏洞
不同内核对应不同exploit
https://github.com/SecWiki/linux-kernel-exploits
2. Pwn suid 或者 guid文件
suid文件为以文件所有者权限运行的文件,文件所有者为root的suid文件值得注意。
find / -perm +2000 -user root -type f -print
find / -perm -1000 -type d 2>/dev/null # Sticky bit - Only the owner of the directory or the owner of a file can delete or rename here.
find / -perm -g=s -type f 2>/dev/null # SGID (chmod 2000) - run as the group, not the user who started it.
find / -perm -u=s -type f 2>/dev/null # SUID (chmod 4000) - run as the owner, not the user who started it.
find / -perm -g=s -o -perm -u=s -type f 2>/dev/null # SGID or SUID
for i in `locate -r "bin$"`; do find $i \( -perm -4000 -o -perm -2000 \) -type f 2>/dev/null; done
find / -perm -g=s -o -perm -4000 ! -type l -maxdepth 3 -exec ls -ld {} \; 2>/dev/null
3. 高权限进程或者服务漏洞
查看高权限的service,是否有可利用的exploit.
4. 高权限进程或者服务目录是否可写
替换可执行文件,等待服务重启。
5. Corntab 高权限定时任务
是否可以编辑以root运行的corntab脚本
6. Sudo -l 看是否有可以高权限执行的命令或者脚本
比如可以sudo /usr/bin/python,或者sudo nmap --interactive等等
7. 其他思路(CTF式提权)
- /etc/passwd是否有编辑权限,如果可编辑,构造新用户及密码hash值写入/etc/passwd
- 找可疑文件,SSH Private Key或许隐写其中, 如果SSH Private Key使用了密码短语,可以用sshng2john.py转换私钥然后用John破解之
Linux提权思路的更多相关文章
- 免考final linux提权与渗透入门——Exploit-Exercise Nebula学习与实践
免考final linux提权与渗透入门--Exploit-Exercise Nebula学习与实践 0x0 前言 Exploit-Exercise是一系列学习linux下渗透的虚拟环境,官网是htt ...
- Linux提权手法整理
之前写过了windows提权小结,这下一篇水什么就有了嘛,于是有了这篇水文,整理一下Linux提权 前篇windows提权小结 ,链接送上 https://www.cnblogs.com/lcxblo ...
- Linux提权(1)-基础版~
利用Linux内核漏洞提权 VulnOS version 2是VulHub上的一个Linux提权练习,当打开虚拟机后,可以看到 获取到低权限SHELL后我们通常做下面几件事 1.检测操作系统的发行版本 ...
- 又一款linux提权辅助工具
又一款linux提权辅助工具 – Linux_Exploit_Suggester 2013-09-06 10:34 1455人阅读 评论(0) 收藏 举报 https://github.com/Pen ...
- Linux提权:从入门到放弃
*原创作者:piece of the past,本文属Freebuf原创奖励计划,未经许可禁止转载 日站就要日个彻底.往往我们能拿下服务器的web服务,却被更新地比西方记者还快的管理员把内网渗透的种子 ...
- 记一次初步Linux提权
前言. 提权这么久了 还是头一次提下Linux的服务器... 由于之前一直钻研的win服务器 要不是前些日子爆出来Struts2-045漏洞 估计还没时间接触Linux提权.... 正文. st2 ...
- 利用Metasploit进行Linux提权
利用Metasploit进行Linux提权 Metasploit 拥有msfpayload 和msfencode 这两个工具,这两个工具不但可以生成exe 型后门,一可以生成网页脚本类型的webshe ...
- Win提权思路,方法,工具(小总结)[转]
Win提权思路,方法,工具(小总结)[转] 看到这个文章,感觉整理的不错,就收藏下了. 介绍 windows提权总是被归结为适当的枚举.但要完成适当的枚举,你需要知道要检查和查找的内容.这通常需要伴随 ...
- 20. Linux提权:从入门到放弃
几点前提 已经拿到低权shell 被入侵的机器上面有nc,python,perl等linux非常常见的工具 有权限上传文件和下载文件 内核漏洞提权 提到脏牛,运维流下两行眼泪,我们留下两行鼻血.内核漏 ...
随机推荐
- 「日常训练」Soldier and Badges (CFR304D2B)
题意 (Codeforces 546B) 问对一个序列最少需要增减几个1能使其彼此不同. 分析 模拟处理.需要注意的是,尽管题目中说了an<=3000,问题是,如果一群a全是3000呢(滑稽), ...
- 面向对象 公有私有 property classmethod staticmethod
接口类(抽象类)--------就是一种规范 面向对象的私有与公有 对于每一个类的成员而言都有两种形式: 公有成员,在任何地方都能访问 私有成员,只有在类的内部才能方法 私有成员和公有成员的访问限制不 ...
- 树莓派的WIFI配置
参考网址: http://www.cnblogs.com/iusmile/archive/2013/03/30/2991139.html http://my.oschina.net/pikeman/b ...
- CodeForces-1121C System Testing
题目链接 https://vjudge.net/problem/CodeForces-1121C 题面 Description Vasya likes taking part in Codeforce ...
- LeetCode 86 ——分隔链表
1. 题目 2. 解答 从前向后遍历链表,将结点值小于 x 的结点放入到新链表 1 中,将结点值大于等于 x 的结点放入新链表 2 中.最后,将新链表 2 拼接在新链表 1 后面即可. /** * D ...
- errno -4058 and npm WARN enoent ENOENT 解决方案
1.报错如下: npm WARN checkPermissions Missing write access to C:\Users\hejinrong\AppData\Roaming\npm\nod ...
- JQuery Ajax执行过程AOP拦截
JQuery Ajax过程AOP:用于在Ajax请求发送过程中执行必备操作,比如加载数据访问令牌. $.ajaxSetup({ type: "POST", error: funct ...
- HDU 3698 Let the light guide us(DP+线段树)(2010 Asia Fuzhou Regional Contest)
Description Plain of despair was once an ancient battlefield where those brave spirits had rested in ...
- DFS——CodeForces740DAlyona and a tree
一.题目回顾 题目链接:Alyona and a tree Examples Input 52 5 1 4 61 71 13 53 6 Output 1 0 1 0 0 Input 59 7 8 ...
- Daily Scrum02 12.04
第二轮迭代已经进行到了白热化阶段,大家在被编译搞的水深火热的同时依然没有忘记我们的具有颠覆性的团队项目.虽然第一轮迭代我们的成绩不错,但是一定要克服时间不充裕,任务互相冲突的困难,克服不可避免的舆论压 ...
- 免考final linux提权与渗透入门——Exploit-Exercise Nebula学习与实践