Skip to content

Commit

Permalink
Merge pull request #1660 from OWASP/desktop-improvements
Browse files Browse the repository at this point in the history
.net container support
  • Loading branch information
commjoen authored Oct 9, 2024
2 parents 3b7fac6 + 22b86cb commit 77a8517
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 17 deletions.
9 changes: 5 additions & 4 deletions Dockerfile_webdesktop
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@ RUN \
rm -rf /tmp/*

RUN \
export DOTNET_INSTALL_DIR="/etc/dotnet" && \
echo "installing dotnet" && \
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh && \
chmod +x dotnet-install.sh && \
./dotnet-install.sh --version latest && \
export DOTNET_ROOT=$HOME/.dotnet && \
export DOTNET_ROOT=/etc/dotnet && \
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools && \
dotnet tool install --global ilspycmd && \
dotnet tool install -g sfextract
export PATH="$PATH:/config/.dotnet/tools" &&\
dotnet tool install ilspycmd --version 9.0.0.7660-preview2 --tool-path /etc/dotnet/tools

WORKDIR /config/Desktop

COPY src/main/resources/executables/*linux* /var/tmp/wrongsecrets/
COPY src/main/resources/executables/*linux-mus* /var/tmp/wrongsecrets/
COPY src/main/resources/executables/decrypt/ /var/tmp/wrongsecrets/decrypt/
COPY src/main/resources/executables/wrongsecrets-advanced-c-windows.exe /var/tmp/wrongsecrets/
COPY src/main/resources/executables/secrchallenge.md /var/tmp/wrongsecrets/
Expand Down
19 changes: 10 additions & 9 deletions Dockerfile_webdesktopk8s
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,19 @@ RUN echo "**** clone wrongsecrets.git for webtop in k8s ****" && \
git clone https://github.com/OWASP/wrongsecrets.git

RUN \
echo "installing dotnet" && \
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh && \
chmod +x dotnet-install.sh && \
./dotnet-install.sh --version latest && \
export DOTNET_ROOT=$HOME/.dotnet && \
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools && \
dotnet tool install --global ilspycmd && \
dotnet tool install -g sfextract
export DOTNET_INSTALL_DIR="/etc/dotnet" && \
echo "installing dotnet" && \
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh && \
chmod +x dotnet-install.sh && \
./dotnet-install.sh --version latest && \
export DOTNET_ROOT=/etc/dotnet && \
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools && \
export PATH="$PATH:/config/.dotnet/tools" &&\
dotnet tool install ilspycmd --version 9.0.0.7660-preview2 --tool-path /etc/dotnet/tools

WORKDIR /config/Desktop

COPY src/main/resources/executables/*linux* /var/tmp/wrongsecrets/
COPY src/main/resources/executables/*linux-mus* /var/tmp/wrongsecrets/
COPY src/main/resources/executables/decrypt/ /var/tmp/wrongsecrets/decrypt/
COPY src/main/resources/executables/wrongsecrets-advanced-c-windows.exe /var/tmp/wrongsecrets/
COPY src/main/resources/executables/secrchallenge.md /var/tmp/wrongsecrets/
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/explanations/challenge50_hint.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ You can solve this challenge using the following alternative solutions:
- download it from the https://github.com/OWASP/wrongsecrets-binaries/releases[Wrongsecrets Binaries]
- Install .NET8 and .NET8 SDK
- Install https://github.com/icsharpcode/ILSpy/tree/master/ICSharpCode.ILSpyCmd[ilspycmd]
- Install `sfextract`: `dotnet tool install -g sfextract`
- Unpack the self-contained binary: `sfextract wrongsecrets-dotnet -o \./tmp`.
- optionally: Install `sfextract`: `dotnet tool install -g sfextract`
- Unpack the self-contained binary: `sfextract wrongsecrets-dotnet -o \./tmp`. or use ilspy: `mkdir tmp && ilspycmd -d wrongsecrets-dotnet-linux -o ~/tmp`
- Go to the tmp folder and do `ilspycmd dotnetproject.dll` to decompile the dll and find the secret.
Don't want to install the tools? check the https://github.com/OWASP/wrongsecrets/tree/master?tab=readme-ov-file#want-to-play-but-are-not-allowed-to-install-the-tools[WrongSecrets Desktop container]!
6 changes: 4 additions & 2 deletions wrongsecret-desktop-resources/startwm.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/bash

export DOTNET_ROOT=$HOME/.dotnet
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools
export DOTNET_ROOT=/etc/dotnet
export DOTNET_INSTALL_DIR="/etc/dotnet"
export PATH="$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools"
export PATH="$PATH:/config/.dotnet/tools"
/startpulse.sh &
ln -s -r /var/tmp/wrongsecrets /config/Desktop/wrongsecrets
ln -s /var/tmp/wrongsecrets/welcome.md /config/Desktop/welcome.md
Expand Down

0 comments on commit 77a8517

Please sign in to comment.