openkylin-exploit-db/cve/linux-kernel/2023/CVE-2023-0179
ZZlz2580 f6ac62fdd6
add CVE-2023-0179
Signed-off-by: ZZlz2580 <liuzhenglz@buaa.edu.cn>
2023-03-09 07:14:37 +00:00
..
LICENSE add CVE-2023-0179 2023-03-09 07:14:37 +00:00
Makefile add CVE-2023-0179 2023-03-09 07:14:37 +00:00
README.md add CVE-2023-0179 2023-03-09 07:14:37 +00:00
config add CVE-2023-0179 2023-03-09 07:14:37 +00:00
exploit.c add CVE-2023-0179 2023-03-09 07:14:37 +00:00
exploit.h add CVE-2023-0179 2023-03-09 07:14:37 +00:00
helpers.c add CVE-2023-0179 2023-03-09 07:14:37 +00:00
helpers.h add CVE-2023-0179 2023-03-09 07:14:37 +00:00
needle.c add CVE-2023-0179 2023-03-09 07:14:37 +00:00
reg.log add CVE-2023-0179 2023-03-09 07:14:37 +00:00
run.sh add CVE-2023-0179 2023-03-09 07:14:37 +00:00
setup.sh add CVE-2023-0179 2023-03-09 07:14:37 +00:00

README.md

Needle (CVE-2023-0179) exploit

This repository contains the exploit for my recently discovered vulnerability in the nftables subsystem that was assigned CVE-2023-0179, affecting all Linux versions from 5.5 to 6.2-rc3, although the exploit was tested on 6.1.6.

The vulnerability details and writeup can be found on oss-security

Building instructions

Just invoke the make needle command to generate the corresponding executable.

libmnl and libnftnl are required for the build to succeed:

sudo apt-get install libmnl-dev libnftnl-dev

Infoleak

The exploit will enter an unprivileged user and network namespace and add an nft_payload expression via the rule_add_payload function which, when evaluated, will trigger the stack buffer overflow and overwrite the registers.

The content is then retrieved with the following nft command:

nft list map netdev mytable myset12

The output will leak several shuffled addresses relative to kernel data structures, among which we find a kernel instruction address and the regs pointer.

LPE

The exploit creates a new user account needle:needle with UID 0 by abusing the modprobe_path variable.

Enjoy root privileges.

Demo

asciicast

Credits