当前位置:   article > 正文

利用正方教务漏洞抓取正方教务学生照片_正方智慧校园漏洞

正方智慧校园漏洞

全国据说大部分学校采用的都是正方教务的教务系统,个人感觉安全性做的真的不是很好,比起综合教务,安全性差远了,利用爬虫能非常轻易的获得教务的学生照片。

这里只提供图片下载的代码,关于获取图片的url,懂点计算机的都明白(还是要吐槽一下这个教务的安全性),幸亏我们学校用的不是正方系统,不然感觉隐私泄露有点那啥啊!(逃)

public static void download(String urlString, String filename,String savePath) throws Exception {
     InputStream inputStream = null;
     HttpURLConnection httpURLConnection = null;

     try {
       URL url = new URL(urlString);
       System.out.println(urlString);
       httpURLConnection = (HttpURLConnection) url.openConnection();
       httpURLConnection.setConnectTimeout(10000);
       httpURLConnection.setDoInput(true);   
       httpURLConnection.setRequestMethod("GET");
       int responseCode = httpURLConnection.getResponseCode();
       System.out.println(responseCode);
       if (responseCode == 200) {
         // 从服务器返回一个输入流
         inputStream = httpURLConnection.getInputStream();
         byte[] bs = new byte[1024];
         // 读取到的数据长度
         int len;
         // 输出的文件流
        File sf=new File(savePath);
        if(!sf.exists()){
         sf.mkdirs();
        }
        OutputStream os = new FileOutputStream(sf.getPath()+"\\"+filename);
         // 开始读取
         while ((len = inputStream.read(bs)) != -1) {
           os.write(bs, 0, len);
         }
         System.out.println("wancheng");
         // 完毕,关闭所有链接
         os.close();
         inputStream.close();
       }

     } catch (MalformedURLException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
     } catch (IOException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
     }

 }
  • 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
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/67877
推荐阅读
相关标签
  

闽ICP备14008679号