Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.net container support #1660

Merged
merged 5 commits into from
Oct 9, 2024
Merged
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
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
Loading