Update: This project is not being maintained and you should probably use eBPF
kplugs
======
KPlugs is a Linux kernel module which provides an interface for dynamically executing scripts inside the Linux kernel.
KPlugs uses a simple bytecode interpreter (the KPlugs Virtual Machine), and an interface that allows a user to dynamically load scripts into the kernel and execute them directly from user space. Because the interface is dynamic, it's easy to implement a user-mode library that wraps anything in the kernel.
KPlugs comes with a Python library that compiles a subset of the Python language to the KPlugs bytecode, and lets you easily load and execute your "kernel Python script".
For more information: http://www.kplugs.org
Hi i am wondering if you have better documentation on how to use this library? I am really confused as what does what you only really explain how to install your LKM but not how everything works or how to use the class....this is a pretty cool library I am just really confused as to how this work is there anything I can read to better understand??
How do I install? I am calling make but I get an error:
if [ ! -d Debug ]; then mkdir Debug; cp Makefile.debug Debug/Makefile; cp *.c *.S *.h Debug ; fi
make[1]: Entering directory '/home/jonny/Desktop/kplugs-master/Debug'
make[2]: Entering directory '/usr/src/linux-headers-5.4.0-52-generic'
scripts/Makefile.build:57: 'kplugs.ko' will not be built even though obj-m is specified.
scripts/Makefile.build:58: You cannot use subdir-y/m to visit a module Makefile. Use obj-y/m instead.
make[4]: *** No rule to make target 'kplugs.o', needed by '__build'. Stop.
make[3]: *** [Makefile:550: scripts_basic] Error 2
make[2]: *** [Makefile:723: include/config/auto.conf.cmd] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-5.4.0-52-generic'
make[1]: *** [Makefile:10: all] Error 2
make[1]: Leaving directory '/home/jonny/Desktop/kplugs-master/Debug'
make: *** [Makefile:19: debug] Error 2