Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
8302690
Challenge54 & Challenge55
Mar 13, 2025
70bfd91
Merge branch 'OWASP:master' into fix/issue613
Pastekitoo Mar 13, 2025
a2f7fac
Update challenge54.adoc
Pastekitoo Mar 14, 2025
0c9697b
Update challenge54_hint.adoc
Pastekitoo Mar 14, 2025
e25d7a1
Update challenge54_reason.adoc
Pastekitoo Mar 14, 2025
6087a68
Update challenge55.adoc
Pastekitoo Mar 14, 2025
e0bb40c
Update challenge55_hint.adoc
Pastekitoo Mar 14, 2025
e8daa04
Update challenge54.adoc
Pastekitoo Mar 14, 2025
d5639b7
Update challenge55.adoc
Pastekitoo Mar 14, 2025
622e1a9
Merge branch 'OWASP:master' into fix/issue613
Pastekitoo Mar 14, 2025
504180b
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Mar 14, 2025
b28fcce
Update src/main/resources/wrong-secrets-configuration.yaml
Pastekitoo Mar 16, 2025
81999ef
Update src/main/resources/wrong-secrets-configuration.yaml
Pastekitoo Mar 16, 2025
f0d5429
Merge branch 'master' into fix/issue613
Pastekitoo Mar 16, 2025
161eb6f
Rename Challenge55.java to Challenge55Test.java
Pastekitoo Mar 17, 2025
06a65d1
Update Challenge54Test.java
Pastekitoo Mar 17, 2025
13408c7
Update Challenge54Test.java
Pastekitoo Mar 17, 2025
6a8cb83
Update Challenge54.java
Pastekitoo Mar 17, 2025
0f0983b
Update Challenge54.java
Pastekitoo Mar 17, 2025
98fed75
Update Challenge55Test.java
Pastekitoo Mar 17, 2025
9a764c9
Update Challenge55.java
Pastekitoo Mar 17, 2025
f03f8d8
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Mar 17, 2025
28d0260
Update Challenge55.java
Pastekitoo Mar 17, 2025
907e35a
Update Challenge55.java
Pastekitoo Mar 18, 2025
b5ba75a
Update Challenge55.java
Pastekitoo Mar 18, 2025
fab6156
Update Challenge54.java
Pastekitoo Mar 18, 2025
0e3849e
Update wrong-secrets-configuration.yaml
Pastekitoo Mar 18, 2025
3b85c52
Merge branch 'OWASP:master' into fix/issue613
Pastekitoo Mar 20, 2025
7284ea6
add encryption of the input in test
Mar 26, 2025
d654405
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Mar 26, 2025
5d2c90f
Update .gitignore
Pastekitoo Mar 26, 2025
6269a33
Update config
Pastekitoo Mar 26, 2025
4aa3c17
Merge branch 'OWASP:master' into fix/issue613
Pastekitoo Mar 26, 2025
cc78605
Merge branch 'master' into fix/issue613
commjoen Apr 6, 2025
612bed5
Compacted challenge54 to match encrytped secrets with less internal c…
commjoen Apr 6, 2025
919683f
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Apr 6, 2025
56d15c9
corrected challenge 54
commjoen Apr 8, 2025
879fba7
Merge branch 'fix/issue613' of github.com:Pastekitoo/wrongsecrets int…
commjoen Apr 8, 2025
1355433
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Apr 8, 2025
384ab0f
rewrite of challenge55
commjoen Apr 9, 2025
18fb831
Merge branch 'fix/issue613' of github.com:Pastekitoo/wrongsecrets int…
commjoen Apr 9, 2025
f64f61a
Cleanup unused imports
commjoen Apr 9, 2025
df131f6
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Apr 9, 2025
dd986fb
Merge branch 'master' into fix/issue613
commjoen Apr 10, 2025
262d524
Merge branch 'master' into fix/issue613
commjoen Apr 10, 2025
f6baf43
suppress stuff and fix a bug
commjoen Apr 10, 2025
2866290
Merge branch 'fix/issue613' of github.com:Pastekitoo/wrongsecrets int…
commjoen Apr 10, 2025
684ff4c
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Apr 10, 2025
5a97460
final fixes to make it green again
commjoen Apr 10, 2025
5c7e464
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Apr 10, 2025
dc99106
remove lines
commjoen Apr 11, 2025
0be7dff
Merge branch 'fix/issue613' of github.com:Pastekitoo/wrongsecrets int…
commjoen Apr 11, 2025
f29911b
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Apr 11, 2025
9cddab4
Added missing instructions
commjoen Apr 24, 2025
3167b6a
Merge branch 'master' into fix/issue613
commjoen Apr 24, 2025
811c827
update readme to reflect 55 challenges
commjoen Apr 24, 2025
91aab2a
updated challenge54
commjoen Apr 24, 2025
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,6 @@ scripts/sort_contibutors/contributors_file.*

#optimizations
.github/scripts/binary_version.txt

# Cha-llen-ge 5-4 (to avoid detection by scanning tools)
# Se-cret en-cry-pted : U2FsdGVkX1+p6s7MeffGxSCZ5EcJoNqQD/W6bm9VKwzFmH1XAVpnP4Rcio6uPXYV
6 changes: 6 additions & 0 deletions .ssh/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Host dev
HostName 127.0.0.1
User wrongsecrets
Port 4444
# Cha-llen-ge 5-5 (to avoid detection by scanning tools)
# Se-cret en-cry-pted : U2FsdGVkX18Z71msuvueMq5Tyioi7zYt6FJM/z6qJIvXM8q587ZT4ogr49ccs9Mv
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.owasp.wrongsecrets.challenges;

import org.springframework.stereotype.Component;

/** Challenge with a secret in .gitignore */
@Component
public class Challenge54 extends FixedAnswerChallenge {

private final String secret = "(<:GITIGN0RE_SECRET:>)";

@Override
public String getAnswer() {
return secret;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.owasp.wrongsecrets.challenges;

import org.springframework.stereotype.Component;

/** Challenge with a secret in .ssh */
@Component
public class Challenge55 extends FixedAnswerChallenge {

private final String secret = "(<:SSH_SECRET:>)";

@Override
public String getAnswer() {
return secret;
}
}
10 changes: 10 additions & 0 deletions src/main/resources/explanations/challenge54.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
=== Hidden Secret Challenge

Sometimes developers mistakenly add sensitive data or secrets as comments or hidden entries in files.

In this challenge, a developer left behind an encrypted secret in a file comment. This challenge highlights how easy it is to forget critical secrets in accessible file.

Your goal is to find and decrypt this forgotten secret.

==== Note
The secret is encrypted using AES-256-CBC and base64 format. Use the following passphrase "key_to_decrypt_the_secret" to decrypt it.
11 changes: 11 additions & 0 deletions src/main/resources/explanations/challenge54_hint.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
The secret is hidden within the `.gitignore` file as an AES-256-CBC encrypted, base64-encoded comment.

Follow these steps to decrypt the secret:

1. Locate the encrypted comment in `.gitignore`.
2. Use OpenSSL to decrypt:
+
[source,bash]
----
echo "<encrypted_base64_secret_here>" | openssl enc -aes-256-cbc -a -d -pass pass:"key_to_decrypt_the_secret"
----
5 changes: 5 additions & 0 deletions src/main/resources/explanations/challenge54_reason.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Developers regularly update configuration files like `.gitignore`, occasionally leaving sensitive information behind, such as passwords, tokens, or critical file paths.

Forgotten secrets in public files indicate poor security practices and weak secret management.

This challenge demonstrates the importance of code reviews and ensuring secrets are never accidentally committed or left behind.
12 changes: 12 additions & 0 deletions src/main/resources/explanations/challenge55.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
=== Hidden Secret Challenge

Sometimes developers mistakenly add sensitive data or secrets as comments or hidden entries in files.

In this challenge, a developer left behind an encrypted secret in a file comment. This challenge highlights how easy it is to forget critical secrets in accessible file.

Find and decrypt this forgotten secret.

==== Hint
The secret is encrypted using AES-256-CBC and base64 format. Use the provided passphrase to decrypt it.

The passphrase is "key_to_decrypt_the_secret".
11 changes: 11 additions & 0 deletions src/main/resources/explanations/challenge55_hint.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
The secret is AES-256-CBC encrypted and base64-encoded in a comment within the `.ssh/config` file.

Decrypt the secret using these steps:

1. Open `.ssh/config` and locate the encrypted secret comment.
2. Decrypt the encrypted comment using OpenSSL:
+
[source,bash]
----
echo "<encrypted_base64_secret_here>" | openssl enc -aes-256-cbc -a -d -pass pass:"key_to_decrypt_the_secret"
----
7 changes: 7 additions & 0 deletions src/main/resources/explanations/challenge55_reason.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
=== Risks of sensitive data in SSH configuration files

Developers frequently store SSH connection configurations in `.ssh/config` files. However, this convenience may lead to the accidental inclusion of sensitive information, such as passwords or keys, which could become forgotten over time.

Forgotten secrets indicate inadequate security checks and poor secret management practices.

This challenge emphasizes the importance of secure storage practices and periodic auditing of sensitive configuration files.
26 changes: 26 additions & 0 deletions src/main/resources/wrong-secrets-configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -840,3 +840,29 @@ configurations:
category: *secrets
ctf:
enabled: false

- name: Challenge 54
short-name: "challenge-54"
sources:
- class-name: "org.owasp.wrongsecrets.challenges.Challenge54"
explanation: "explanations/challenge54.adoc"
hint: "explanations/challenge54_hint.adoc"
reason: "explanations/challenge54_reason.adoc"
environments: *all_envs
difficulty: *easy
category: *secrets
ctf:
enabled: true

- name: Challenge 55
short-name: "challenge-55"
sources:
- class-name: "org.owasp.wrongsecrets.challenges.Challenge55"
explanation: "explanations/challenge55.adoc"
hint: "explanations/challenge55_hint.adoc"
reason: "explanations/challenge55_reason.adoc"
environments: *all_envs
difficulty: *easy
category: *secrets
ctf:
enabled: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.owasp.wrongsecrets.challenges;

import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;

class Challenge54Test {

@Test
void rightAnswerShouldSolveChallenge() {
var challenge = new Challenge54();
Assertions.assertThat(challenge.solved("wrong answer")).isFalse();
Assertions.assertThat(challenge.solved(challenge.spoiler().solution())).isTrue();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.owasp.wrongsecrets.challenges;

import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;

class Challenge55Test {

@Test
void rightAnswerShouldSolveChallenge() {
var challenge = new Challenge55();
Assertions.assertThat(challenge.solved("wrong answer")).isFalse();
Assertions.assertThat(challenge.solved(challenge.spoiler().solution())).isTrue();
}
}
Loading