fun with pledge()
Posted: Wed Oct 07, 2020 3:11 pm
On OpenBSD pledge() system call forces the current process into a restricted-service operating mode.
I know newLISP can import function from shared libraries, but I have never done so yet. So I thought I'd give it a try with pledge():
In another window I see
That was fun! I will play more with this little tool.
I know newLISP can import function from shared libraries, but I have never done so yet. So I thought I'd give it a try with pledge():
Code: Select all
> (import "/usr/lib/libc.so.96.0" "pledge")
pledge@F99015DECD0
> (pledge "tty stdio" 0)
0
> (println "yay!")
yay!
"yay!"
> (! "ls -al")
Abort trap (core dumped)
Code: Select all
newlisp[56936]: pledge "proc", syscall 66