An example of a FUSE filesystem that can be used in kernel exploitation as a replacement for userfaultfd technique
Compile the file fusefs.c
using: gcc -D_FILE_OFFSET_BITS=64 fusefs.c `pkg-config fuse --cflags --libs` -o fusefs.o
Note:
make sure you have the libfuse-dev
package installed on your system
To start FUSE filesystem on a directory, execute ./fusefs.o <name_dir>
.
If you want debug output, use ./fusefs.o -d -s -f <name_dir>
fusefs.c
: it implements all the logic of the filesystem, here you can find the definition of the FUSE file operations
fuse_dir
: this is the directory that will be mounted with the FUSE filesystem
test.c
: A simple program to test FUSE filesystem
Enjoy! :)
~LukeGix