Claude Gained a Root Shell in 8 Hours by Creating an Exploit for the FreeBSD Kernel

watch 2m
views 2

14:25, 02.04.2026

Finding bugs in programs using computers has never been a major problem. But finding and exploiting them is a completely new approach that requires a deep understanding of OS installation processes, adaptation, memory management, ROP chain creation, and much more.

Details on the neural network’s creation of the exploit

The vulnerability, identified as CVE-2026-4747, had already been patched by the end of March. However, the researcher decided to test whether Claude could turn its description into a working exploit. In just under 8 hours, the AI was able to reproduce the code that opened a root shell, and Claude’s actual processing time was only about 4 hours.

Claude created a 15-round strategy for the exploit, which consisted of:

  • In the initial round, pmap_change_prot() is called via a ROP chain to change the kernel BSS memory permissions to RWX.
  • Next, over the course of 14 rounds, the shellcode is written in 32-byte chunks.
  • The final step involves transferring the last bytes and jumping to the shellcode.

During the execution of each round, one kernel NFS thread is terminated using kthread_exit(), but the server continues to function. The most difficult part was the transition from the kernel to the user space. It is impossible to directly call execve() through an NFS thread, so the following scheme was used:

  • Initially, the hijacked thread calls kproc_create(), which creates and then terminates a full-fledged process.
  • Next, the new process launches /bin/sh via kern_execve().

However, during testing, the worker process crashed due to hardware breakpoints. To resolve this issue, specific commands had to be added to the shellcode to clear the DR7 register.

The next important step was determining the correct offset for overwriting RIP. Using a brute-force sequence, Claude determined that the correct value was 200 bytes.

Of course, fuzzers had already been used to detect vulnerabilities in the kernel before this experiment, but creating a working exploit was not yet considered possible using AI. In this case, Claude not only generated code, but also:

  • Set up a test environment, taking into account the need for 2 CPUs.
  • Generated a debug session via QEMU.
  • Also used ROP gadgets.
  • Fixed the issue with inherited debug registers.

Finding bugs in programs using computers has never been a major problem. But finding and exploiting them is a completely new approach that requires a deep understanding of OS installation processes, adaptation, memory management, ROP chain creation, and much more.

Share

Was this article helpful to you?

VPS popular offers

-10%

CPU
CPU
4 Xeon Cores
RAM
RAM
4 GB
Space
Space
100 GB SSD
Bandwidth
Bandwidth
Unlimited
MT5 KVM 4096 Windows

19.99 /mo

/mo

Billed annually

-10%

CPU
CPU
10 Epyc Cores
RAM
RAM
64 GB
Space
Space
400 GB NVMe
Bandwidth
Bandwidth
Unlimited
KVM-NVMe 65536 Linux

135.49 /mo

/mo

Billed annually

-4.7%

CPU
CPU
3 Xeon Cores
RAM
RAM
1 GB
Space
Space
40 GB HDD
Bandwidth
Bandwidth
300 Gb
wKVM-HDD HK 1024 Windows

10.36 /mo

/mo

Billed annually

-12.8%

CPU
CPU
3 Xeon Cores
RAM
RAM
1 GB
Space
Space
50 GB SSD
Bandwidth
Bandwidth
1 TB
wKVM-SSD 1024 Metered Windows

17 /mo

/mo

Billed annually

-20.4%

CPU
CPU
2 Xeon Cores
RAM
RAM
2 GB
Space
Space
30 GB SSD
Bandwidth
Bandwidth
300 GB
KVM-SSD 2048 HK Linux

18 /mo

/mo

Billed annually

-10%

CPU
CPU
2 Epyc Cores
RAM
RAM
1 GB
Space
Space
10 GB NVMe
Bandwidth
Bandwidth
Unlimited
KVM-NVMe 1024 Linux

7.1 /mo

/mo

Billed annually

-10%

CPU
CPU
6 Xeon Cores
RAM
RAM
8 GB
Space
Space
200 GB HDD
Bandwidth
Bandwidth
Unlimited
KVM-HDD 8192 Linux

25.25 /mo

/mo

Billed annually

-9.3%

CPU
CPU
6 Epyc Cores
RAM
RAM
16 GB
Space
Space
150 GB NVMe
Bandwidth
Bandwidth
Unlimited
wKVM-NVMe 16384 Windows

54.49 /mo

/mo

Billed annually

-20.2%

CPU
CPU
1 Xeon Core
RAM
RAM
1 GB
Space
Space
50 GB SSD
Bandwidth
Bandwidth
300 GB
wKVM-SSD 1024 HK Windows

19 /mo

/mo

Billed annually

-10%

CPU
CPU
6 Epyc Cores
RAM
RAM
8 GB
Space
Space
100 GB NVMe
Bandwidth
Bandwidth
Unlimited
wKVM-NVMe 8192 Windows

28.99 /mo

/mo

Billed annually

Other articles on this topic

Joomla 5.2.2 release
Joomla 5.2.2 release
cookie

Accept cookies & privacy policy?

We use cookies to ensure that we give you the best experience on our website. If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the HostZealot website.