Skip to content

Add Java CLI reverse-engineering challenges and bundle JAR variants#2523

Draft
Copilot wants to merge 4 commits into
masterfrom
copilot/add-cli-challenge-variants
Draft

Add Java CLI reverse-engineering challenges and bundle JAR variants#2523
Copilot wants to merge 4 commits into
masterfrom
copilot/add-cli-challenge-variants

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 11, 2026

This adds WrongSecrets challenges based on the new Java CLIs introduced in OWASP/wrongsecrets-binaries#130. It covers both the plain and obfuscated Java variants and includes the relevant bundled artifacts, including CTF builds.

  • New challenges

    • Add Challenge65 for the plain Java CLI JAR
    • Add Challenge66 for the obfuscated Java CLI JAR
    • Register both challenges in wrong-secrets-configuration.yaml with matching explanation, hint, and reason content
  • Java JAR execution support

    • Extend BinaryExecutionHelper to execute runnable JARs via java -jar
    • Reuse the existing binary challenge flow so spoil() resolves the embedded secret from the packaged CLI rather than duplicating logic in application code
  • Bundled Java artifacts

    • Add the Java CLI variants under src/main/resources/executables/
      • wrongsecrets-java.jar
      • wrongsecrets-java-obfuscated.jar
      • wrongsecrets-java-ctf.jar
      • wrongsecrets-java-obfuscated-ctf.jar
    • Update .gitignore so these tracked JARs can live alongside the existing executable assets
  • Challenge docs and tests

    • Add focused AsciiDoc content for both Java challenges
    • Add challenge tests covering the new plain and obfuscated JAR-backed flows

Example of the new execution path:

@Override
public String getAnswer() {
  BinaryExecutionHelper helper = new BinaryExecutionHelper(65, new MuslDetectorImpl());
  return helper.executeJavaJar("", "wrongsecrets-java.jar");
}

Copilot AI and others added 3 commits May 11, 2026 05:25
Agent-Logs-Url: https://github.com/OWASP/wrongsecrets/sessions/f2ea090d-47bb-4e0a-ad4c-179c568545a8

Co-authored-by: commjoen <1457214+commjoen@users.noreply.github.com>
Agent-Logs-Url: https://github.com/OWASP/wrongsecrets/sessions/f2ea090d-47bb-4e0a-ad4c-179c568545a8

Co-authored-by: commjoen <1457214+commjoen@users.noreply.github.com>
You can solve it by:

1. Decompiling the classes and following the code that reconstructs the secret.
2. Looking for encoded byte arrays, reflection, and helper methods that decode data at runtime.
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.

@copilot can you be more explicit in the steps here please? what does the user exactly need to do?

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.

Updated with explicit step-by-step instructions for decompiling, inspecting bytecode, and running the JAR locally in 928795e.

Agent-Logs-Url: https://github.com/OWASP/wrongsecrets/sessions/ffd37450-0343-442a-abee-851241cb0eff

Co-authored-by: commjoen <1457214+commjoen@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

🌐 GitHub Pages Preview Ready!

Your static preview is now available at:
🔗 Preview PR #2523

📄 What's included:

For full functionality testing: Use the Docker preview instead.

🔄 Auto-updates: This preview will be updated automatically when you push new commits to this PR.


Static preview with Thymeleaf generation by GitHub Actions

@github-actions
Copy link
Copy Markdown

🔨 Preview Build Complete!

Your changes have been built and pushed to GitHub Container Registry.

🐳 Docker Image: ghcr.io/owasp/wrongsecrets/wrongsecrets-pr:pr-2523-6714add

📦 Download & Test Locally:

  1. 📁 Download Docker Image Artifact (look for wrongsecrets-preview-pr-2523)
  2. Load and run the image:
# Download the artifact, extract it, then:
docker load < wrongsecrets-preview.tar
docker run -p 8080:8080 -p 8090:8090 wrongsecrets-preview

🚀 Alternative - Pull from Registry:

docker pull ghcr.io/owasp/wrongsecrets/wrongsecrets-pr:pr-2523-6714add
docker run -p 8080:8080 -p 8090:8090 ghcr.io/owasp/wrongsecrets/wrongsecrets-pr:pr-2523-6714add

Then visit: http://localhost:8080

📝 Changes in this PR:
- src/main/java/org/owasp/wrongsecrets/challenges/docker/Challenge65.java
- src/main/java/org/owasp/wrongsecrets/challenges/docker/Challenge66.java
- src/main/java/org/owasp/wrongsecrets/challenges/docker/binaryexecution/BinaryExecutionHelper.java
- src/main/resources/explanations/challenge65.adoc
- src/main/resources/explanations/challenge65_hint.adoc
- src/main/resources/explanations/challenge65_reason.adoc
- src/main/resources/explanations/challenge66.adoc
- src/main/resources/explanations/challenge66_hint.adoc
- src/main/resources/explanations/challenge66_reason.adoc

Visual diff screenshots will be available shortly...


Preview built by GitHub Actions

@github-actions
Copy link
Copy Markdown

📸 Visual Diff Ready!

Screenshots comparing your changes with the main branch are available:

📁 Download Visual Diff Artifacts

🖼️ Included screenshots:

  • pr-home.png vs main-home.png - Welcome page comparison
  • pr-about.png vs main-about.png - About page comparison
  • pr-challenge.png vs main-challenge.png - Challenge page comparison

🔍 How to review:

  1. Download the artifact zip file
  2. Extract and compare the pr-* and main-* images side by side
  3. Look for visual differences in layout, styling, and content

💡 Tip: Use an image comparison tool or open both images in separate browser tabs to spot differences easily.


Visual diff generated by GitHub Actions • PR #2523

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants