Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

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

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

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
cve-2023-50164 — 用于检测 Apache Struts2 中 CVE-2023-50164 的脚本,提供 PowerShell 和 Bash 工具,可扫描文件系统和归档中的易受攻击版本。 | Kitploit
工具/GitHubGitHub/helsecert/cve-2023-50164
漏洞分析代码分析漏洞利用信息收集Web安全渗透测试
GitHubhelsecert/cve-2023-50164

cve-2023-50164

用于检测 Apache Struts2 中 CVE-2023-50164 的脚本,提供 PowerShell 和 Bash 工具,可扫描文件系统和归档中的易受攻击版本。

查看仓库
1242年前尚未审核
分享

CVE-2023-50164

受影响版本

  • Struts 2.0.0 - Struts 2.3.37 (EOL)
  • Struts 2.5.0 - Struts 2.5.32
  • Struts 6.0.0 - Struts 6.3.0

修复版本

  • Struts 2.5.33
  • Struts 6.3.0.2

搜索脚本

Windows/PowerShell

适用于 PowerShell 5.1 及更高版本。由 Kjetil Sigvartsen 在挪威卫生网络撰写。

[String[]]$Extensions = @('*.jar', '*.war', '*.ear')
[string]$searchString = 'struts2-core'

foreach ($Disk in (Get-CimInstance Win32_LogicalDisk)) {

    [string]$DriveLetter = $Disk.DeviceID
    [string]$Path        = "$($driveLetter)\"

    foreach ($ChildItem in (Get-ChildItem -Path $Path -Recurse -Include $Extensions -File -ErrorAction SilentlyContinue)) {
        [String]$FilePath = $ChildItem.FullName
        $Content  = Get-Content -Path $filePath -Raw
        if ($Content -like "*$searchString*") {
            Write-Output $filePath
        } #if
    } #foreach

} #foreach

Windows/PowerShell 多线程版本

适用于 PowerShell 5.1 及更高版本。由 Kjetil Sigvartsen 在挪威卫生网络撰写。 此版本可能更加 CPU 密集,但会比上述版本快得多。请注意,出于速度考虑,C:\Windows 已被过滤掉。 如需更详细的输出,请在脚本顶部添加以下内容:

$VerbosePreference = 'Continue'

完整代码如下:

[String[]]$Extensions = @('*.jar', '*.war', '*.ear')
[string]$searchString = 'struts2-core'
[string[]]$Exceptions = @('C:\Windows')

foreach ($Disk in (Get-CimInstance Win32_LogicalDisk)) {

    [string]$DriveLetter = $Disk.DeviceID
    [string]$Path        = "$($driveLetter)\"

    Write-Verbose -Message "Working on $Path"

    try {
        [System.IO.DirectoryInfo[]]$Folders = Get-ChildItem -Path $Path -Directory -ErrorAction Stop
    } #try
    catch {
        Write-Verbose -Message "Unable to get child folders in disk $Path"
        continue
    } #catch

    [System.Management.Automation.Job[]]$Jobs = $Null
    [System.Management.Automation.Job[]]$Jobs = foreach ($Folder in $Folders) {
        [string]$JobName = $Path + $Folder.Name

        if ($Exceptions -contains $JobName) {
            Write-Verbose -Message "Skipping $JobName, in exception list"
            continue
        } #if

        Write-Verbose -Message "Starting jobs for $JobName"

        Start-Job -Name $JobName -ScriptBlock {
            Return (Get-ChildItem -Path $Using:JobName -Recurse -Include $Using:Extensions -File -ErrorAction SilentlyContinue)
        } #Start-Job
    } #Foreach


    [System.Object[]]$JobResults = $Null
    [System.Object[]]$JobResults = Receive-Job -Job $Jobs -AutoRemoveJob -Wait -ErrorAction Stop

    [System.Management.Automation.Job[]]$RemainingJobs = $Null
    [System.Management.Automation.Job[]]$RemainingJobs = get-Job -Name "$Path*" -ErrorAction Stop

    if ($RemainingJobs) {
        Write-Verbose -Message "$($RemainingJobs.count) jobs remaining"
    } #if


    foreach ($ChildItem in $JobResults) {
        [String]$FilePath = $ChildItem.FullName
        [string]$Content  = Get-Content -Path $filePath -Raw
        if ($Content -like "*$searchString*" -or $FilePath -like "*$searchString*") {
            Write-Output $filePath
        } #if
    } #foreach

} #foreach

Linux/Bash

sudo find / -type f \( -iname "*.jar" -o -iname "*.war" -o -iname "*.ear" \) -exec grep -Fl "struts2-core" {} 2>/dev/null \;

结果解读

脚本将列出包含 struts2 核心库的文件或目录。例如:

/path/to/directory/struts2-core-6.3.0.2.jar — 此处 struts2 核心库直接存放在文件系统中,版本为 6.3.0.2,该版本已修复漏洞。

/path/to/directory/apps/struts2-showcase-6.3.0.2.war — 此处 struts2 核心库位于 .war 文件内部,需要列出其内容以查看所包含的 Struts2 版本:

Linux/Bash

$ unzip -l /path/to/directory/apps/struts2-showcase-6.3.0.2.war | fgrep struts2-core
  1519992  2023-12-05 05:58   WEB-INF/lib/struts2-core-6.3.0.2.jar

Windows/PowerShell:

适用于 PowerShell 5.1 及更高版本。由 Kjetil Sigvartsen 在挪威卫生网络撰写。

[string[]]$ZipFiles = @(
	'C:\path\to\directory\apps\struts2-showcase-6.3.0.2.war'
)

Add-Type -AssemblyName System.IO.Compression.FileSystem

foreach ($ZipFile in $ZipFiles) {
	foreach ($Entry in ([System.IO.Compression.ZipFile]::OpenRead($zipFile).Entries)) {
		if ($Entry.FullName -like "*struts2-core*") {
			Write-Output $Entry.FullName
		} #if
	} #foreach
} #foreach
下载工具

最受欢迎

查看全部 →

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

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 终极 OSINT 工具包:调查图谱、置信度评分、别名家族、地图、时间线和报告。49 个模块、400+ 个站点,无需 API 密钥。

    837
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock 一键执行应用(CVE-2026-43499)

    536
  • 3

    ARTEX

    baarai/artex

    基于LLM的多智能体自主渗透测试平台,具备规划器/执行器智能体、资产与探索图谱、MITM流量记录以及漏洞复测功能。

    424
  • 4

    redforge

    cybersecurity91/redforge

    浏览器端红队工具包,包含 102 个离线工具,用于侦察、载荷生成、凭据攻击、加密、编码和交战报告。

    355
  • 5

    looking-glass

    anonghosty/looking-glass

    CSIRT 平台,可将 Shadowserver 报告导入 MongoDB,并将其重放为交互式地图、分析、发现、公告和高管仪表板。

    294
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    AI原生网络安全的行动系统——在这里,意图转化为受治理的执行,证据沉淀为运营记忆,每一次操作都让下一次更出色。

    276

探索所有工具

浏览我们的工具集合

查看所有工具 →