Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Tools/GitHubGitHub/helsecert/cve-2023-50164
Vulnerability AnalysisCode AnalysisExploitationInformation GatheringWeb SecurityPenetration Testing
GitHubhelsecert/cve-2023-50164

cve-2023-50164

Detection scripts for CVE-2023-50164 in Apache Struts2, providing PowerShell and Bash tools to scan for vulnerable versions across file systems and archives.

View Repository
112 years agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2023-50164

Vulnerable versions

  • 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

Versions where the vulnerability is fixed

  • Struts 2.5.33
  • Struts 6.3.0.2

Search Script

Windows/PowerShell

For PowerShell 5.1 and newer. Written by Kjetil Sigvartsen at Norsk helsenett SF.

root@kitploit:~
[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 Multi-threaded

For PowerShell 5.1 and newer. Written by Kjetil Sigvartsen at Norsk helsenett SF. This one can be somewhat more CPU-intensive, but will be significantly faster than the variant above. Note that C:\Windows is also filtered out for speed reasons. If more detailed output is desired, add the following at the top of the script:

root@kitploit:~
$VerbosePreference = 'Continue'

The code is otherwise as follows:

root@kitploit:~
[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

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

Interpreting Results

The scripts will list files that are, or contain, the struts2 core library. A couple of examples:

/path/to/folder/struts2-core-6.3.0.2.jar - here the struts2 core library lies directly on the filesystem, and the version is 6.3.0.2, where the vulnerability is fixed.

/path/to/folder/apps/struts2-showcase-6.3.0.2.war - here the struts2 core library is inside the .war file, where the contents must be listed to see which version of Struts2 is included:

Linux/Bash

root@kitploit:~
$ unzip -l /path/to/folder/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:

For PowerShell 5.1 and newer. Written by Kjetil Sigvartsen at Norsk helsenett SF.

root@kitploit:~
[string[]]$ZipFiles = @(
	'C:\path\to\folder\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
Download Tool