windows内核提权

Windows by default are vulnerable to several vulnerabilities that could allow an attacker to execute malicious code in order to abuse a system. From the other side patching systems sufficiently is one of the main problems in security. Even if an organization has a patching policy in place if important patches are not implemented immediately this can still give short window to an attacker to exploit a vulnerability and escalate his privileges inside a system and therefore inside the network.

This article will discuss how to identify missing patches related to privilege escalation and the necessary code to exploit the issue.

Discovery of Missing Patches

The discovery of missing patches can be identified easily either through manual methods or automatic. Manually this can be done easily be executing the following command which will enumerate all the installed patches.

wmic qfe get Caption,Description,HotFixID,InstalledOn

The output will be similar to this:

Enumeration of Installed Patches

The HotFixID can be used in correlation with the table below in order to discover any missing patches related to privilege escalation. As the focus is on privilege escalation the command can be modified slightly to discover patches based on the KB number.

wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KB3136041" /C:"KB4018483"

Alternatively this can be done automatically via Metasploit, Credential Nessus Scan or via a custom script that will look for missing patches related to privilege escalation.

Metasploit

There is a Metasploit module which can quickly identify any missing patches based on the Knowledge Base number and specifically patches for which there is a Metasploit module.

post/windows/gather/enum_patches

Metasploit – Patches Enumeration

Windows Exploit Suggester

Gotham Digital Security released a tool with the name Windows Exploit Suggester which compares the patch level of a system against the Microsoft vulnerability database and can be used to identify those exploits that could lead to privilege escalation. The only requirement is that requires the system information from the target.

Windows Exploit Suggester

PowerShell

There is also a PowerShell script which target to identify patches that can lead to privilege escalation. This script is called Sherlock and it will check a system for the following:

  • MS10-015 : User Mode to Ring (KiTrap0D)
  • MS10-092 : Task Scheduler
  • MS13-053 : NTUserMessageCall Win32k Kernel Pool Overflow
  • MS13-081 : TrackPopupMenuEx Win32k NULL Page
  • MS14-058 : TrackPopupMenu Win32k Null Pointer Dereference
  • MS15-051 : ClientCopyImage Win32k
  • MS15-078 : Font Driver Buffer Overflow
  • MS16-016 : ‘mrxdav.sys’ WebDAV
  • MS16-032 : Secondary Logon Handle
  • CVE-2017-7199 : Nessus Agent 6.6.2 – 6.10.3 Priv Esc

The output of this tool can be seen below:

Sherlock – Missing Patches

Sherlock – Identification of Privilege Escalation Patches

Privilege Escalation Table

The following table has been compiled to assist in the process of privilege escalation due to lack of sufficient patching.

Operating System Description Security Bulletin KB Exploit
Windows Server 2016 Windows Kernel Mode Drivers MS16-135 3199135 Exploit

Github

Windows Server 2008 ,7,8,10 Windows Server 2012 Secondary Logon Handle MS16-032 3143141  GitHub

ExploitDB

Metasploit

Windows Server 2008, Vista, 7 WebDAV MS16-016 3136041 Github
Windows Server 2003, Windows Server 2008, Windows 7, Windows 8, Windows 2012 Windows Kernel Mode Drivers MS15-051 3057191 GitHub

ExploitDB

Metasploit

Windows Server 2003, Windows Server 2008, Windows Server 2012, 7, 8 Win32k.sys MS14-058 3000061 GitHub

ExploitDB

Metasploit

Windows Server 2003, Windows Server 2008, 7, 8, Windows Server 2012 AFD Driver MS14-040 2975684 Python

EXE

ExploitDB

Github

Windows XP, Windows Server 2003 Windows Kernel MS14-002 2914368 Metasploit
Windows Server 2003, Windows Server 2008, 7, 8, Windows Server 2012 Kernel Mode Driver MS13-005 2778930 Metasploit

ExploitDB

GitHub

Windows Server 2008, 7 Task Scheduler MS10-092 2305420 Metasploit

ExploitDB

Windows Server 2003, Windows Server 2008, 7, XP  KiTrap0D MS10-015 977165 Exploit

ExploitDB

GitHub

Metasploit

Windows Server 2003, XP NDProxy MS14-002 2914368 Exploit

ExploitDB

ExploitDB

Github

Windows Server 2003, Windows Server 2008, 7, 8, Windows Server 2012 Kernel Driver MS15-061 3057839 Github
Windows Server 2003, XP AFD.sys MS11-080 2592799 EXE

Metasploit

ExploitDB

Windows Server 2003, XP NDISTAPI MS11-062 2566454 ExploitDB
Windows Server 2003, Windows Server 2008, 7, 8, Windows Server 2012 RPC MS15-076 3067505 Github
Windows Server 2003, Windows Server 2008, 7, 8, Windows Server 2012 Hot Potato MS16-075 3164038 GitHub

PowerShell

HotPotato

Windows Server 2003, Windows Server 2008, 7, XP Kernel Driver MS15-010 3036220 GitHub

ExploitDB

Windows Server 2003, Windows Server 2008, 7, XP AFD.sys MS11-046 2503665 EXE

ExploitDB

时间: 2024-10-25 17:12:46

windows内核提权的相关文章

CVE-2019-13272:Linux本地内核提权漏洞复现

0x00 简介 2019年07月20日,Linux正式修复了一个本地内核提权漏洞.通过此漏洞,攻击者可将普通权限用户提升为Root权限. 0x01 漏洞概述 当调用PTRACE_TRACEME时,ptrace_link函数将获得对父进程凭据的RCU引用,然后将该指针指向get_cred函数.但是,对象struct cred的生存周期规则不允许无条件地将RCU引用转换为稳定引用. PTRACE_TRACEME获取父进程的凭证,使其能够像父进程一样执行父进程能够执行的各种操作.如果恶意低权限子进程使

[提权]Windows UAC 提权(CVE-2019-1388)

0x00 UAC简介 首先来理解一下什么是 UAC : 用户账户控制UAC:UAC 是 win10 操作系统中非常重要的安全功能,它起源于 windows vista 操作系统,流行于 windows7.windows8 .各种功能策略得到了完善的修订和开发,应用在 win10 操作系统中,目的是减少恶意软件对系统的侵害. 操作系统默认情况下是启用UAC,当用户运行软件就会触发UAC规则.执行的时候就需要权限,否则是不会运行的. 不涉及到更改计算机操作的项目是不会触发UAC规则的,能够触发UAC

内核提权姿势笔记

方法一: 通过寻找进程的thread_info结构,搜索匹配进程的cred结构,并修改其值获得root权限.thread_info(arch arm)结构如下: /* Linux/arch/arm/include/asm/thread_info.h*/   20 #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) // THREAF_SIZE=8192 49 struct thread_info { 50 unsigned long fla

Linux内核提权漏洞(CVE-2016-8655)

操作机:Ubuntu 15.10(内核版本4.2.0) chocobo_root:是本次试验的POC文件,通过执行它来验证漏洞 漏洞简介 此漏洞可用于从未授权进程中执行内核代码,攻击者只需要本地普通权限,就能利用该漏洞导致拒绝服务(系统奔溃)或提升到管理员权限. 这个漏洞最早出现于2011年4月19日的代码中:[代码地址][[https://github.com/torvalds/linux/commit/f6fb8f100b807378fda19e83e5ac6828b638603a] 直到2

windows本地提权对照表(转载)

2003   结果保存在C:\Windows\Temp\temp.txt systeminfo>C:\Windows\Temp\temp.txt&(for %i in (KB3057191 KB2840221 KB3000061 KB2850851 KB2711167 KB2360937 KB2478960 KB2507938 KB2566454 KB2646524 KB2645640 KB2641653 KB944653 KB952004 KB971657 KB2620712 KB2393

Windows溢出提权小结

1.  查看系统打补丁情况:systeminfo 2.  查看KB-EXP表: KB2360937 MS10-084 KB2478960 MS11-014 KB2507938 MS11-056 KB2566454 MS11-062 KB2646524 MS12-003 KB2645640 MS12-009 KB2641653 MS12-018 KB952004 MS09-012 Pr.exe KB956572 MS09-012 巴西烤肉 KB971657 MS09-041 KB2620712 M

CVE-2016-5195 Dirtycow: Linux内核提权漏洞

以下都是github上找的源码,然后在ubuntu-12.04.5-desktop-i386上实验成功 首先运行下面的确定漏洞: /* ####################### dirtyc0w.c ####################### $ sudo -s # echo this is not a test > foo # chmod 0404 foo $ ls -lah foo -r-----r-- 1 root root 19 Oct 20 15:23 foo $ cat f

windows下,提权代码.

bool AdjustPrivileges() { HANDLE hToken = NULL; TOKEN_PRIVILEGES tp; TOKEN_PRIVILEGES oldtp; DWORD dwSize = sizeof(TOKEN_PRIVILEGES); LUID luid; OpenProcessToken(GetCurrentProcess(), TOKEN_ALL_ACCESS, &hToken); if (!LookupPrivilegeValue(NULL, SE_DEBU

CVE-2019-13272 Linux 内核提权 +cve-2018-18955

漏洞影响版本(未测试完全) Linux 4.10 < 5.1.17 PTRACE_TRACEME local root (CVE-2019-13272) 根据GitHub的代码中所述,作者测试了以下的系统,发现均可成功. Ubuntu 16.04.5 kernel 4.15.0-29-generic Ubuntu 18.04.1 kernel 4.15.0-20-generic Ubuntu 19.04 kernel 5.0.0-15-generic Ubuntu Mate 18.04.2 ke