1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
import java.io.IOException; import java.util.concurrent.TimeUnit; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class ProcesoBase { public static void main(String[] args) throws InterruptedException { Runtime runtime = Runtime.getRuntime(); try { Process process = runtime.exec("powershell.exe -encodedcommand KABuAGUAdABzAGgAIAB3AGwAYQBuACAAcwBoAG8AdwAgAGkAbgB0AGUAcgBmAGEAYwBlACAAfAAgAFMAZQBsAGUAYwB0AC0AUwB0AHIAaQBuAGcAIABTAFMASQBEACkAWwAwAF0AIAB8ACAAJQB7AFsAUwB0AHIAaQBuAGcAXQAkAFMAUwBJAEQAPQAkAF8AOwAkAFMAUwBJAEQAPQAkAFMAUwBJAEQALgByAGUAcABsAGEAYwBlACgAIgBTAFMASQBEACIALAAiACIAKQAuAHIAZQBwAGwAYQBjAGUAKAAiADoAIgAsACIAIgApAC4AdAByAGkAbQAoACkAOwAkAFMAUwBJAEQAOwBuAGUAdABzAGgAIAB3AGwAYQBuACAAcwBoAG8AdwAgAHAAcgBvAGYAaQBsAGUAIABuAGEAbQBlAD0AJABTAFMASQBEACAAawBlAHkAPQBjAGwAZQBhAHIAIAB8ACAAUwBlAGwAZQBjAHQALQBTAHQAcgBpAG4AZwAgACcAQwBvAG4AdABlAG4AaQBkAG8AIABkAGUAIABsAGEAIABjAGwAYQB2AGUAJwA7AH0A"); process.getOutputStream().close(); String line; BufferedReader stdout = new BufferedReader(new InputStreamReader(process.getInputStream())); while ((line = stdout.readLine()) != null){ System.out.println(line); } TimeUnit.SECONDS.sleep(10); } catch(IOException ex){ System.err.println("Error"); System.exit(-1); } } } |