当前位置:   article > 正文

Java -- 一句话木马_java一句话穆阿么

java一句话穆阿么

用Java调用计算机程序

import java.io.IOException;

public class WebShell {
    public static void main(String[] args) throws IOException {
        Runtime.getRuntime().exec("calc");
    }

}


  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

调用cmd命令

import java.io.IOException;
import java.io.InputStream;
import java.util.Scanner;

public class Ping {
    public static void main(String[] args) throws IOException {
        Process pro = Runtime.getRuntime().exec(new String[]{"cmd","/c","ping www.baidu.com"});// calc / other
        InputStream in = pro.getInputStream();
        Scanner sc = new Scanner(in);
        while (sc.hasNextLine()){
            System.out.println(sc.nextLine());

        }
    }
}

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/717524
推荐阅读
相关标签
  

闽ICP备14008679号