Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/Modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ If you want to scan all ports please define -g 1-65535 range. Otherwise Nettacke
- '**http_options_enabled_vuln**' – check if OPTIONS method is enabled on the web server
- '**ivanti_epmm_cve_2023_35082_vuln**' – check the target for Ivanti EPMM CVE-2023-35082 vulnerability
- '**ivanti_ics_cve_2023_46805_vuln**' – check the target for Ivanti ICS CVE-2023-46805 vulnerability
- '**jenkins_cve_2024_23897_vuln**' – check the target for Jenkins CVE-2024-23897 arbitrary file read vulnerability via @file argument parsing.
- '**joomla_cve_2023_23752_vuln**' – check the target for Joomla CVE-2023-23752 information disclosure
- '**justwriting_cve_2021_41878_vuln**' – check the target for JustWriting CVE-2021-41878
- '**log4j_cve_2021_44228_vuln**' – check the target for Log4Shell CVE-2021-44228 vulnerability
Expand Down
58 changes: 58 additions & 0 deletions nettacker/modules/vuln/jenkins_cve_2024_23897.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
info:
name: jenkins_cve_2024_23897_vuln
author: Prajwal G N (@Prajwal5755)
severity: 7.5
description: Detects Jenkins CVE-2024-23897 arbitrary file read via CLI argument parsing using @file syntax.
reference:
- https://www.cisa.gov/news-events/alerts/2024/08/19/cisa-adds-one-known-exploited-vulnerability-catalog
profiles:
- vuln
Comment on lines +8 to +9

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include the module in the HTTP profile

When users scan with --profile http, this module is omitted because profile resolution in ArgParser.load_profiles relies exclusively on the entries in info.profiles, and this list lacks http. It is also the only vulnerability module using the HTTP library without that profile tag, so HTTP-profile scans will unexpectedly skip the new Jenkins check.

Useful? React with 👍 / 👎.

- jenkins
- cve
- cve2024
- high_severity
- cisa_kev

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Prajwal5755 high_severity and cisa_kev profiles missing. Please study existing Nettacker modules to understand which profiles you need

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the guidance @securestep9. I have added the missing profiles and updated this module. I will also update my other modules accordingly.

payloads:
- library: http
steps:

- method: post
timeout: 3
headers:
User-Agent: "{user_agent}"
Content-Type: "text/plain"
ssl: false

Comment on lines +20 to +26

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add explicit ssl on the HTTP step.

Line 17–22 defines the HTTP step without an explicit ssl field. Please set it explicitly to avoid ambiguous transport behavior across targets.

Suggested patch
       - method: post
         timeout: 3
+        ssl: false
         headers:
           User-Agent: "{user_agent}"
           Content-Type: "text/plain"

Based on learnings: “Every HTTP step must include headers.User-Agent: "{user_agent}", ssl:, and the info block must include reference:.”

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@nettacker/modules/vuln/jenkins_cve_2024_23897.yaml` around lines 17 - 22, The
HTTP step that currently shows method: post with headers.User-Agent and
Content-Type needs an explicit ssl field to avoid ambiguous transport—add ssl:
true (or ssl: false if this target is known plaintext) directly under the step
alongside timeout, and ensure the rule's info block includes a reference: entry
(e.g., info.reference: "CVE-2024-23897" or a vendor advisory) so the file
jenkins_cve_2024_23897.yaml contains headers.User-Agent: "{user_agent}", an
explicit ssl setting, and an info.reference value.

url:
nettacker_fuzzer:
input_format: "{{schema}}://{target}:{{ports}}{{path}}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Honor the target's Jenkins context path

When a user supplies a target such as https://host/jenkins, Nettacker.expand_targets removes /jenkins from the hostname and stores it in url_base_path, but this URL template never inserts that value. The request therefore goes to /cli instead of /jenkins/cli, causing false negatives for Jenkins installations deployed under a context path even when the user provided the correct application URL.

Useful? React with 👍 / 👎.

prefix: ""
interceptors: []
suffix: ""
data:
schema:
- "http"
- "https"
path:
- '/cli'
ports:
- 80
- 443
- 8080
- 8443


data: |
help @/etc/passwd
Comment on lines +46 to +47

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Send a valid Jenkins CLI protocol exchange

On a real vulnerable Jenkins instance, /cli does not interpret a text/plain request body as command-line arguments. The HTTP CLI transport requires paired upload/download requests with a shared session, Side headers, and CLI-framed binary arguments; HttpEngine sends this as one ordinary POST. Consequently, help @/etc/passwd is never executed and the content matcher cannot observe the file contents, making this module consistently return false negatives.

Useful? React with 👍 / 👎.

Comment on lines +46 to +47

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Probe a file that exists on Windows hosts

When the vulnerable Jenkins controller runs on Windows, /etc/passwd does not exist, so even after the CLI request is encoded correctly this probe produces no matching file content and reports a false negative. CVE-2024-23897 is not limited to Unix installations; add a Windows-specific file probe and response marker alongside the Unix check.

Useful? React with 👍 / 👎.


response:
condition_type: and
conditions:
status_code:
regex: "200"
reverse: false
content:
regex: "(root:x:0|daemon:x:1)"
reverse: false