You should complete Kernel Security module and Kernel Exploitation module before these challenges.

Notes

These challenges use /challenges/run.sh as a starting point. They do not use vm script at all.

You might run /challenges/run.sh <bin path> to copy the exploit binary to the vm. In most cases, the exploit binary should be statically compiled since there is no glibc runtime inside the init rootfs.

There are hints encoded in base64. If you feel stuck after a day or two, feel free to take hints for new ideas. After all the dojo is to learn, not to score anyone.

In practice mode, to aid debugging, edit run.sh to modify qemu arguments:

  • Add nokaslr after the -append flag.
  • Enable kvm with -enable-kvm flag for better performance.
  • Add -s flag for gdb port 1234.

Recommended readings



Challenges

Learn msg_msg.

Notes

I fixed the SMEP config bug in the original qemu run.sh script.

Hint 1:

T2ZmLWJ5LW9uZSBpbiBlZGl0Cg==

Hint 2:

VGhlcmUgYXJlIDIgYnVncy4K

Connect with SSH

Link your SSH key, then connect with: ssh [email protected]

After repeated attacks on poor kernel objects, I've decided to place pwners in a special isolated place - a marooned region of memory. Good luck escaping out of here :^)

Notes

  • You can use /challenge/run.sh <exploit> to run the challenge. However because the kernel is compiled without block device support, we will have to re-compress the initramfs every run. This may lead to unstable physical layout of the image.
  • The original event does not provide mod.c during the contest. But to focus on the bug, here I gift it to you.

Connect with SSH

Link your SSH key, then connect with: ssh [email protected]

Instruction

  • You have a busybox shell running as user user
  • Try exploiting rose.ko to achieve privilege escalation
  • You may assumed that busybox, the Linux kernel, and Qemu are not vulnerable.

Files

  • /challenge/rose.ko: The vulnerable driver
  • /challenge/src/rose.c: The source code of rose.c

Notes

  • FG-KASLR is enabled
  • Your exploit should be kernel-agnostic. In other words, it should not rely on any kernel offsets

Connect with SSH

Link your SSH key, then connect with: ssh [email protected]

Elastic objects seem to have even more power in many more slabs!

Can you use RetSpill and bypass FGKASLR to solve this ?

Notes

  • You can use /challenge/run.sh <exploit> to run the challenge. However because the kernel is compiled without block device support, we will have to re-compress the initramfs every run. This may lead to unstable physical layout of the image.
  • The original event does not provide firewall.c during the contest. But to focus on bug, here I gift it to you.

Hints

Hint 1: The module is safe ?

VGhlcmU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29tbWl0X2NyZWRzDTB4ZmZmZmZmZmZhOTU0ZmMwNCA8X19rc3ltdGFiX2NvbW1pdF9jcmVk
cz46ICAgIDB4ZmZiN2RhY2MgICAgICAweDAwMDE3NTQ2ICAgICAgMHgwMDAyMjE2NQ1nZWY+IHAg
X19rc3ltdGFiX2NvbW1pdF9jcmVkcysweGZmYjdkYWNjDSQzID0gMHhhOTBjZDZkMA1nZWY+IHAg
Y29tbWl0X2NyZWRzDSQ0ID0gMHhmZmZmZmZmZmE5MGNkNmQwIDxjb21taXRfY3JlZHM+DWBgYAo=

Hint 3: RetSpill is impossible for this kernel ?

U3RhY2sgc2hpZnRpbmcgZ2FkZ2V0IChub3QgcGl2b3RpbmcpIGFyZSBgYWRkIHJzcCwgMHguLmAg
YW5kIC4uID8gQnV0IHRoZQ1sYXR0ZXIgZ2FkZ2V0IGtpbmQgaXMgbm90IGFzIGdvb2QgYXMgdGhl
IGZvcm1lciBvbmUuIEl0IGRvZXMgbm90IHNraXAgdGhlIGNsZWFuIHVwIHBhcnQuCg==

Connect with SSH

Link your SSH key, then connect with: ssh [email protected]

Format string but in kernel ?

Notes

Now you could use vm script to start the challenge.

Connect with SSH

Link your SSH key, then connect with: ssh [email protected]

30-Day Scoreboard:

This scoreboard reflects solves for challenges in this module after the module launched in this dojo.

Rank Hacker Badges Score