This is an exploit for CVE-2025-39946. It will work on the lts-6.12.48 kCTF instance (but not 100% reliable).
I wrote a blog post analysing this vulnerability in detail. Check it out here!
The only modification the exploit should need to work for other kernel versions is a change to the CORE_PATTERN_OFFSET. You'll have to get the target kernel's bzImage, load the kernel with root privs, and compare core_pattern's address with _text's address in /proc/kallsyms.
I don't think any other changes will be necessary to adapt the exploit for other versions.