Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
PrivescCheck — Windows 权限提升枚举脚本 | Kitploit
工具/GitHubGitHub/itm4n/privesccheck
权限提升漏洞分析配置审计信息收集后渗透利用渗透测试
GitHubitm4n/privesccheck

PrivescCheck

Windows 权限提升枚举脚本

查看仓库
3.9k50792天前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

PrivescCheck

快速识别常见 Windows 漏洞和配置问题,这些问题不一定在公共安全标准中被涵盖,并收集用于利用和后渗透任务的有用信息。

[!重要] 使用此工具时需要注意的一个主要方面是,所有访问控制检查都是在当前用户的上下文中完成的。因此,如果以管理员权限运行,为了避免产生错误的发现,会跳过许多漏洞检查。

🚀 快速开始

在此处下载脚本:PrivescCheck.ps1

[!提示] 上面的链接也可以直接在 PowerShell 终端中使用 (New-Object Net.WebClient).DownloadString(...) 直接使用。

用例 1(渗透测试):仅运行基本检查

是否存在明显的本地提权方式?

root@kitploit:~
powershell -ep bypass -c ". .\PrivescCheck.ps1; Invoke-PrivescCheck"

用例 2(研究):运行扩展检查并编写人类可读报告

是否可以利用额外信息进行后渗透或发现第三方软件中的漏洞?

root@kitploit:~
powershell -ep bypass -c ". .\PrivescCheck.ps1; Invoke-PrivescCheck -Extended -Report PrivescCheck_$($env:COMPUTERNAME) -Format TXT,HTML"

用例 3(审计):运行所有检查并编写所有报告

是否存在公共安全标准未涵盖的配置问题?

root@kitploit:~
powershell -ep bypass -c ". .\PrivescCheck.ps1; Invoke-PrivescCheck -Extended -Audit -Report PrivescCheck_$($env:COMPUTERNAME) -Format TXT,HTML,CSV,XML"

📖 详细用法

root@kitploit:~
Invoke-PrivescCheck [-Extended] [-Audit] [-Experimental] [-Report <PREFIX>]
    [-Format <FORMAT>[,...]] [-Risky] [-Silent] [-Force]

    -Extended
        Include all "extended" checks in the scan (see README).

    -Audit
        Include all "audit" checks in the scan.

    -Experimental
        Include all "experimental" checks in the scan. Use only if you know
        what you are doing.

    -Report <PREFIX>
        Generate at least one report file. The output filename will be
        "PREFIX.txt" by default. The extension is automatically appended
        based on the report format (see "-Format <FORMAT>[,...]").

    -Format <FORMAT>[,...]
        Specify the format of the output report file(s). If not set, the
        default value is "TXT". Supported formats are: "TXT", "HTML", "CSV",
        and "XML".

    -Risky
        Include checks marked as "risky", i.e. checks that are likely to
        trigger a blocking action by an endpoint protection solution. Use with
        caution.

    -Silent
        Suppress terminal output. This can be useful if you want to run the
        script as part of a batch file, in a scheduled task for instance.

    -Force
        Force execution and ignore warnings. Typically, the script stops if
        it is executed with administrator privileges. Use this option to
        execute it anyway.

报告格式 > TXT(-Format TXT)

使用选项 -Report <PREFIX>(搭配 -Format TXT)指定要生成原始文本报告。输出内容类似于终端中看到的内容,但仅包含 ASCII 字符,以便与所有文本编辑器保持更好的(向后)兼容性。

Screenshot of a raw text report generated by PrivescCheck

报告格式 > HTML(-Format HTML)

使用选项 -Report <PREFIX> 搭配 -Format HTML 指定要生成HTML 报告。输出文件可以在网页浏览器中打开。它比原始文本报告更便于数据可视化。此外,它还提供了排序和筛选功能!

Screenshot of an HTML report generated by PrivescCheck

报告格式 > CSV(-Format CSV)和 XML(-Format XML)

使用选项 -Report <PREFIX> 搭配 -Format CSV 或 -Format XML 指定要生成CSV 或 XML 报告。输出文件旨在便于自动化报告工具解析结果。

[!注意] 尽管输出格式尚未被文档化,但您可以通过分析已生成文件的结构轻松弄清楚。您可以使用每个检查的 Id 值来唯一标识它们。

检查类型 > Base

类型为 Base 的检查将始终执行,除非脚本以管理员身份运行。它们主要用于识别提权漏洞或其他重要问题。

检查类型 > Extended(-Extended)

类型为 Extended 的检查仅在命令行中指定了 -Extended 选项时才会执行。它们主要用于提供可能对漏洞利用开发或后渗透有用的额外信息。

检查类型 > Audit(-Audit)

类型为 Audit 的检查仅在命令行中指定了 -Audit 选项时才会执行。它们主要用于提供与配置审计相关的信息。

💡 提示与技巧

PowerShell 执行策略

默认情况下,当启动新的 powershell.exe 进程时,PowerShell 执行策略在客户端设置为 Restricted,在服务器上设置为 RemoteSigned。这些策略会阻止(未签名)脚本的执行,但可以通过以下方式在当前作用域内覆盖。

root@kitploit:~
Set-ExecutionPolicy Bypass -Scope Process -Force
. .\PrivescCheck.ps1

然而,当通过 GPO 强制执行执行策略时,此技巧无效。在这种情况下,启动新的 PowerShell 会话后,您可以按如下方式加载脚本。

root@kitploit:~
Get-Content .\PrivescCheck.ps1 | Out-String | Invoke-Expression

PowerShell 版本 2

一种绕过约束语言模式的常见方法是使用 PSv2,因为它不实现此保护。因此,大量开发工作用于维护这种向后兼容性。

[!注意] 尽管 PowerShell 版本 2 在 Windows 的最新版本上仍默认启用(从 Windows 中移除 PowerShell 2.0),但如果没有 .Net 框架 2.0 版本,它无法运行,而该框架需要手动安装。

Metasploit 超时

如果您在 Meterpreter 会话中运行此脚本,您很可能会遇到“超时”错误。这是因为 Metasploit 使用默认的超时值为 15 秒,这不足以完成脚本的典型执行。

root@kitploit:~
meterpreter > load powershell
Loading extension powershell...Success.
meterpreter > powershell_import /local/path/to/PrivescCheck.ps1
[+] File successfully imported. No result was returned.
meterpreter > powershell_execute "Invoke-PrivescCheck"
[-] Error running command powershell_execute: Rex::TimeoutError Operation timed out.

可以通过 sessions 命令的 -t 选项(文档)设置不同的超时时间。在以下示例中,为 ID 为 1 的会话设置了 2 分钟的超时时间,但您可能希望设置更高的值。

root@kitploit:~
msf6 exploit(multi/handler) > sessions -t 120 -i 1
[*] Starting interaction with 1...
meterpreter > powershell_execute "Invoke-PrivescCheck"

📑 致谢

  • 单词列表 - CBHue/PyFuscation
  • 易受攻击的驱动程序列表 - https://www.loldrivers.io/api/drivers.csv
下载工具