-
-
Notifications
You must be signed in to change notification settings - Fork 371
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #370 from commjoen/ctf-improved
Ctf improved - layout fixes & support for lesser hackable CTFs
- Loading branch information
Showing
16 changed files
with
409 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,31 @@ | ||
FROM jeroenwillemsen/wrongsecrets:1.5.0-no-vault | ||
FROM jeroenwillemsen/wrongsecrets:ctfd-safe-4-no-vault | ||
|
||
ARG argBasedVersion="1.5.0" | ||
ARG CANARY_URLS="http://canarytokens.com/terms/about/s7cfbdakys13246ewd8ivuvku/post.jsp,http://canarytokens.com/terms/about/y0all60b627gzp19ahqh7rl6j/post.jsp" | ||
ARG CTF_ENABLED=false | ||
ARG HINTS_ENABLED=true | ||
#ONLY OVERRIDE THE ARGS BELOW WHEN YOU ARE SETTING UP A CTF! | ||
ARG CTF_KEY=TRwzkRJnHOTckssAeyJbysWgP!Qc2T | ||
ARG CHALLENGE_5_VALUE=if_you_see_this_please_use_k8s | ||
ARG CHALLENGE_6_VALUE=if_you_see_this_please_use_k8s | ||
ARG CHALLENGE_7_VALUE=if_you_see_this_please_use_K8S_and_Vault | ||
ARG CHALLENGE_9_VALUE=if_you_see_this_please_use_AWS_Setup | ||
ARG CHALLENGE_10_VALUE=if_you_see_this_please_use | ||
ARG CHALLENGE_11_VALUE=if_you_see_this_please_use | ||
ENV APP_VERSION=$argBasedVersion | ||
ENV K8S_ENV=Heroku(Docker) | ||
ENV canarytokenURLs=$CANARY_URLS | ||
ENV ctf_enabled=$CTF_ENABLED | ||
ENV ctf_key=$CTF_KEY | ||
ENV hints_enabled=$HINTS_ENABLED | ||
ENV challengedockermtpath="/var/helpers" | ||
ENV keepasspath="/var/helpers/alibabacreds.kdbx" | ||
ENV SPECIAL_K8S_SECRET=$CHALLENGE_5_VALUE | ||
ENV SPECIAL_SPECIAL_K8S_SECRET=$CHALLENGE_6_VALUE | ||
ENV vaultpassword=$CHALLENGE_7_VALUE | ||
ENV default_aws_value_challenge_9=$CHALLENGE_9_VALUE | ||
ENV default_aws_value_challenge_10=$CHALLENGE_10_VALUE | ||
ENV default_aws_value_challenge_11=$CHALLENGE_11_VALUE | ||
COPY .github/scripts/ /var/helpers | ||
COPY src/test/resources/alibabacreds.kdbx /var/helpers | ||
CMD java -Xms128m -Xmx128m -Xss512k -jar -Dserver.port=$PORT -XX:MaxRAMPercentage=75 -XX:MinRAMPercentage=25 -Dspring.profiles.active=without-vault application.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# CTF Instructions | ||
|
||
So you want to play a CTF with WrongSecrets? This is the place to read up all about it. | ||
Our CTF setup makes use of the [Juice Shop CTF CLI extension](https://github.com/juice-shop/juice-shop-ctf), which you | ||
can read all about at [here](https://pwning.owasp-juice.shop/part1/ctf.html). | ||
|
||
The difference between Juiceshop and WrongSecrets, is that WrongSecrets is more of a secrets-hunter game. Thiss means | ||
that your contestants will try to find the CTF key soon after a few challenges. That is why we should separate out the | ||
actual container for which the CTF scores are generated, from the container where the challenges live in. | ||
|
||
You can see this practice already here in our repository: Our standard [Dockerfile](/Dockerfile) does not contain any | ||
CTF entries, our Heroku [Dockerfile.web](/Dockerfile.web) does contain them. | ||
So make sure you host your actual scoring Dockerfile.web at a place where your contestants cannot enter the container ( | ||
image) in order to extract the CTF key. | ||
|
||
## Setting up CTFs | ||
|
||
There are 3 flavors of CTF to be setup: Docker/Heroku, K8S, Cloud based. | ||
|
||
### Docker or Heroku CTF | ||
|
||
When doing a Docker or Heroku based CTF, you can follow | ||
the [instructions in the readme](https://github.com/commjoen/wrongsecrets#ctfd-support). | ||
If you want to use your own CTF key, you can build a container with the following | ||
arguments `CTF_ENABLED=true,HINTS_ENABLED=false,CTF_KEY=<YOURNEWKEYHERE>`. Just make sure you provide the same key | ||
to `juice-shop-ctf` when you run it. | ||
|
||
Want to make it a little more exciting? Override the Dockerfile with your preferred values, so that copying from online | ||
hosted solutions no longer works! | ||
|
||
### K8s based CTF | ||
|
||
TODO as #https://github.com/commjoen/wrongsecrets/issues/372 | ||
|
||
### Cloud based CTF | ||
|
||
TODO as #https://github.com/commjoen/wrongsecrets/issues/372 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.