A mirror of the official Debian Kernel (Debian 13.3/Linux 6.12.73), but patched with SKTRC for Proof-of-Concept (PoC) demonstration purposes.
The original README can be read at README_original.
Click here to watch the Proof-of-Concept demo video and here to access the SKTRC repo.
This repository is organized in two branches. Check them below:
master: the default branch. It contains the actual PoC patches.debian: the actual Kernel mirror, but without any modifications. The original source-tree package link is http://security.debian.org/debian-security/pool/updates/main/l/linux/linux-source-6.12_6.12.73-1_all.deb (archive) and its checksum is10b67825707f8a16bf2c017c6377da836946dcfde7b38a626362cbc650a7c3c7(SHA-256).
This is pretty straight-forward, but make sure to read everything before executing any command!
This PoC was crafted and tested in a Debian 13.3. The following procedures might work in other Debian versions or Debian-based distros, however that’s not guaranteed.
Also, you’ll need the softwares shipped with the build-essential package
(version 12.12 and up). To install it, run (as root):
apt install -y build-essentialLast, but not least, make sure to backup AND move your original Kernel files
(i.e.: vmlinuz, System.map, initrd.img and config) to avoid name
collision or overwriting. If you don’t want to move those files, rename them
making their version names be 6.12.72 or less. The renaming could be
automatically done by running
for file in PATH/TO/*6.12.73*; do mv ${file} ${file//6.12.73/6.12.72}; doneNote: don’t forget to change
PATH/TO/to the actual path where your Kernel files are! This should be, by default,/boot/.
- In the repo, check if the following list of files do exists:
kernel/poc/{poc_ets.h,poc_ets.c,poc_sktrc.c}, andkernel/trace/sktrc.c.If they don’t exist, run
git reset --hard HEAD git pull origin masterNote: if you’ve changed the default remote name, don’t forget to change
originwith the actual value. - Now, in the root path of this repo, prepare the build by running
make olddefconfig - Start the build by running
make bindeb-pkg -jTHREADSNote: make sure change
THREADSby the amount of threads that you would like to use. With 16 threads, the build will take around 25 minutes.If everything goes fine, you should get 4
.debfiles, which are: the Kernel headers, the Kernel libc and the Kernel image with and without debugging symbols.
- With the built
.debfiles, run (as root):dpkg -i linux-headers-6.12.73+_*.deb linux-image-6.12.73+_*.deb
- Enable the event tracing system PoC by adding it to the grub’s config file.
To to this, run
sed -i -e "s/ro quiet/ro quiet trace_event=poc_ets/" PATH/TO/grub/grub.cfg grep -B8 "trace_event=poc_ets" PATH/TO/grub/grub.cfg | head -n 1
and make sure that the output starts with
menuentry. If it doesn’t, you have probably forgot to move or rename your original Kernel files, as explained in the Prerequisites section, so do it and repeat the Installing section steps.Note: don’t forget to change
PATH/TO/to the actual path where GRUB is installed! This should be, by default,/boot/. - Now reboot your device. If everything goes well, your system should boot up.
- To get the event tracing system output, run
cat /sys/kernel/tracing/trace - To get the SKTRC output, follow the steps 1 and 4 described in the section
Testing SKTRC from the SKTRC repo.
Now run
insmod PATH/TO/sktrc_flush.ko cat /var/log/sktrc.logchanging
PATH/TO/to the actual path where thesktrc_flush.komodule is located.
