Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
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.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2024-23897 — Python exploit for CVE-2024-23897: unauthenticated arbitrary file read in Jenkins CLI via args4j @-file expansion, with vulnerability check, OS auto-detection and proxy support. | Kitploit
Tools/GitHubGitHub/d4ytox/cve-2024-23897
Vulnerability AnalysisExploitationWeb Application ExploitationInformation GatheringWeb SecurityPenetration TestingRed Teaming
GitHubd4ytox/cve-2024-23897

CVE-2024-23897

Python exploit for CVE-2024-23897: unauthenticated arbitrary file read in Jenkins CLI via args4j @-file expansion, with vulnerability check, OS auto-detection and proxy support.

View Repository
1Nov 12, 2026Not yet reviewed
Website

Related Tools

  • nuclei

    Fast YAML-based vulnerability scanner with template-driven detection engine for automated security testing across web apps, APIs, networks, DNS, and cloud infrastructure.

  • zaproxy

    Open-source web application security scanner for automated vulnerability detection, manual penetration testing, and API security testing with a proxy-based interception engine.

  • openvas-scanner

    This repository contains the scanner component for Greenbone Community Edition.

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    ghostlock-app

    yukonga/ghostlock-app

    One-tap Android kernel exploit app for CVE-2026-43499, providing privilege escalation via kernel module loading, with offset extraction and on-device analysis tools.

    745
  • 2

    IMSIcatcher

    28zaaky/imsicatcher

    IMSI Catcher platform that deploys a rogue GSM cell to intercept SMS, inject messages and track mobile devices

    732
  • 3

    Callisto

    jetp1ane/callisto

    Automated binary vulnerability analysis tool that decompiles executables via Ghidra, scans pseudo-C code with Semgrep, and validates findings using GPT-3.5-Turbo to reduce false positives.

    610
  • 4

    opencti

    opencti-platform/opencti

    Open Cyber Threat Intelligence Platform

    546
  • 5

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    414
  • 6

    DFRoot

    a2333c/dfroot

    Android root tool for Samsung Galaxy S25 Ultra (SM-S938B) that chains DirtyFrag CVE-2026-43284 and CVE-2026-43499 to gain root automatically at boot via KernelSU.

    413

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2024-23897 - Jenkins CLI unauthenticated arbitrary file read

Jenkins reads the first three lines of a local file, unauthenticated.

The CLI expands any argument starting with @ into the contents of that file, and a few commands parse their arguments before Jenkins checks permissions, so an anonymous caller can aim that expansion at any file the Jenkins process can read. Three lines is the ceiling without an account; with one that has Overall/Read the same bug reads whole files.

This exploit does the unauthenticated three-line read.

Affects Jenkins weekly up to 2.441 and LTS up to 2.426.2. Fixed in 2.442 and 2.426.3 on 24 January 2024, which turned the @ expansion off.

The bug

Jenkins ships a command-line interface that speaks to the controller over HTTP at /cli. It parses commands with args4j, and args4j has a feature called expandAtFiles: an argument that begins with @ is replaced by the contents of the named file, one line per argument.

// args4j CmdLineParser, expanding @files before the command runs
if (parserProperties.getAtSyntax() && arg.startsWith("@")) {
    args.addAll(Arrays.asList(readAllLines(new File(arg.substring(1)))));
    continue;
}

connect-node @/etc/passwd makes Jenkins read /etc/passwd and feed each line to the command as a separate argument.

What you can reach depends on when the permission check runs, and Jenkins has two command dispatchers with a different order.

CLICommand.main() checks permission before it parses arguments:

if (!(this instanceof HelpCommand || this instanceof WhoAmICommand))
    Jenkins.get().checkPermission(Jenkins.READ);
parser.parseArgument(args.toArray(new String[0]));

So connect-node, delete-job, offline-node and the rest throw AccessDeniedException before args4j ever sees the @-file. That is the path an authenticated attacker uses to read entire files: each line of the target comes back as its own No such agent "<line>" exists. error. Unauthenticated, it returns nothing.

CLIRegisterer.main(), which backs the @CLIMethod commands, checks permission after it parses:

parser.parseArgument(args);          // at-file expansion happens here
Authentication auth = getTransportAuthentication2();
sc.setAuthentication(auth);
jenkins.checkPermission(Jenkins.READ);   // too late

The expansion has already read the file by the time the check fails. And two commands, help and who-am-i, are exempt from the pre-parse check in the other dispatcher as well. That leaves a handful of commands an anonymous user can drive into reading a file.

They only leak what args4j quotes back in its parse errors, and that is the line sitting at the argument index the command overflows at. So the number of lines you get is set by how many arguments the command takes:

CommandArgumentsError returnedLine
who-am-i0No argument is allowed: X1
help1Too many arguments: X2
keep-build2Too many arguments: X3

who-am-i allows no arguments, so the first line of the file is already one too many and comes back in the error. help takes one, consumes line 1, and trips on line 2. keep-build takes two (JOB and BUILD#), consumes lines 1 and 2, and trips on line 3. keep-build is the highest-argument command an anonymous user can reach in a stock Jenkins, which is why the ceiling is three lines. Jenkins' own advisory says the same: without Overall/Read you get the first three lines, and no core command or bundled plugin pushes it further.

A single-line file is therefore recovered in full — who-am-i alone returns the whole thing. Private keys, API tokens, secret.key

Usage

python3 exploit.py -u http://10.10.10.11:8080 --check            # is it vulnerable
python3 exploit.py -u http://10.10.10.11:8080 -f /etc/passwd     # read one file
python3 exploit.py -u http://10.10.10.11:8080                    # read paths interactively

-f reads one file and exits. Without it the exploit prompts for paths:

python3 exploit.py -u http://10.10.10.11:8080
file> C:/Windows/win.ini
file> C:/Users/Administrator/Desktop/flag.txt

The OS is detected on the first read; pass --os to skip detection if you already know. --check reads nothing - it sends one bogus path and reports whether the expansion fired.

Options

  • -u, --url — host, host:port, or full URL. http:// is assumed if no scheme is given.
  • -f, --file — a single file to read, then exit.
  • --check — report whether the target is vulnerable, reading no real file.
  • -p, --port — target port, used only when the target carries none. Defaults to 8080.
  • --os — windows, unix, or auto for path handling. Defaults to auto-detect.
  • -x, --proxy — proxy, for watching the requests in Burp.
  • -k, --insecure — skip TLS verification.
  • --timeout — seconds per request, default 8.

Requirements

Python 3 and requests.

When it does not work

  • The CLI did not expand the @-file. Target looks patched. means the fix is in: 2.442 or 2.426.3 and later disable expandAtFiles. The endpoint still answers, it just no longer reads the file.
  • No CLI response. /cli may be disabled or unreachable. means nothing answered at /cli. Check the host and port, and that the box is up - on a lab that recycles addresses this is usually a stale IP.
  • Nothing recovered after a read means the Jenkins process cannot read the file. A file that does not exist reports File not found instead, so this is an OS-level permission denial or a directory.
  • Stopped after line 1 means line 1 starts with -. args4j reads a - line as an option, not an argument, so the later commands cannot advance past it. A private key (-----BEGIN ...) hits this.

Affected versions

FieldValue
CVECVE-2024-23897
AdvisoryJenkins Security Advisory 2024-01-24, SECURITY-3314
AffectedJenkins weekly <= 2.441, LTS <= 2.426.2
Fixed in2.442 (weekly), 2.426.3 (LTS)
CVSS v3.19.8 Critical, AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H (NVD)
CWECWE-88 (argument injection), CWE-22 (path traversal)
CISA KEVAdded 19 August 2024

The 9.8 reflects the whole-file read an authenticated user gets, which decrypts stored credentials and leads to remote code execution. The unauthenticated three-line read this tool performs is the lower-privilege end of the same bug.

Origin

RoleWho
Discovered and reportedYaniv Nizry of SonarSource — Excessive Expansion
Vendor advisoryThe Jenkins project — 2024-01-24 / SECURITY-3314
Original full-read PoCMatisse Beckandt (Backendt) — Exploit-DB 51993
No-permission techniqueThe Jenkins security team, documented in the advisory; command recipe in gquere/pwn_jenkins
This implementationd4ytox

References

Download Tool