Browse Source

修改验证方法

master
453530270@qq.com 2 years ago
parent
commit
69f8974794
  1. BIN
      fsv2/fstc
  2. 4
      fsv2/handler/serverinfo.go

BIN
fsv2/fstc

Binary file not shown.

4
fsv2/handler/serverinfo.go

@ -5,6 +5,7 @@ import (
"net/http"
"os"
"path/filepath"
"strings"
"xtcfs/config"
"xtcfs/util"
)
@ -32,9 +33,10 @@ func SerInfo(w http.ResponseWriter, r *http.Request) {
// 监听的目录通过?p=的方式传入
urlpath := r.URL.Query().Get("p")
// 防止逃逸,造成漏洞
if urlpath == ".." {
if strings.Contains(urlpath, "../") {
urlpath = "."
}
// 监听的根目录
realFilePath := filepath.Join(config.G.FilePath, urlpath)
// 时间目录的情况

Loading…
Cancel
Save