Simple and portable cli tool and golang package for run program as random user. Source code ported from C implementation raru.
To install raru, please use go get
.
$ go get github.com/ArtemKulyabin/raru/cmd/raru
$ go get github.com/ArtemKulyabin/raru/cmd/raru-spawn
Jail - run program as random user and changes the apparent root directory for the running process using a chroot(2) system call. If the program linked with dynamic libraries, they are copied into the root directory of the process.
$ go get github.com/ArtemKulyabin/raru/cmd/raru-jail
$ go get github.com/ArtemKulyabin/raru
$ raru ./fishy-app-youve-never-ran-before
...
$ raru bash # Whole shell as a random user.
...
$ raru curl https://fishysite
...
$ raru-jail run --chroot /dir /bin/ls
...
package main
import (
"log"
"github.com/ArtemKulyabin/raru"
)
func main() {
log.Println(raru.Exec(os.Args[1], os.Args[2:]...))
}
For cross compilation you may use the Gox. Example:
$ gox github.com/ArtemKulyabin/raru/cmd/raru
- Linux, FreeBSD, OpenBSD, NetBSD, Darwin(OS X)
- Ubuntu 14.04, FreeBSD 10.1, OpenBSD 5.6, NetBSD 6.1.5, OS X Yosemite 10.10.3